MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / div

Function div

python/utils.py:69–82  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

67 raise Exception("cannot form curl")
68
69def div(func):
70 if func.derivname == "div":
71 return func.Deriv()
72 try:
73 return func.Operator("div")
74 except:
75 pass
76 try:
77 return Trace(grad(func))
78 except:
79 pass
80 #if func.derivname == "grad" and len(func.dims)==2: # should check for square
81 # return Trace(grad(func))
82 raise Exception("cannot form div")
83
84
85def ConstantCF(val):

Callers 9

test_hiddenFunction · 0.85
test_shapeopt_2dFunction · 0.85
test_code_genFunction · 0.85
_maxwell_slFunction · 0.85
navierstokes.pyFile · 0.85
mixed.pyFile · 0.85
tdnns.pyFile · 0.85
hhj.pyFile · 0.85

Calls 3

TraceFunction · 0.85
gradFunction · 0.85
OperatorMethod · 0.45

Tested by 5

test_hiddenFunction · 0.68
test_shapeopt_2dFunction · 0.68
test_code_genFunction · 0.68
_maxwell_slFunction · 0.68