~~~~~ I want to ask what create_connectivity does because the cell_type in the topology does not increase after the command is executed, so I’m not sure how it works.
~~~~~ There is also when to use fdim = tdim-1, domain.topology.create_connectivity (fdim, tdim), low dimensional to high dimensional (mesh itself is high dimensional why also generate high dimensional topology);When to use domain.topology.create_connectivity(fdim, tdim)?
mesh.topology.create_connectivity(dim0, dim1)
first creates the entities of
dim0
and then dim1
, and then finds the relation between the entities of different dimensions.
A mesh does by default initialize entities of dim 0 (vertices) and dim tdim (cells), and the relation between them.
You would need to use
when an algorithm needs the relation between facets and cells (usually used when identifying degrees of freedom on facets).
Thank you, so, does domain.topology.create_connectivity (fdim, tdim) and domain.topology.create_Connectivity (tdim, fdim) have the same effect?
What do you imply when you say same effect?
# read mesh and meshtags
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, 'mesh.xdmf', 'r') as xdmf:
mesh = xdmf.read_mesh(name="Grid")
subdomains = xdmf.read_meshtags(mesh, name="Grid")
mesh.topology.create_connectivity(mesh.topology.dim, mesh.topology.dim-1)
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, 'mt.xdmf', 'r') as xdmf:
boundaries = xdmf.read_meshtags(mesh, name="Grid")
~~~~ When I use domain.topology.create_Connectivity (3, 2), the cell_type of mesh and its index remain unchanged (Hex, 8 index) as shown below
~~~~ After reading the boundary with meshtag, how did the index (11,21; Index >8) created? And the face cell_type does not appear in the mesh.
~~~~ In addition, I noticed that create_connectivity (fdim, fdim + 1) in “mesh:domain’s (dimension-1)” in the tutorial, what’s the different from create_Connectivity (fdim + 1, fdim)?
I am not sure how you expect the cell type to change?
create_connectivity(dim0,dim1)
creates an AdjacencyList
with the connections from each entity of dim0 to all entities of dim1 (accessible through mesh.topology.connectivity(dim0, dim1)
).
Say we consider a 3 dimensional mesh.
Then mesh.topology.connectivity(3, 2)
will show you a list of all facets connected to each cell. i.e.
mesh.topology.connectivity(3,2).links(i)
gives you a list of the facets (4 for tetrahedrons, 6 for hexahedra) for the ith cell of the mesh.
mesh.topology.connectivity(2, 3)
will give you a list of all cells connected to a given facet. This is either 1 (exterior facet) or 2 (interior facet).