LutzGross / esys-escript.github.io

Other
29 stars 13 forks source link

problem with setTaggedValue #13

Closed AndreaCodd closed 3 years ago

AndreaCodd commented 3 years ago

There is a problem with setTaggedValue. It does not seem to be working.

LutzGross commented 3 years ago

Can you be a bot more specific? Example?

AndreaCodd commented 3 years ago

The output from

dom = finley.ReadGmsh("Kalgoorlie_Gravity_201x338b.msh", numDim=3) w_e = escript.Scalar(0, escript.Function(dom))
w_e.setTaggedValue("DataArea",1) w_e.expand() print('w_e') print(w_e)

is

w_e Summary: inf=0 sup=0 data points=1020688

LutzGross commented 3 years ago

What does dom.showTagNames() say?

AndreaCodd commented 3 years ago

Air, Base, BottomFace, DataArea, PaddingAir, PaddingBase, TopFace

LutzGross commented 3 years ago

You can get the tag number by dom.getTag('DataArea') and check if this is actually being used escript.Function(dom).getListOfTags().

AndreaCodd commented 3 years ago

dom.showTagNames(): Air, Base, BottomFace, DataArea, PaddingAir, PaddingBase, TopFace dom.getTag('DataArea'): 1 escript.Function(dom).getListOfTags(): [3] dom.isValidTagName('DataArea'): True

LutzGross commented 3 years ago

'escript.Function(dom).getListOfTags(): [3]' tells you that there are no elements in the mesh with 'DataArea'=1 tag.

AndreaCodd commented 3 years ago

The mesh and code worked fine last April.

LutzGross commented 3 years ago

it could be a problem with the gmsh file version?

AndreaCodd commented 3 years ago

Ok. I copied an old mesh file from my work PC. and it worked. so I suppose I need to use an older version of gmsh.

LutzGross commented 3 years ago

I believe that you can set the format version when you generate the msh file. it should be 2.2 or lower. Also see #4