This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Complicated geometry with multiple block (part)

0 votes

Hi,
I have a very complicated geometry as exodusii which includes 12 different block/part (this part seamlessly are attached to each other ), and each part have different material properties and I am converting it to xml file. Due to complicated nature of the geometry I can't define multiple domain based on coordinate so I need to define each domain based on a marker in my mesh , I also need need to define both my natural and essential bc on complicated surface so I have no option beside using marker on my mesh.
I want to know if any one have any experience with any similar problem and using marker to define domain and bc, if so I would be grateful if you can direct me to right direction.

asked Jan 21, 2015 by Bahram FEniCS Novice (400 points)
edited Jan 21, 2015 by Bahram

1 Answer

+1 vote

What about

V0 = FunctionSpace(mesh,'DG', 0)
mu=Function(V0)
mu_val=[0., 0.345, 0.57] #as may as your domains
helpv = np.asarray(subdomains.array(), dtype=np.int32)
mu.vector()[:] = np.choose(helpv, mu_val)

See e.g. http://www.math.pitt.edu/~sussmanm/3040Summer14/math3040.html example7.py

answered Jan 21, 2015 by mmorandi FEniCS Novice (990 points)

Thank you for the answer,
Part of my question is more in a line that if we can convert the mesh which includes different block and boundary conditions with marker to xml file.

The demo was helpful, I am gonna try it , thank you so much/

...