Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
FEDD::MeshUnstructured< SC, LO, GO, NO > Class Template Reference
Inheritance diagram for FEDD::MeshUnstructured< SC, LO, GO, NO >:

Public Types

typedef Mesh< SC, LO, GO, NO > Mesh_Type
 
typedef Teuchos::RCP< MeshUnstructured< SC, LO, GO, NO > > MeshUnstrPtr_Type
 
typedef Teuchos::RCP< Mesh_TypeMeshPtr_Type
 
typedef std::vector< MeshUnstrPtr_Type > MeshUnstrPtrArray_Type
 
typedef Mesh_Type::CommPtr_Type CommPtr_Type
 
typedef Mesh_Type::CommConstPtr_Type CommConstPtr_Type
 
typedef Mesh_Type::Elements_Type Elements_Type
 
typedef Mesh_Type::ElementsPtr_Type ElementsPtr_Type
 
typedef EdgeElements EdgeElements_Type
 
typedef Teuchos::RCP< EdgeElements_TypeEdgeElementsPtr_Type
 
typedef SurfaceElements SurfaceElements_Type
 
typedef Teuchos::RCP< SurfaceElements_TypeSurfaceElementsPtr_Type
 
typedef MeshInterface< SC, LO, GO, NO > MeshInterface_Type
 
typedef Teuchos::RCP< MeshInterface_TypeMeshInterfacePtr_Type
 
typedef Map< LO, GO, NO > Map_Type
 
typedef Map_Type::MapPtr_Type MapPtr_Type
 
typedef Map_Type::MapConstPtr_Type MapConstPtr_Type
 
typedef Teuchos::OrdinalTraits< LO > OTLO
 
typedef MultiVector< SC, LO, GO, NO > MultiVector_Type
 
typedef Teuchos::RCP< MultiVector_TypeMultiVectorPtr_Type
 
typedef MultiVector< LO, LO, GO, NO > MultiVectorLO_Type
 
typedef Teuchos::RCP< MultiVectorLO_TypeMultiVectorLOPtr_Type
 
typedef Teuchos::RCP< const MultiVector_TypeMultiVectorPtrConst_Type
 
typedef Matrix< SC, LO, GO, NO > Matrix_Type
 
typedef Teuchos::RCP< Matrix_TypeMatrixPtr_Type
 
- Public Types inherited from FEDD::Mesh< default_sc, default_lo, default_go, default_no >
typedef Elements Elements_Type
 
typedef FiniteElement FiniteElement_Type
 
typedef Teuchos::RCP< FiniteElement_TypeFiniteElementPtr_Type
 
typedef Teuchos::RCP< Elements_TypeElementsPtr_Type
 
typedef Teuchos::RCP< MeshMesh_ptr_Type
 
typedef Teuchos::RCP< Teuchos::Comm< int > > CommPtr_Type
 
typedef Teuchos::RCP< const Teuchos::Comm< int > > CommConstPtr_Type
 
typedef const CommConstPtr_Type CommConstPtrConst_Type
 
typedef Map< default_lo, default_go, default_no > Map_Type
 
typedef Teuchos::RCP< Map_TypeMapPtr_Type
 
typedef Teuchos::RCP< const Map_TypeMapConstPtr_Type
 
typedef Teuchos::RCP< const Map_TypeMapConstPtrConst_Type
 
typedef MultiVector< default_sc, default_lo, default_go, default_no > MultiVector_Type
 
typedef Teuchos::RCP< MultiVector_TypeMultiVectorPtr_Type
 
typedef AABBTree< default_sc, default_lo, default_go, default_no > AABBTree_Type
 
typedef Teuchos::RCP< AABBTree_TypeAABBTreePtr_Type
 

Public Member Functions

 MeshUnstructured (CommConstPtr_Type comm, int volumeID=10)
 
void buildP2ofP1MeshEdge (MeshUnstrPtr_Type meshP1)
 Function to build a P2 mesh of a P1 mesh.
 
void setP2SurfaceElements (MeshUnstrPtr_Type meshP1)
 Adding the correct surface subelement to the new P2 Elements based on the P1 subelements.
 
void setSurfaceP2 (FiniteElement &feP2, const FiniteElement &surfFeP1, const vec2D_int_Type &surfacePermutation, int dim)
 Helper function for setP2SurfaceElements. Adds the correct nodes to the meshP1 subelements. Based on sorted Elements.
 
void addSurfaceP2Nodes (FiniteElement &feP2, const FiniteElement &surfFeP1, const vec2D_int_Type &surfacePermutation, int dim)
 Helper function for setP2SurfaceElements. Adds the correct nodes to the meshP1 subelements. Based on unsorted elements. Different approach than above. Based on edge Midpoints.
 
vec_int_Type reorderP2SurfaceIndices (vec_int_Type &additionalP2IDs, vec_int_Type &index, bool track=false)
 Depending on the sorting of P1 surface nodes we have to adjust the new ordering of P2 edge midpoints for surfaces in 3D.
 
void getLocalSurfaceIndices (vec2D_int_Type &surfacePermutation, int surfaceElementOrder)
 Get local Surface Indices.
 
void getEdgeCombinations (vec2D_int_Type &edgeCombinations)
 Get edge combinations.
 
void determinePositionInElementP2 (vec_int_Type &positions, vec_GO_Type &elementsGlobalOfEdge, LO p1ID, LO p2ID, MeshUnstrPtr_Type meshP1)
 Determine position of new P2 node in element, as all elements should follow the same structure.
 
int determineFlagP2 (FiniteElement &fe, LO p1ID, LO p2ID, vec2D_int_Type &permutation)
 Essentially determine flag of an edge. Thus determine P2 Flag for building P2 mesh.
 
int determineFlagP2 (LO p1ID, LO p2ID, LO localEdgeID, vec2D_LO_Type &markedPoint)
 Essentially determine flag of an edge. Thus determine P2 Flag for building P2 mesh. Longer version of other determineFlagP2 function. Also informs whether flag could be found or not (not always the case in parallel)
 
void getTriangles (int vertex1ID, int vertex2ID, vec_int_Type &vertices3ID)
 
SurfaceElementsPtr_Type getSurfaceTriangleElements ()
 
void findSurfaces (const vec_int_Type &elementNodeList, vec_int_Type numbering, vec2D_int_Type &localSurfaceNodeList_vec, vec_int_Type &locSurfaces, bool critical=false)
 
void findEdges (const vec_int_Type &elementNodeList, vec_int_Type numbering, vec2D_int_Type &localEdgeNodeList_vec, vec_int_Type &locEdges)
 Determine which edges belong to an element.
 
MeshInterfacePtr_Type getMeshInterface ()
 Get mesh interface.
 
void buildMeshInterfaceParallelAndDistance (MeshUnstrPtr_Type mesh, vec_int_Type flag_vec, vec_dbl_ptr_Type &distancesToInterface)
 
void partitionInterface ()
 
void setEdgeElements (EdgeElementsPtr_Type edgeElements)
 setEdgeElements with external edges
 
EdgeElementsPtr_Type getEdgeElements ()
 Get EdgeElements.
 
ElementsPtr_Type getSurfaceEdgeElements ()
 Get SurfaceEdgeElements. Edges as only surface elements (i.e. when reading .mesh file). Used in mesh partitioner.
 
void readMeshSize ()
 Reading mesh size.
 
void readMeshEntity (std::string entityType)
 Reading the .mesh files entities.
 
void setMeshFileName (std::string meshFileName, std::string delimiter)
 Set the .mesh file name.
 
int getNumGlobalNodes ()
 Get global number of nodes.
 
void assignEdgeFlags ()
 Assigning flags to all edges.
 
void buildEdgeMap ()
 Building an edgemap from scratch when edges are already distributed parallel.
 
void exportMesh (MapConstPtr_Type mapUnique, MapConstPtr_Type mapRep, bool exportEdges=false, bool exportSurface=false, std::string meshName="export.mesh")
 Exporting Mesh as .mesh file. For most detailed export we also write surfaces and edges. This can be useful/necessary.
 
void exportNodeFlags ()
 
void exportElementFlags ()
 
- Public Member Functions inherited from FEDD::Mesh< default_sc, default_lo, default_go, default_no >
 Mesh (CommConstPtrConst_Type &comm)
 
void deleteData ()
 
void setParameterList (ParameterListPtr_Type &pL)
 Setting input parameterlist to be parameterlist here.
 
ParameterListConstPtr_Type getParameterList () const
 Getter for paramaeterlist that is set here.
 
vec_int_ptr_Type getElementsFlag () const
 Getter for element flags.
 
MapConstPtr_Type getMapUnique () const
 Getter for unique node map.
 
MapConstPtr_Type getMapRepeated () const
 Getter for repeated node mal.
 
MapConstPtr_Type getElementMap () const
 Getter for element map.
 
MapConstPtr_Type getEdgeMap ()
 Getter for edge map.
 
vec2D_dbl_ptr_Type getPointsRepeated () const
 getter for list of repeated points with x,y,z coordinates in each row
 
vec2D_dbl_ptr_Type getPointsUnique () const
 getter for list of unique points with x,y,z coordinates in each row
 
vec_int_ptr_Type getBCFlagRepeated () const
 Getter for flags corresponting to repeated points.
 
vec_int_ptr_Type getBCFlagUnique () const
 Getter for flags corresponting to unique points.
 
ElementsPtr_Type getElementsC ()
 Returns element list as c-object.
 
ElementsPtr_Type getSurfaceElements ()
 Getter for surface elements. Probably set in mesh partitioner. They are generally the dim-1 surface elements.
 
int getDimension ()
 
default_go getNumElementsGlobal ()
 Global number of elements.
 
default_lo getNumElements ()
 Local number of elements.
 
default_lo getNumPoints (std::string type="Unique")
 Get local (LO) number of points either in unique or repeated version.
 
int getOrderElement ()
 
CommConstPtrConst_Type getComm ()
 Communicator object.
 
int setStructuredMeshFlags (int flags)
 This is done in meshStructured. Maybe we should move it here or delete this.
 
void setElementFlags (std::string type="")
 Something for TPM. Can be deprecated soon.
 
void setReferenceConfiguration ()
 Setting current coordinates as reference configuration. Should only be called once :D.
 
void moveMesh (MultiVectorPtr_Type displacementUnique, MultiVectorPtr_Type displacementRepeated)
 Moving mesh according to displacement based on reference configuration.
 
int getSurfaceElementOrder ()
 Get SurfaceElement order.
 
int getEdgeElementOrder ()
 Get EdgeElement order.
 
void create_AABBTree ()
 
vec_int_ptr_Type findElemsForPoints (vec2D_dbl_ptr_Type query_points)
 
vec_dbl_Type getBaryCoords (vec_dbl_Type point, int element)
 
bool isPointInElem (vec_dbl_Type point, int element)
 
tuple_intint_Type getRankRange () const
 
void deleteSurfaceElements ()
 Deleting surface elements, called after reading input mesh.
 
void correctNormalDirections ()
 Correcting the normal direction of all surface normals set as subelements of volume elements to be outward normals.
 
void correctElementOrientation ()
 Correct the element orientation of all elements to have positive volume / det when doint transformation.
 
vec2D_int_ptr_Type getElements ()
 Returns elements as a vector type contrary to the C-object list.
 

Public Attributes

MeshInterfacePtr_Type meshInterface_
 
int volumeID_
 
EdgeElementsPtr_Type edgeElements_
 
ElementsPtr_Type surfaceEdgeElements_
 
SurfaceElementsPtr_Type surfaceTriangleElements_
 
std::string meshFileName_
 
std::string delimiter_
 
int numSurfaces_
 
int numEdges_
 
int numNodes_
 
- Public Attributes inherited from FEDD::Mesh< default_sc, default_lo, default_go, default_no >
int dim_
 
long long numElementsGlob_
 
std::string FEType_
 
MapPtr_Type mapUnique_
 
MapPtr_Type mapRepeated_
 
vec2D_dbl_ptr_Type pointsRep_
 
vec2D_dbl_ptr_Type pointsUni_
 
vec_int_ptr_Type bcFlagRep_
 
vec_int_ptr_Type bcFlagUni_
 
ElementsPtr_Type surfaceElements_
 
ElementsPtr_Type elementsC_
 
MapPtr_Type elementMap_
 
MapPtr_Type edgeMap_
 
CommConstPtrConst_Type comm_
 
vec2D_int_ptr_Type elementsVec_
 
vec2D_dbl_ptr_Type pointsRepRef_
 
vec2D_dbl_ptr_Type pointsUniRef_
 
int elementOrder_
 
int surfaceElementOrder_
 
int edgesElementOrder_
 
AABBTreePtr_Type AABBTree_
 
tuple_intint_Type rankRange_
 

Member Function Documentation

◆ addSurfaceP2Nodes()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::addSurfaceP2Nodes ( FiniteElement & feP2,
const FiniteElement & surfFeP1,
const vec2D_int_Type & surfacePermutation,
int dim )

Helper function for setP2SurfaceElements. Adds the correct nodes to the meshP1 subelements. Based on unsorted elements. Different approach than above. Based on edge Midpoints.

Parameters
[in]feP2P2 element
[in]surfFeP1P1 surface element that need new P2 nodes
[in]surfacePermutationSurface permutations of element
[in]dimDimension
Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignEdgeFlags()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::assignEdgeFlags ( )

Assigning flags to all edges.

Not all edges are marked with a flag in the beginning. In order to set the correct flags to new points we assign the edge flag of the edge they originated from, similar to the function determineEdgeFlagP2, but this function uses the edgeMap.

Todo
Elaboration of Flag Assignment Process. i.e. Lowest flag is used etc.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildP2ofP1MeshEdge()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::buildP2ofP1MeshEdge ( MeshUnstrPtr_Type meshP1)

Function to build a P2 mesh of a P1 mesh.

Parameters
[in]meshP1The p1 mesh we use for building P2 mesh
Here is the call graph for this function:
Here is the caller graph for this function:

◆ determineFlagP2() [1/2]

template<class SC, class LO, class GO, class NO>
int FEDD::MeshUnstructured< SC, LO, GO, NO >::determineFlagP2 ( FiniteElement & fe,
LO p1ID,
LO p2ID,
vec2D_int_Type & permutation )

Essentially determine flag of an edge. Thus determine P2 Flag for building P2 mesh.

Parameters
[in]feElement the edge belongs to. Use to look through subelements
[in]p1IDLocal ID of first node of edge
[in]p2IDLocal ID of second node of edge
[in]permutationEdge combinations of element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ determineFlagP2() [2/2]

template<class SC, class LO, class GO, class NO>
int FEDD::MeshUnstructured< SC, LO, GO, NO >::determineFlagP2 ( LO p1ID,
LO p2ID,
LO localEdgeID,
vec2D_LO_Type & markedPoint )

Essentially determine flag of an edge. Thus determine P2 Flag for building P2 mesh. Longer version of other determineFlagP2 function. Also informs whether flag could be found or not (not always the case in parallel)

Parameters
[in]p1IDLocal ID of first node of edge
[in]p2IDLocal ID of second node of edge
[in]localEdgeIDLocalEdge ID of second node of edge
[in]markedPointEdge information, if no flag was found
Here is the call graph for this function:

◆ determinePositionInElementP2()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::determinePositionInElementP2 ( vec_int_Type & positions,
vec_GO_Type & elementsGlobalOfEdge,
LO p1ID,
LO p2ID,
MeshUnstrPtr_Type meshP1 )

Determine position of new P2 node in element, as all elements should follow the same structure.

Parameters
[in]positions
[in]elementsGlobalOfEdgeGlobal IDs of elements connected to the edge (numbering needs to be consistent)
[in]p1IDLocal ID of first node of edge
[in]p2IDLocal ID of second node of edge
[in]meshP1The p1 mesh we use for building P2 mesh
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportMesh()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::exportMesh ( MapConstPtr_Type mapUnique,
MapConstPtr_Type mapRep,
bool exportEdges = false,
bool exportSurface = false,
std::string meshName = "export.mesh" )

Exporting Mesh as .mesh file. For most detailed export we also write surfaces and edges. This can be useful/necessary.

Parameters
[in]meshNamefor export
[in]exportEdgeswether to export edges or not
[in]exportSurfaceswhether to export surfaces or not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findEdges()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::findEdges ( const vec_int_Type & elementNodeList,
vec_int_Type numbering,
vec2D_int_Type & localEdgeNodeList_vec,
vec_int_Type & locEdges )

Determine which edges belong to an element.

Parameters
[in]elementNodeListlocal node IDs of one element
[in]numbering
[in]localEdgeNodeList_veclocal node IDs of edges
[in]locEdgesvector that stores the local IDs of edges belonging to element of elementNodeList
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEdgeElements()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
EdgeElementsPtr_Type FEDD::MeshUnstructured< SC, LO, GO, NO >::getEdgeElements ( )
inline

Get EdgeElements.

Returns
edgeElements_
Here is the caller graph for this function:

◆ getMeshInterface()

template<class SC, class LO, class GO, class NO>
MeshUnstructured< SC, LO, GO, NO >::MeshInterfacePtr_Type FEDD::MeshUnstructured< SC, LO, GO, NO >::getMeshInterface ( )

Get mesh interface.

Returns
meshInterface_
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumGlobalNodes()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
int FEDD::MeshUnstructured< SC, LO, GO, NO >::getNumGlobalNodes ( )
inline

Get global number of nodes.

Returns
numNodes_

◆ getSurfaceEdgeElements()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
ElementsPtr_Type FEDD::MeshUnstructured< SC, LO, GO, NO >::getSurfaceEdgeElements ( )
inline

Get SurfaceEdgeElements. Edges as only surface elements (i.e. when reading .mesh file). Used in mesh partitioner.

Returns
surfaceEdgeElements_

◆ readMeshEntity()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::readMeshEntity ( std::string entityType)

Reading the .mesh files entities.

Parameters
[in]entityTypei.e. nodes, edges, elements...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEdgeElements()

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::setEdgeElements ( EdgeElementsPtr_Type edgeElements)
inline

setEdgeElements with external edges

Parameters
[in]edgeElements

◆ setP2SurfaceElements()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::setP2SurfaceElements ( MeshUnstrPtr_Type meshP1)

Adding the correct surface subelement to the new P2 Elements based on the P1 subelements.

Parameters
[in]meshP1The p1 mesh we use for building P2 mesh
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSurfaceP2()

template<class SC, class LO, class GO, class NO>
void FEDD::MeshUnstructured< SC, LO, GO, NO >::setSurfaceP2 ( FiniteElement & feP2,
const FiniteElement & surfFeP1,
const vec2D_int_Type & surfacePermutation,
int dim )

Helper function for setP2SurfaceElements. Adds the correct nodes to the meshP1 subelements. Based on sorted Elements.

Parameters
[in]feP2P2 element
[in]surfFeP1P1 surface element that need new P2 nodes
[in]surfacePermutationSurface permutations of element
[in]dimDimension
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: