compile_subdomains does not complain to non-existent variable

Issue #32 resolved
Jan Blechta created an issue

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)

  1. Prof Garth Wells

    This might be a left-over from the past, kept for backwards compatibility. It isn't pretty.

  2. Johan Hake

    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

  3. Johan Hake

    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?

  4. Anders Logg

    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... ;-)

  5. Johan Hake

    Change naming of compile_subdomains to CompiledSubDomain. -- Make CompiledSubDomain more robust, by enforcing setting default arguments (fixing issue 32)

    → <<cset bae2f7038d59>>

  6. Log in to comment