Hi Makis,
regarding your first question (I'm not working on ngsxfem):
You have to be aware of the type of your python object!
Code:
...
mesh = Mesh(geo.GenerateMesh(maxh=0.5))
Let's say we have the mesh with two domains (as in the tutorial you linked, full code is attached). If you want to work with material/domains of you mesh, you have the use the NGSolve mesh. You can check the type with:
and the output is
Code:
<class 'ngsolve.comp.Mesh'>
Also use the python help function to find out which functions and members are available for your python object. This can be done by
If you want to use one of your subdomains, you can use the "Material(...)" function. But this function does not return a mesh! It returns a "Region", which can be used the define a finite element space on a subdomain. Again
Code:
type(mesh.Materials('inner'))
tells you the type of the object and python help shows details about this object.
For the second part of your first question you have to use the Netgen mesh. This is available as member of the NGSolve mesh.
returns
Code:
<class 'netgen.libngpy._meshing.Mesh'>
If you now check the help of "mesh.ngmesh" you see the functions to get the points and elements you wanted to use.
Code:
for p in mesh.ngmesh.Points():
x,y,z =p.p
print ("x= ", x, "y= ", y)
for el in mesh.ngmesh.Elements2D():
print (el.vertices)
Best regards,
Christoph