compile_subdomains does not complain to non-existent variable
This code
domain = compile_subdomains("x[0]<L")
passes without error. This is quite dangerous as user is not warned that L is not initialized by possible variable L from python context.
Comments (11)
-
-
This might be a left-over from the past, kept for backwards compatibility. It isn't pretty.
-
Yes this is a left over. A lot of work has gone in to make compiled expressions robust but not much love has gone into compiled subdomains.
Johan
-
-
assigned issue to
- marked as minor
-
assigned issue to
-
I suggest removing the "feature" of compiling several subdomains in one go, which is used in demo/pde/hyperelasticity/python:
left, right = compile_subdomains(["(std::abs(x[0]) < DOLFIN_EPS) && on_boundary", "(std::abs(x[0] - 1.0) < DOLFIN_EPS) && on_boundary"])
so we can more easily check for given parameters. This might break some user code, but I think it is worth it. Any comments?
-
Removing the 'feature' sounds sensible to me.
-
Yes, and then rename the function. Keep the old with an error message.
-
To compile_subdomain or maybe CompiledSubdomain?
-
Hmm... Both are attractive, but CompiledSubDomain (note capital 'D') seems to be the most consistent with Expression. Or if you want to be really consistent and want to have some fun with more metaclasses, then it should be just SubDomain... ;-)
-
Ok, CompiledSubDomain it is. There was a reason I did not mention SubDomain...
-
- changed status to resolved
Change naming of compile_subdomains to CompiledSubDomain. -- Make CompiledSubDomain more robust, by enforcing setting default arguments (fixing issue 32)
→ <<cset bae2f7038d59>>
- Log in to comment
This came up in a question posted on StackExchange: http://scicomp.stackexchange.com/questions/7232/poiseuille-flow.