LutzGross / esys-escript.github.io

Other
29 stars 13 forks source link

finley: dirac delta functions ---- expand and integration issue #40

Open aellery opened 2 years ago

aellery commented 2 years ago

the integrate function gives the wrong answers sometimes

if I multiply a dirac function by a scalar function then integrate then I get the correct answer. If I expand the scalar function then integrate the product I get zero.

electrodes = [(-64., 0., 0.), (-32., 0., 0.), ( 0.0, 0., 0.), ( 32., 0., 0.), ( 64., 0., 0.)]

domain2=ReadGmsh("meshDirac.msh", 3, optimize=True, diracPoints = [sp for sp in electrodes], diracTags = [st for st in range(len(electrodes))])

bob3=Scalar(0., DiracDeltaFunctions(domain2)) bob3.setTaggedValue(0,1) bob3.setTaggedValue(1,1) bob3.setTaggedValue(2,1) bob3.setTaggedValue(3,1) bob3.setTaggedValue(4,1)

print(bob3) bob4=Scalar(1., ContinuousFunction(domain2)) print(integrate(bob4*bob3)) ######### gives the right answer

bob4.expand() print(integrate(bob4*bob3)) ######### gives the WRONG answer print(integrate(bob4)) ######## gives the right answer files.zip

LutzGross commented 2 years ago

I have the feeling this has been fixed.