devitocodes / devito

DSL and compiler framework for automated finite-differences and stencil computation

Home Page:http://www.devitoproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce devito.Zero to replace sympy.Zero in the FD layer

FabioLuporini opened this issue · comments

this way we avoid annoying try-excepts such as

       try:
             theta = model.theta
         except AttributeError:
             theta = 0

or

if theta != 0:
    <expr>

It's not that simple

  • first case has nothing do with FD layer, just the case where the model doesn't have a theta attribute only option is try/catch or getattr
    The second case has so many possibilities tracking them all would be quite a pain