How to Mark Volume and Surface Domains in Complex Geometry

Hello everyone,

I’m want to work with 3D complex biological geometries. I will define multiple volume domains for different material modelling and multiple surface domains for tractions. As you know, it is not possible defining them by using only coordinates. Currently, I’m creating 3D tetra mesh by Abaqus software and import it to FEniCS. For for single domain it works good. However, I am not aware of if I can also export these type of different domains from Abaqus as an component or element-sets and import to FEniCS. Is there any way for it ? If no, can you please suggest me an alternative way ? Thanks.

Regards,

You should be able to use meshio to convert your mesh markers with meshio: meshio · PyPI

Hello dokken,

Thank you for your answer. I installed meshio as you suggested. But it seems like I need an detailed guide to use it properly. I followed the following example and I noted some questions for each line:

import meshio  
mFile = meshio.read('Unit_Cube.inp')  ##Imported the Abaqus file and it works fine.
pts, clls = mFile.points, mFile.cells  ## What does those comments do actually ? Is there other options then "points" and "cell" ? Maybe an option to import predefined surface and volume domains ?
msh_meshio = meshio.Mesh(pts, clls) ## What is the difference between dolfin.Mesh and meshio.Mesh ?
meshio.write('trialMeshio_convert.xdmf',msh_meshio) ## That works fine and i also checked on Paraview.
meshio.write('trialMeshio_convert.xml',msh_meshio) ## It says XML is legacy format. I used to use dolfin-convert to import Abaqus files as inp to XML. Then I used dolfin.Mesh("xxxx.xml") to import mesh. However if the XML is legacy, how should I import the read mesh by meshio ?  dolfin.Mesh("xxxx.xdmf") does not work..

See for instance:

Which covers some of your questions.
You should Also have a look at:

A meshio mesh is a general mesh class for storing mesh data to convert them to different formats.
A dolfin mesh has alot more functions in it, as it is used for FEM.

You can Also use IPython.embed to inspect your Python variables so you can understand what they contain.

Hello dokken,

Thank you for your guidance. I checked the links that you provided and I have tried different approaches however I could not create a surface domain for the example below. My aim is to create a surface domain to the red region. I also tried on gmsh but could not find a solution. Is there any working example/tutorial for such a definition ? Thanks.
image

As I do not use meshes from Abaqus, I do not know the format very well. My suggestion would be to create a minimal example of a abaqus mesh with surface markers, and try to load it into meshio. If that does not work, post it as a minimal example on the meshio issue tracker, and Ask for guidance, Issues · nschloe/meshio · GitHub

There are plenty of tutorials using Gmsh for surface marking, on both the Gmsh pages, on this forum, and at: Test problem 2: Flow past a cylinder (DFG 2D-3 benchmark) — FEniCS-X tutorial
(Stop reading at loading boundary markers, as that is for dolfinx not dolfin)