I have an imported gmsh consisting of two domains (name: slab,tag: 11) and (name: rebar, tag: 12).
from contextlib import ExitStack
import numpy as np
from dolfinx import la
from dolfinx.fem import (Expression, Function, FunctionSpace,
VectorFunctionSpace, dirichletbc, form,
locate_dofs_topological)
from dolfinx.fem.petsc import (apply_lifting, assemble_matrix, assemble_vector,
set_bc)
from dolfinx.io import XDMFFile
from dolfinx.mesh import (CellType, GhostMode, create_box,
locate_entities_boundary)
from ufl import dx, grad, inner
from mpi4py import MPI
from petsc4py import PETSc
dtype = PETSc.ScalarType
from mpi4py import MPI
import meshio
## original mesh file
msh = meshio.read("mesh3D.msh")
## physical surface & volume data
for key in msh.cell_data_dict["gmsh:physical"].keys():
if key == "triangle":
triangle_data = msh.cell_data_dict["gmsh:physical"][key]
elif key == "tetra":
tetra_data = msh.cell_data_dict["gmsh:physical"][key]
## cell data
tetra_cells = np.array([None])
triangle_cells = np.array([None])
for cell in msh.cells:
if cell.type == "tetra":
if tetra_cells.all() == None:
tetra_cells = cell.data
else:
tetra_cells = np.concatenate((tetra_cells,cell.data))
elif cell.type == "triangle":
if triangle_cells.all() == None:
triangle_cells = cell.data
else:
triangle_cells = np.concatenate((triangle_cells,cell.data))
print('done')
The lengths for tetra_cells and tetra_data are the same. tetra_data seems to contain the group tags 11 and 12 for each cell.
There will be a modulus of elasticity for group 11 and 12 for concrete and steel respectively to account for. What I would like to start to do at first is set up a function space system for the two domains that are imported. There will be a boundary condition at nodes near Z=-72 and Z=72 where displacement should be zero for a fixed support at each end. I guess to set up an analysis is maybe beyond the scope of this question so far I just would like to see how to start to set that up…
Anyone can help me please how to set up for the two imported domains a function space taking into account the two modulus E’s and the boundary conditions?
P.S. My current version for dolfinx is V0.6.0 installed with spack. I tried to use the import function from:
however I could not yet get it moved onto dolfinx v0.6.0 there were some import challenges to get through where imports have changed. Anyone can help me to find where those are in dolfinx v0.6…0?