KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::LocalRefineGeometryMesh Class Reference

#include <local_refine_geometry_mesh.hpp>

Inheritance diagram for Kratos::LocalRefineGeometryMesh:
Collaboration diagram for Kratos::LocalRefineGeometryMesh:

Public Types

Type Definitions
typedef ModelPart::NodesContainerType NodesArrayType
 
typedef ModelPart::ElementsContainerType ElementsArrayType
 
typedef ModelPart::ConditionsContainerType ConditionsArrayType
 
typedef std::vector< MatrixMatrix_Order_Tensor
 
typedef std::vector< VectorVector_Order_Tensor
 
typedef std::vector< Vector_Order_TensorNode_Vector_Order_Tensor
 
typedef Node PointType
 
typedef Node ::Pointer PointPointerType
 
typedef std::vector< PointType::Pointer > PointVector
 
typedef PointVector::iterator PointIterator
 

Public Member Functions

Life Cycle
 LocalRefineGeometryMesh (ModelPart &model_part)
 Default constructors. More...
 
virtual ~LocalRefineGeometryMesh ()=default
 Destructor. More...
 
Operations
virtual void LocalRefineMesh (bool refine_on_reference, bool interpolate_internal_variables)
 
virtual void CSRRowMatrix (ModelPart &this_model_part, compressed_matrix< int > &Coord)
 
virtual void SearchEdgeToBeRefined (ModelPart &this_model_part, compressed_matrix< int > &Coord)
 
virtual void CreateListOfNewNodes (ModelPart &this_model_part, compressed_matrix< int > &Coord, std::vector< int > &List_New_Nodes, std::vector< array_1d< int, 2 > > &Position_Node)
 
virtual void CalculateCoordinateAndInsertNewNodes (ModelPart &this_model_part, const std::vector< array_1d< int, 2 > > &Position_Node, const std::vector< int > &List_New_Nodes)
 
virtual void EraseOldElementAndCreateNewElement (ModelPart &this_model_part, const compressed_matrix< int > &Coord, PointerVector< Element > &New_Elements, bool interpolate_internal_variables)
 
virtual void EraseOldConditionsAndCreateNew (ModelPart &this_model_part, const compressed_matrix< int > &Coord)
 
virtual void CalculateEdges (Element::GeometryType &geom, const compressed_matrix< int > &Coord, int *edge_ids, std::vector< int > &aux)
 
void CreatePartition (unsigned int number_of_threads, const int number_of_rows, vector< unsigned int > &partitions)
 
template<typename TGeometricalObjectPointerType >
void InterpolateInteralVariables (const int &number_elem, const TGeometricalObjectPointerType father_elem, TGeometricalObjectPointerType child_elem, const ProcessInfo &rCurrentProcessInfo)
 
virtual void UpdateSubModelPartNodes (ModelPart &rModelPart)
 
virtual void ResetFatherNodes (ModelPart &rModelPart)
 

Protected Member Functions

Protected Operators
template<typename TIteratorType >
void SearchEdgeToBeRefinedGeneric (TIteratorType GeometricalObjectsBegin, TIteratorType GeometricalObjectsEnd, compressed_matrix< int > &rCoord)
 

Protected Attributes

Protected member Variables
ModelPartmModelPart
 
int mCurrentRefinementLevel
 The model part to be refined. More...
 
std::unordered_map< std::size_t, unsigned intmMapNodeIdToPos
 The current refinement level. More...
 
std::vector< std::size_t > mMapPosToNodeId
 

Member Typedef Documentation

◆ ConditionsArrayType

◆ ElementsArrayType

◆ Matrix_Order_Tensor

◆ Node_Vector_Order_Tensor

◆ NodesArrayType

◆ PointIterator

typedef PointVector::iterator Kratos::LocalRefineGeometryMesh::PointIterator

◆ PointPointerType

◆ PointType

◆ PointVector

typedef std::vector<PointType::Pointer> Kratos::LocalRefineGeometryMesh::PointVector

◆ Vector_Order_Tensor

Constructor & Destructor Documentation

◆ LocalRefineGeometryMesh()

Kratos::LocalRefineGeometryMesh::LocalRefineGeometryMesh ( ModelPart model_part)
inline

Default constructors.

◆ ~LocalRefineGeometryMesh()

virtual Kratos::LocalRefineGeometryMesh::~LocalRefineGeometryMesh ( )
virtualdefault

Destructor.

Member Function Documentation

◆ CalculateCoordinateAndInsertNewNodes()

void Kratos::LocalRefineGeometryMesh::CalculateCoordinateAndInsertNewNodes ( ModelPart this_model_part,
const std::vector< array_1d< int, 2 > > &  Position_Node,
const std::vector< int > &  List_New_Nodes 
)
virtual

Computes the coordinates of the new nodes in the center of the edges Insert the news nodes in the model part and interpolate the variables

Parameters
List_New_NodesList that contents the index of the new nodes to be created
Position_NodeThe vector that contents the position in the edge of the new nodes
Returns
this_model_part: The model part of the model (it is the input too)

◆ CalculateEdges()

void Kratos::LocalRefineGeometryMesh::CalculateEdges ( Element::GeometryType geom,
const compressed_matrix< int > &  Coord,
int edge_ids,
std::vector< int > &  aux 
)
virtual

It calculates the new edges of the new elements first it calculates the new edges correspondign to the lower face (as a triangle), later it added to the upper face

Parameters
geomThe prism element geometry
edge_idsThe ids of the edges
Returns
aux: The vector that includes the index of the new edges

Reimplemented in Kratos::LocalRefineTetrahedraMesh, and Kratos::LocalRefinePrismMesh.

◆ CreateListOfNewNodes()

void Kratos::LocalRefineGeometryMesh::CreateListOfNewNodes ( ModelPart this_model_part,
compressed_matrix< int > &  Coord,
std::vector< int > &  List_New_Nodes,
std::vector< array_1d< int, 2 > > &  Position_Node 
)
virtual

It creates the list of new nodes

Returns
this_model_part: The model part of the model (it is the input too)
Coord: The matrix that stores all the index of the geometry
List_New_Nodes: List that contents the index of the new nodes to be created
Position_Node: The vector that contents the position in the edge of the new nodes

◆ CreatePartition()

void Kratos::LocalRefineGeometryMesh::CreatePartition ( unsigned int  number_of_threads,
const int  number_of_rows,
vector< unsigned int > &  partitions 
)
inline

It creates a partition of the process between the different threads

Parameters
number_of_threadsNumber the threads considered in the computation
number_of_rows
Returns
partitions: The vector that contents the partitions corresponding to each thread

◆ CSRRowMatrix()

void Kratos::LocalRefineGeometryMesh::CSRRowMatrix ( ModelPart this_model_part,
compressed_matrix< int > &  Coord 
)
virtual

This function initialises the matrix Cord

Returns
Coord: The matrix that stores all the index of the geometry
this_model_part: The model part of the model (it is the input too)

Reimplemented in Kratos::LocalRefineTriangleMeshConditions.

◆ EraseOldConditionsAndCreateNew()

void Kratos::LocalRefineGeometryMesh::EraseOldConditionsAndCreateNew ( ModelPart this_model_part,
const compressed_matrix< int > &  Coord 
)
virtual

Remove the old conditions and creates new ones

Parameters
CoordThe coordinates of the nodes of the geometry
Returns
this_model_part: The model part of the model (it is the input too)

Reimplemented in Kratos::LocalRefineTriangleMesh, Kratos::LocalRefineTetrahedraMesh, Kratos::LocalRefinePrismMesh, and Kratos::LocalRefineTriangleMeshConditions.

◆ EraseOldElementAndCreateNewElement()

void Kratos::LocalRefineGeometryMesh::EraseOldElementAndCreateNewElement ( ModelPart this_model_part,
const compressed_matrix< int > &  Coord,
PointerVector< Element > &  New_Elements,
bool  interpolate_internal_variables 
)
virtual

It erases the old elements and it creates the new ones

Parameters
CoordThe coordinates of the element
New_ElementsThe new elements created
interpolate_internal_variablesA boolean that defines if it is necessary to interpolate the internal variables
Returns
this_model_part: The model part of the model (it is the input too)

Reimplemented in Kratos::LocalRefineTetrahedraMesh, Kratos::LocalRefineTriangleMesh, Kratos::LocalRefinePrismMesh, and Kratos::LocalRefineTriangleMeshConditions.

◆ InterpolateInteralVariables()

template<typename TGeometricalObjectPointerType >
void Kratos::LocalRefineGeometryMesh::InterpolateInteralVariables ( const int number_elem,
const TGeometricalObjectPointerType  father_elem,
TGeometricalObjectPointerType  child_elem,
const ProcessInfo rCurrentProcessInfo 
)
inline

Interpolates the internal variables

Parameters
number_elemNumber of elements
father_elemFather element (the original one)
child_elemChild element (the new ones created)
rCurrentProcessInfoThe model part process info

◆ LocalRefineMesh()

void Kratos::LocalRefineGeometryMesh::LocalRefineMesh ( bool  refine_on_reference,
bool  interpolate_internal_variables 
)
virtual

Refine the mesh locally, call all the commands necessaries to compute the remeshing

Parameters
refine_on_referenceBoolean that defines if refine or not the mesh according to the reference
interpolate_internal_variablesBoolean that defines if to interpolate or not the internal variables

Reimplemented in Kratos::LocalRefineTetrahedraMeshParallelToBoundaries.

◆ ResetFatherNodes()

void Kratos::LocalRefineGeometryMesh::ResetFatherNodes ( ModelPart rModelPart)
virtual

◆ SearchEdgeToBeRefined()

void Kratos::LocalRefineGeometryMesh::SearchEdgeToBeRefined ( ModelPart this_model_part,
compressed_matrix< int > &  Coord 
)
virtual

This functions looks for potential edges that could be refined

Returns
Coord: The matrix that stores all the index of the geometry
this_model_part: The model part of the model (it is the input too)

Reimplemented in Kratos::LocalRefineTetrahedraMeshParallelToBoundaries, Kratos::LocalRefineTetrahedraMeshOnlyOnBoundaries, and Kratos::LocalRefineTriangleMeshConditions.

◆ SearchEdgeToBeRefinedGeneric()

template<typename TIteratorType >
void Kratos::LocalRefineGeometryMesh::SearchEdgeToBeRefinedGeneric ( TIteratorType  GeometricalObjectsBegin,
TIteratorType  GeometricalObjectsEnd,
compressed_matrix< int > &  rCoord 
)
inlineprotected

◆ UpdateSubModelPartNodes()

void Kratos::LocalRefineGeometryMesh::UpdateSubModelPartNodes ( ModelPart rModelPart)
virtual

Member Data Documentation

◆ mCurrentRefinementLevel

int Kratos::LocalRefineGeometryMesh::mCurrentRefinementLevel
protected

The model part to be refined.

◆ mMapNodeIdToPos

std::unordered_map<std::size_t, unsigned int> Kratos::LocalRefineGeometryMesh::mMapNodeIdToPos
protected

The current refinement level.

◆ mMapPosToNodeId

std::vector<std::size_t> Kratos::LocalRefineGeometryMesh::mMapPosToNodeId
protected

◆ mModelPart

ModelPart& Kratos::LocalRefineGeometryMesh::mModelPart
protected

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