15 #if !defined(KRATOS_PMMG_UTILITIES)
16 #define KRATOS_PMMG_UTILITIES
83 template<PMMGLibrary TPMMGLibrary>
96 template<PMMGLibrary TPMMGLibrary>
140 static constexpr
double ZeroTolerance = std::numeric_limits<double>::epsilon();
245 std::unordered_map<IndexType,Condition::Pointer>& rMapPointersRefCondition,
263 std::unordered_map<IndexType,Element::Pointer>& rMapPointersRefElement,
286 void InitVerbosity()
override;
351 void InputSol(
const std::string& rInputName)
override;
363 void OutputSol(
const std::string& rOutputName)
override;
377 void OutputReferenceEntitities(
378 const std::string& rOutputName,
379 const std::unordered_map<IndexType,Condition::Pointer>& rRefCondition,
380 const std::unordered_map<IndexType,Element::Pointer>& rRefElement
511 void GenerateMeshDataFromModelPart(
513 std::unordered_map<
IndexType,std::vector<std::string>>& rColors,
517 const bool CollapsePrismElements =
false
544 void GenerateReferenceMaps(
548 std::unordered_map<IndexType,Condition::Pointer>& rRefCondition,
549 std::unordered_map<IndexType,Element::Pointer>& rRefElement
556 void GenerateSolDataFromModelPart(
ModelPart& rModelPart)
override;
562 void GenerateDisplacementDataFromModelPart(
ModelPart& rModelPart)
override;
573 void WriteMeshDataToModelPart(
575 const std::unordered_map<
IndexType,std::vector<std::string>>& rColors,
578 std::unordered_map<IndexType,Condition::Pointer>& rMapPointersRefCondition,
579 std::unordered_map<IndexType,Element::Pointer>& rMapPointersRefElement
589 void WriteReferenceEntitities(
591 const std::string& rFilename,
592 std::unordered_map<IndexType,Condition::Pointer>& rRefCondition,
593 std::unordered_map<IndexType,Element::Pointer>& rRefElement
600 void CreateAuxiliarSubModelPartForFlags(
ModelPart& rModelPart)
override;
606 void AssignAndClearAuxiliarSubModelPartForFlags(
ModelPart& rModelPart)
override;
608 std::unordered_map<int, int> GetNodalLocalToGlobalMap();
627 return "ParMmgUtilities";
633 rOStream <<
"ParMmgUtilities";
680 std::unordered_map<int, int> mGlobalToLocalNodePreMap;
681 std::unordered_map<int, int> mGlobalToLocalElemPreMap;
682 std::unordered_map<int, int> mGlobalToLocalCondPreMap;
683 std::unordered_map<int, int> mLocalToGlobalNodePostMap;
727 template<PMMGLibrary TPMMGLibrary>
732 template<PMMGLibrary TPMMGLibrary>
737 rOStream << std::endl;
Serial (do-nothing) version of a wrapper class for MPI communication.
Definition: data_communicator.h:318
Geometry base class.
Definition: geometry.h:71
Provides the Kratos interface to the MMG library API.
Definition: mmg_utilities.h:153
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
std::vector< std::unique_ptr< Dof< double > >> DofsContainerType
The DoF container type definition.
Definition: node.h:92
Provides the Kratos interface to the PMMG library API.
Definition: pmmg_utilities.h:99
void SetMetricScalar(const double Metric, const IndexType NodeId) override
This function is used to set the metric scalar.
void PrintParallelInterfaces(ModelPart &rModelPart)
This method prints the interface data for the parallel communicator.
void PMMGLibCallMetric(Parameters ConfigurationParameters)
This loads the solution.
MmgUtilities< MMGLibrary::MMG3D > BaseType
Definition: pmmg_utilities.h:108
void SetMetricVector(const array_1d< double, Dimension > &rMetric, const IndexType NodeId) override
This function is used to set the metric vector (x, y, z)
void OutputSol(const std::string &rOutputName) override
This sets the output sol.
void BlockNode(const IndexType iNode) override
It blocks certain nodes before remesh the model.
void SetConditions(GeometryType &rGeometry, const IndexType Color, const IndexType Index) override
This sets the conditions of the mesh.
NodeType::Pointer CreateNode(ModelPart &rModelPart, IndexType iNode, int &Ref, int &IsRequired) override
It creates the new node.
void BlockCondition(const IndexType iCondition) override
It blocks certain conditions before remesh the model.
void FreeAll() override
This frees the PMMG structures.
void SetSolSizeVector(const SizeType NumNodes) override
This sets the size of the solution for the vector case.
std::pair< IndexType, IndexType > IndexPairType
Index pair.
Definition: pmmg_utilities.h:134
void InputSol(const std::string &rInputName) override
This sets the output sol.
void SetElements(GeometryType &rGeometry, const IndexType Color, const IndexType Index) override
This sets elements of the mesh.
void SetDisplacementVector(const array_1d< double, 3 > &rDisplacement, const IndexType NodeId) override
This function is used to set the displacement vector (x, y, z)
Geometry< NodeType > GeometryType
Definition: pmmg_utilities.h:113
std::unordered_map< IndexType, IndexType > ColorsMapType
Colors map.
Definition: pmmg_utilities.h:131
std::unordered_map< DoubleVectorType, IndexType, KeyHasherRange< DoubleVectorType >, KeyComparorRange< DoubleVectorType > > DoubleVectorMapType
Double vector map.
Definition: pmmg_utilities.h:125
void PMMGLibCallIsoSurface(Parameters ConfigurationParameters)
This loads the solution.
void InitAPIModeParameter(const IndexType VerbosityPMMG)
Here the API mode is set using the API.
void InitNodeGloNumParameter(const IndexType nodeGloNum)
Ask for output node global numbering.
void BlockElement(const IndexType iElement) override
It blocks certain elements before remesh the model.
std::string Info() const
Turn back information as a string.
Definition: pmmg_utilities.h:625
void GenerateParallelInterfaces(ModelPart &rModelPart)
This method generates the interface data for the parallel communicator.
KRATOS_CLASS_POINTER_DEFINITION(ParMmgUtilities)
Pointer definition of ParMmgUtilities.
std::vector< double > DoubleVectorType
Double vector.
Definition: pmmg_utilities.h:122
void SetDispSizeVector(const SizeType NumNodes) override
This sets the size of the displacement for lagrangian movement.
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: pmmg_utilities.h:637
Element::Pointer CreateFirstTypeElement(ModelPart &rModelPart, std::unordered_map< IndexType, Element::Pointer > &rMapPointersRefElement, const IndexType ElemId, int &Ref, int &IsRequired, bool SkipCreation) override
It creates the new element (first type, depends if the library work in 2D/3D/Surfaces)
std::unordered_map< IndexVectorType, IndexType, KeyHasherRange< IndexVectorType >, KeyComparorRange< IndexVectorType > > IndexVectorMapType
Index vector map.
Definition: pmmg_utilities.h:128
IndexVectorType CheckFirstTypeElements() override
Returns a vector of ids of repeated elements.
Condition::Pointer CreateFirstTypeCondition(ModelPart &rModelPart, std::unordered_map< IndexType, Condition::Pointer > &rMapPointersRefCondition, const IndexType CondId, int &Ref, int &IsRequired, bool SkipCreation) override
It creates the new condition (first type, depends if the library work in 2D/3D/Surfaces)
void GetMetricScalar(double &rMetric) override
This function is used to retrieve the metric scalar.
std::conditional< Dimension==2, array_1d< double, 3 >, array_1d< double, 6 > >::type TensorArrayType
The type of array considered for the tensor.
Definition: pmmg_utilities.h:119
void OutputMesh(const std::string &rOutputName) override
This sets the output mesh.
void SetMetricTensor(const TensorArrayType &rMetric, const IndexType NodeId) override
This function is used to set the Hessian metric tensor, note that when using the Hessian,...
void InputMesh(const std::string &rInputName) override
This sets the output mesh.
std::pair< IndexType, std::vector< std::string > > IndexStringVectorPairType
Index and string vector pair.
Definition: pmmg_utilities.h:137
void SetMeshSize(PMMGMeshInfo< TPMMGLibrary > &rPMMGMeshInfo)
This sets the size of the mesh.
void GetMetricVector(array_1d< double, Dimension > &rMetric) override
This function is used to retrieve the metric vector (x, y, z)
void SetSolSizeTensor(const SizeType NumNodes) override
This sets the size of the solution for the tensor case.
void GetMetricTensor(TensorArrayType &rMetric) override
This function is used to retrieve the Hessian metric tensor, note that when using the Hessian,...
void OutputDisplacement(const std::string &rOutputName) override
This sets the output displacement.
IndexVectorType CheckFirstTypeConditions() override
Returns a vector of ids of repeated conditions.
void CheckMeshData() override
This checks the mesh data and prints if it is OK.
void SetNodes(const double X, const double Y, const double Z, const IndexType Color, const IndexType Index) override
This sets the nodes of the mesh.
Node NodeType
Node definition.
Definition: pmmg_utilities.h:111
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: pmmg_utilities.h:631
void InitVerbosityParameter(const IndexType VerbosityPMMG) override
Here the verbosity is set using the API.
void SetSolSizeScalar(const SizeType NumNodes) override
This sets the size of the solution for the scalar case.
void GetDisplacementVector(array_1d< double, 3 > &rDisplacement) override
This function is used to retrieve the displacement vector (x, y, z)
void InitMesh(const DataCommunicator &rDataCommunicator)
Initialisation of mesh and sol structures.
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
FrameworkEulerLagrange
This enums allows to differentiate the working framework.
Definition: meshing_application.h:66
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::vector< IndexType > IndexVectorType
Index vector.
Definition: mmg_io.h:63
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
type
Definition: generate_gid_list_file.py:35
tuple const
Definition: ode_solve.py:403
This is a key comparer of general pourpose between two classes.
Definition: key_hash.h:100
Stores the Mmg mesh information.
Definition: mmg_utilities.h:115
Stores the ParMmg mesh information.
Definition: pmmg_utilities.h:85