コード例 #1
0
 def cell_avg(self, o, a):
     # Cell average of a single function and differentiation commutes.
     f, fp = a
     o = self.reuse_if_possible(o, f)
     if isinstance(fp, ConstantValue):
         return (o, fp) # TODO: Necessary? Can't CellAvg simplify directly instead?
     else:
         return (o, cell_avg(fp))
コード例 #2
0
 def cell_avg(self, o, a):
     # Cell average of a single function and differentiation commutes.
     f, fp = a
     o = self.reuse_if_possible(o, f)
     if isinstance(fp, ConstantValue):
         return (
             o, fp
         )  # TODO: Necessary? Can't CellAvg simplify directly instead?
     else:
         return (o, cell_avg(fp))
コード例 #3
0
 def cell_avg(self, o, fp):
     # Cell average of a single function and differentiation
     # commutes, D_f[v](cell_avg(f)) = cell_avg(v)
     return cell_avg(fp)
コード例 #4
0
ファイル: apply_derivatives.py プロジェクト: FEniCS/ufl
 def cell_avg(self, o, fp):
     # Cell average of a single function and differentiation
     # commutes, D_f[v](cell_avg(f)) = cell_avg(v)
     return cell_avg(fp)