@dokken I had a quick question regarding the usage of meshio
to write meshes for subdomains
that can be loaded into dolfin
. As of now I have 2 numpy
arrays each containing the cells
for a subdomain. Something like:
import meshio, os
meshFolder = os.getcwd()
msh = meshio.read("abaqusMesh.inp")
# msh.points -- all the nodes
# msh.cells[0] -- cells corresponding to one of the subdomain
# msh.cells[1] -- cells corresponding to the other
entireMesh = meshio.Mesh(msh.points, np.vstack((msh.cells[0], msh.cells[1])))
particlesMesh = meshio.Mesh(msh.points, msh.cells[1])
# subdomainMesh = meshio.Mesh(msh.points, ...) # what could be done here?
meshio.write(os.path.join(meshFolder, "entireMesh.xdmf"), entireMesh)
meshio.write(os.path.join(meshFolder, "particles.xdmf"), particlesMesh) # -- only the second subdomain
# and consequently this...
# meshio.write(os.path.join(meshFolder, "subdomains.xdmf"), subdomainMesh)
I want to be able to assemble forms on subdomains like
from dolfin import *
msh = Mesh()
with XDMFFile("entireMesh.xdmf") as sdf:
sdf.read(msh)
subdomains = MeshFunction("size_t", msh, "subdomains.xdmf")
dx = Measure('dx')(subdomain_data=subdomains)
Could you guide me on this or point to appropriate resources?