Implementing a SubDomain function that returns the domain id instead of bool
Garth says:
"I would like to change SubDomain::inside to return an integer which
would make it possible to create multiple subdomains with just one
loop over the mesh."
If it returns an int, "inside" is not a good name, and lots of existing code will break, so maybe it's better to introduce a new function?
Pseudocode of the different aspects here:
class SubDomain
{
public:
virtual bool inside(x, ...) { throw notimplemented(); }
virtual bool domain_id(x, ...); { throw notimplemented(); }
};
class MyDomain1(
def inside(self, x, ...):
return True
class MyDomain2(
def domain_id(self, x, ...):
return 3
Then old code keeps working and new code can just implement the other function.
And by overloading mark() signatures we can simply do:
MyDomain1(
MyDomain2(
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by