Structure
Mesh datatype is simply a collection of mesh elements.
In EASIFEM mesh is a homogeneous collection of reference elements. All elements in mesh should be of same type (i.e., triangle, quadrangle, tetrahedron, etc.). Two mesh can have different types of elements. For example, we can define a mesh of triangle element or a mesh of tetrahedron element.
TYPE :: Mesh_
PRIVATE
LOGICAL(LGT) :: readFromFile = .TRUE.
!! True if the mesh is read from a file
LOGICAL(LGT) :: isInitiated = .FALSE.
!! logical flag denoting for whether mesh data is Initiated or not
LOGICAL(LGT) :: isNodeToElementsInitiated = .FALSE.
!! Node to elements mapping
LOGICAL(LGT) :: isNodeToNodesInitiated = .FALSE.
!! Node to nodes mapping
LOGICAL(LGT) :: isExtraNodeToNodesInitiated = .FALSE.
!! Node to nodes mapping
LOGICAL(LGT) :: isElementToElementsInitiated = .FALSE.
!! Element to elements mapping
LOGICAL(LGT) :: isBoundaryDataInitiated = .FALSE.
!! Boundary data
LOGICAL(LGT), PUBLIC :: isFacetDataInitiated = .FALSE.
!! FacetData
!! TODO: Make isFacetDataInitiated PRIVATE
INTEGER(I4B) :: uid = 0
!! Unique id of the mesh
INTEGER(I4B) :: xidim = 0
!! xidimension of elements present inside the mesh
INTEGER(I4B) :: elemType = 0
!! type of element present inside the mesh
INTEGER(I4B) :: nsd = 0
!! number of spatial dimension of the mesh
INTEGER(I4B), PUBLIC :: maxNptrs = 0
!! largest node number present inside the mesh
INTEGER(I4B), PUBLIC :: minNptrs = 0
!! minimum node number present inside the mesh
INTEGER(I4B), PUBLIC :: maxElemNum = 0
!! largest element number present inside the mesh
INTEGER(I4B), PUBLIC :: minElemNum = 0
!! minimum element number present inside the mesh
INTEGER(I4B) :: tNodes = 0
!! total number of nodes present inside the mesh
INTEGER(I4B) :: tIntNodes = 0
!! total number of internal nodes inside the mesh
INTEGER(I4B) :: tElements = 0
!! total number of elements present inside the mesh
!! It is the size of elemNumber vector
REAL(DFP) :: minX = 0.0
!! minimum value of x coordinate
REAL(DFP) :: maxX = 0.0
!! maximum value of x coordinate
REAL(DFP) :: minY = 0.0
!! minimum value of y coordinate
REAL(DFP) :: maxY = 0.0
!! maximum value of y coordinate
REAL(DFP) :: minZ = 0.0
!! minimum value of z coordinate
REAL(DFP) :: maxZ = 0.0
!! maximum value of z coordinate
REAL(DFP) :: X = 0.0
!! x coorindate of centroid
REAL(DFP) :: Y = 0.0
!! y coordinate of centroid
REAL(DFP) :: Z = 0.0
!! z coordinate of centroid
INTEGER(I4B), ALLOCATABLE :: physicalTag(:)
!! Physical entities associated with the current entity (mesh)
INTEGER(I4B), ALLOCATABLE :: boundingEntity(:)
!! Bounding entity numbers of the current entity
INTEGER(I4B), ALLOCATABLE :: local_elemNumber(:)
!! List of local element numbers, the lowerbound is `minElemNum`
!! and upper bound is `maxElemNum`. In this way, local_elemNumber(iel)
!! returns the local element number of global element number iel.
INTEGER(I4B), ALLOCATABLE :: local_Nptrs(:)
!! Returns local node number from a global node number
!! Its length is from 1 to maxNptrs
!! Helpul in finding if a global node is present inside the mesh or not
INTEGER(I4B), ALLOCATABLE :: material(:)
!! materials mapped to the mesh
!! material(1) is the material id of medium 1
!! material(2) is the material id of medium 2
!! ...
!! material(n) is the material id of medium n
!!
!! For example, soil is a porous medium n = 1,
!! fluid is a medium n =2
!! then material(1) denotes the type of soil => clay, sand, silt
!! and material(2) denotes the type of fluid, water, oil, air
TYPE(ReferenceElement_), PUBLIC, ALLOCATABLE :: facetElements(:)
!! Facet Elements in the reference element
INTEGER(I4B), ALLOCATABLE :: facetElementType(:, :)
!! Number of rows of this array is same as the total number of
!! facets present in the mesh-reference elements
!! Number of columns of this array is equal to the total number of
!! elements inside the mesh
!! facetElementType(ii, iel) can be
!! INTERNAL_ELEMENT, BOUNDARY_ELEMENT, DOMAIN_BOUNDARY_ELEMENT
!! If the face is a part of the mesh boundary then it will be called
!! the BOUNDARY_ELEMENT
TYPE(NodeData_), ALLOCATABLE :: nodeData(:)
!! Node data
TYPE(ElemData_), ALLOCATABLE :: elementData(:)
!! element data
TYPE(InternalFacetData_), PUBLIC, ALLOCATABLE :: internalFacetData(:)
!! Internal facet data
TYPE(BoundaryFacetData_), PUBLIC, ALLOCATABLE :: boundaryFacetData(:)
!! Domain Facet Data
CLASS(ReferenceElement_), PUBLIC, POINTER :: refelem => NULL()
!! Reference element of the mesh (spatial)
!! TODO: Change refelem to Type(ReferenceElement_)
REAL(DFP), ALLOCATABLE :: quality(:, :)
!! number of rows are meshquality
!! number of columns are elements
INTEGER(I4B), PUBLIC :: ipType = Equidistance
!! interpolation point type
! Following variables are required during processing.
! time
TYPE(QuadraturePoint_), PUBLIC :: quadForTime
!! quadrature point for time domain #STFEM
TYPE(ElemshapeData_), PUBLIC :: linTimeElemSD
!! Element shape data on linear time element #STFEM
TYPE(ElemshapeData_), PUBLIC :: timeElemSD
!! Element shape data on time element #STFEM
TYPE(String) :: quadTypeForTime
!! quadrature type for time
TYPE(String) :: continuityTypeForTime
!! continuity of base function for time
TYPE(String) :: interpolTypeForTime
!! interpolation of base function for time
INTEGER(I4B) :: orderTime
!! order for time
! space (cell)
TYPE(QuadraturePoint_), PUBLIC :: quadForSpace
!! quadrature point for space
TYPE(ElemshapeData_), PUBLIC :: linSpaceElemSD
!! Element shape data on linear space (simplex) element
TYPE(ElemshapeData_), PUBLIC :: spaceElemSD
!! Element shape data on space element
TYPE(STElemshapeData_), ALLOCATABLE, PUBLIC :: stelemsd(:)
!! Element shape data on space element
TYPE(String) :: quadTypeForSpace
!! quadrature type for space
TYPE(String) :: continuityTypeForSpace
!! continuity of base function for space
TYPE(String) :: interpolTypeForSpace
!! interoplation type of base function for space
INTEGER(I4B) :: orderSpace
!! order for space
! space (facets)
TYPE(QuadraturePoint_), ALLOCATABLE, PUBLIC :: quadForFacet(:)
!! quadrature point for facet elements
TYPE(QuadraturePoint_), ALLOCATABLE, PUBLIC :: quadForFacetCell(:)
!! quadrature point for facet-cell elements
TYPE(ElemshapeData_), ALLOCATABLE, PUBLIC :: linFacetElemSD(:)
!! Element shape data on linear facet (simplex) element
TYPE(ElemshapeData_), ALLOCATABLE, PUBLIC :: linFacetCellElemSD(:)
!! Element shape data on linear facet (simplex) cell element
TYPE(ElemshapeData_), ALLOCATABLE, PUBLIC :: facetElemSD(:)
!! Element shape data on facet element
TYPE(ElemshapeData_), ALLOCATABLE, PUBLIC :: facetCellElemSD(:)
!! Element shape data on facet cell element
TYPE(String) :: quadTypeForFacet
!! quadrature type for facet element
TYPE(String) :: continuityTypeForFacet
!! continuity of base function for facet element
TYPE(String) :: interpolTypeForFacet
!! interoplation type of base function for facet element
INTEGER(I4B) :: orderFacet
!! order for facet element
TYPE(STElemshapeData_), ALLOCATABLE, PUBLIC :: facetSTelemsd(:, :)
!! Element shape data on facet element
END TYPE Mesh_
-
readFromFile
is true if the mesh is read from a file. -
isInitiated
is logical flag denoting whether mesh data is initiated or not. -
isNodeToElementsInitiated
is true if node to elements mapping is initiated. -
isNodeToNodesInitiated
is true of node to nodes mapping is initiated. -
isElementToElementsInitiated
is true if element to elements mapping available. -
isBoundaryDataInitiated
is true if boundary data is available. -
uid
denotes the unique-id of the mesh. -
xidim
denotes thexidimension
of elements present inside the mesh,xidim
= (0,1,2,3) for (point, line, surface, volume) elements. -
elemType
denotes the type of element present inside the mesh. -
nsd
denotes the number of spatial dimension of the mesh. -
maxNptrs
stands for the largest node number present inside the mesh. -
minNptrs
stands for the smallest node number present inside the mesh. -
maxElemNum
denotes the largest element number present inside the mesh. -
minElemNum
denotes the smallest element number present inside the mesh. -
tNodes
is the total number of (local) nodes present inside the mesh. -
tIntNodes
is the total number of internal nodes inside the mesh. -
tElements
is the total number of elements present inside the mesh. It is the size ofelemNumber
vector. -
minX
denotes the minimum value of x coordinate ofboundingbox
. -
maxX
denotes the maximum value of x coordinate ofboundingbox
. -
minY
is the minimum value of y coordinate ofboundingbox
. -
maxY
is the maximum value of y coordinate ofboundingbox
. -
minZ
is the minimum value of z coordinate ofboundingbox
. -
maxZ
is the maximum value of z coordinate ofboundingbox
. -
X
is the x coordinate of center of mesh. -
Y
is the y coordinate of center of mesh. -
Z
is the z coordinate of center of mesh. -
physicalTag
denotes the physical entities associated with the current entity (mesh) -
boundingEntity
denotes the bounding entity numbers of the current entity -
local_elemNumber
denotes the list of local element numbers, the lower bound isminElemNum
and upper bound ismaxElemNum
. In this way,local_elemNumber(iel)
returns the local element number of global element numberiel
. -
local_Nptrs
returns the local node number from a global node number. Its length is from 1 tomaxNptrs
. Helpful in finding if a global node is present inside the mesh or not. -
material
materials mapped to the mesh, for examplematerial(1)
is the material-id of medium 1material(2)
is the material-id of medium 2material(n)
is the material-id of medium n- For example, soil is a porous medium n = 1,
- fluid is a medium n =2
- then material(1) denotes the type of soil, that is, clay, sand, and silt.
- and material(2) denotes the type of fluid, water, oil, air.
-
facetElements
denotes the facet Elements in the reference element -
facetElementType
- Number of rows of this array is same as the total number of facets present in the mesh’s reference-element.
- Number of columns of this array is equal to the total number of elements inside the mesh.
- In this way,
facetElementType(ii, iel)
denotes theii
th facet’s type of element local element numberiel
facetElementType
can beINTERNAL_ELEMENT
,BOUNDARY_ELEMENT
,DOMAIN_BOUNDARY_ELEMENT
.
- If the face is a part of the mesh boundary then it will be called the
BOUNDARY_ELEMENT
- If the face is part of domain boundary, then it is a
DOMAIN_BOUNDARY_ELEMENT
- If the facet is internal to a mesh, then it is a
INTERNAL_ELEMENT
- Note that every,
DOMAIN_BOUNDARY_ELEMENT
isBOUNDARY_ELEMENT
but not vice-versa.
-
nodeData
node data -
elementData
element data -
internalFacetData
internal facet data -
boundaryFacetData
boundary facet Data -
refelem
Reference element of the mesh (spatial).
Following variables are required during for time shape functions in space-time finite elements.
quadForTime
, quadrature point for time domainlinTimeElemSD
Element shape data on linear time elementtimeElemSD
Element shape data on time elementquadTypeForTime
quadrature type for timecontinuityTypeForTime
continuity of base function for timeinterpolTypeForTime
interpolation of base function for timeorderTime
order for time
Following variables are required during for space-shape functions finite elements computations.
quadForSpace
quadrature point for spacelinSpaceElemSD
Element shape data on linear space (simplex) elementspaceElemSD
Element shape data on space elementstelemsd
Element shape data on space elementquadTypeForSpace
quadrature type for spacecontinuityTypeForSpace
continuity of base function for spaceinterpolTypeForSpace
interpolation type of base function for spaceorderSpace
order for space
Following variables are required during for shape functions on facet elements in finite elements computations.
quadForFacet
quadrature point for facet elementslinFacetElemSD
Element shape data on linear facet (simplex) elementfacetElemSD
Element shape data on facet elementfacetSTelemsd
Element shape data on facet elementquadTypeForFacet
quadrature type for facet elementcontinuityTypeForFacet
continuity of base function for facet elementinterpolTypeForFacet
interpolation type of base function for facet elementorderFacet
order for facet element