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::MmgIO< TMMGLibrary > Class Template Reference

This class is a IO which uses the MMG library. More...

#include <mmg_io.h>

Inheritance diagram for Kratos::MmgIO< TMMGLibrary >:
Collaboration diagram for Kratos::MmgIO< TMMGLibrary >:

Public Member Functions

Life Cycle
 MmgIO (std::string const &rFilename, Parameters ThisParameters=Parameters(R"({})"), const Flags Options=IO::READ|IO::IGNORE_VARIABLES_ERROR.AsFalse()|IO::SKIP_TIMER)
 Constructor with filenames. More...
 
 ~MmgIO () override=default
 Destructor. More...
 
Operations
void ReadModelPart (ModelPart &rModelPart) override
 This read the current stream file in order to write a model part. More...
 
void WriteModelPart (ModelPart &rModelPart) override
 This writes the current model part info a file. More...
 
std::string GetMmgVersion ()
 This method retrieves the current Mmg version. More...
 
Input and output
std::string Info () const override
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const override
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const override
 Print object's data. More...
 
- Public Member Functions inherited from Kratos::IO
 IO ()=default
 Default constructor. More...
 
virtual ~IO ()=default
 Destructor. More...
 
 IO (IO const &rOther)=delete
 Copy constructor. More...
 
IOoperator= (IO const &rOther)=delete
 Assignment operator. More...
 
virtual bool ReadNode (NodeType &rThisNode)
 This method reads one node. More...
 
virtual bool ReadNodes (NodesContainerType &rThisNodes)
 This method reads the nodes from an array of nodes. More...
 
virtual std::size_t ReadNodesNumber ()
 This method reads the number of nodes. More...
 
virtual void WriteNodes (NodesContainerType const &rThisNodes)
 This method writes the nodes from an array of nodes. More...
 
virtual void ReadProperties (Properties &rThisProperties)
 This method reads one Properties. More...
 
virtual void ReadProperties (PropertiesContainerType &rThisProperties)
 This method reads the Properties from an array of Properties. More...
 
virtual void WriteProperties (Properties const &rThisProperties)
 This method writes one Properties. More...
 
virtual void WriteProperties (PropertiesContainerType const &rThisProperties)
 This method writes the Properties from an array of Properties. More...
 
virtual void ReadGeometry (NodesContainerType &rThisNodes, GeometryType::Pointer &pThisGeometry)
 This method reads one geometry. More...
 
virtual void ReadGeometries (NodesContainerType &rThisNodes, GeometryContainerType &rThisGeometries)
 This method reads an array of geometries. More...
 
virtual std::size_t ReadGeometriesConnectivities (ConnectivitiesContainerType &rGeometriesConnectivities)
 This method reads the geometries connectivities. More...
 
virtual void WriteGeometries (GeometryContainerType const &rThisGeometries)
 This method writes an array of geometries. More...
 
virtual void ReadElement (NodesContainerType &rThisNodes, PropertiesContainerType &rThisProperties, Element::Pointer &pThisElement)
 This method reads one element. More...
 
virtual void ReadElements (NodesContainerType &rThisNodes, PropertiesContainerType &rThisProperties, ElementsContainerType &rThisElements)
 This method reads an array of elements. More...
 
virtual std::size_t ReadElementsConnectivities (ConnectivitiesContainerType &rElementsConnectivities)
 This method reads the elements connectivities. More...
 
virtual void WriteElements (ElementsContainerType const &rThisElements)
 This method writes an array of elements. More...
 
virtual void ReadCondition (NodesContainerType &rThisNodes, PropertiesContainerType &rThisProperties, Condition::Pointer &pThisCondition)
 This method reads one condition. More...
 
virtual void ReadConditions (NodesContainerType &rThisNodes, PropertiesContainerType &rThisProperties, ConditionsContainerType &rThisConditions)
 This method reads an array of conditions. More...
 
virtual std::size_t ReadConditionsConnectivities (ConnectivitiesContainerType &rConditionsConnectivities)
 This method reads the conditions connectivities. More...
 
virtual void WriteConditions (ConditionsContainerType const &rThisConditions)
 This method writes an array of conditions. More...
 
virtual void ReadInitialValues (ModelPart &rThisModelPart)
 This method reads the initial values of the model part. More...
 
virtual void ReadInitialValues (NodesContainerType &rThisNodes, ElementsContainerType &rThisElements, ConditionsContainerType &rThisConditions)
 This method reads the initial values of the nodes, elements and conditios. More...
 
virtual void ReadMesh (MeshType &rThisMesh)
 This method reads the mesh. More...
 
virtual void WriteMesh (MeshType &rThisMesh)
 This method writes the mesh. More...
 
virtual void WriteMesh (const MeshType &rThisMesh)
 This method writes the mesh. More...
 
virtual void WriteModelPart (const ModelPart &rThisModelPart)
 This method writes the model part. More...
 
virtual void WriteNodeMesh (MeshType &rThisMesh)
 This method writes the node mesh. More...
 
virtual void WriteNodeMesh (const MeshType &rThisMesh)
 This method writes the node mesh. More...
 
virtual std::size_t ReadNodalGraph (ConnectivitiesContainerType &rAuxConnectivities)
 Read the input file and create the nodal connectivities graph, stored in CSR format. More...
 
virtual void DivideInputToPartitions (SizeType NumberOfPartitions, const PartitioningInfo &rPartitioningInfo)
 This method divides a model part into partitions. More...
 
virtual void DivideInputToPartitions (SizeType NumberOfPartitions, GraphType const &rDomainsColoredGraph, PartitionIndicesType const &rNodesPartitions, PartitionIndicesType const &rElementsPartitions, PartitionIndicesType const &rConditionsPartitions, PartitionIndicesContainerType const &rNodesAllPartitions, PartitionIndicesContainerType const &rElementsAllPartitions, PartitionIndicesContainerType const &rConditionsAllPartitions)
 This method divides a model part into partitions. More...
 
virtual void DivideInputToPartitions (Kratos::shared_ptr< std::iostream > *pStreams, SizeType NumberOfPartitions, const PartitioningInfo &rPartitioningInfo)
 This method divides a model part into partitions. More...
 
virtual void DivideInputToPartitions (Kratos::shared_ptr< std::iostream > *pStreams, SizeType NumberOfPartitions, GraphType const &rDomainsColoredGraph, PartitionIndicesType const &rNodesPartitions, PartitionIndicesType const &rElementsPartitions, PartitionIndicesType const &rConditionsPartitions, PartitionIndicesContainerType const &rNodesAllPartitions, PartitionIndicesContainerType const &rElementsAllPartitions, PartitionIndicesContainerType const &rConditionsAllPartitions)
 This method divides a model part into partitions. More...
 
virtual void ReadSubModelPartElementsAndConditionsIds (std::string const &rModelPartName, std::unordered_set< SizeType > &rElementsIds, std::unordered_set< SizeType > &rConditionsIds)
 
virtual std::size_t ReadNodalGraphFromEntitiesList (ConnectivitiesContainerType &rAuxConnectivities, std::unordered_set< SizeType > &rElementsIds, std::unordered_set< SizeType > &rConditionsIds)
 
 KRATOS_CLASS_POINTER_DEFINITION (IO)
 Pointer definition of IO. More...
 
 KRATOS_DEFINE_LOCAL_FLAG (READ)
 Local Flags. More...
 
 KRATOS_DEFINE_LOCAL_FLAG (WRITE)
 
 KRATOS_DEFINE_LOCAL_FLAG (APPEND)
 
 KRATOS_DEFINE_LOCAL_FLAG (IGNORE_VARIABLES_ERROR)
 
 KRATOS_DEFINE_LOCAL_FLAG (SKIP_TIMER)
 
 KRATOS_DEFINE_LOCAL_FLAG (MESH_ONLY)
 
 KRATOS_DEFINE_LOCAL_FLAG (SCIENTIFIC_PRECISION)
 

Type Definitions

typedef ModelPart::NodesContainerType NodesArrayType
 Node containers definition. More...
 
typedef ModelPart::ElementsContainerType ElementsArrayType
 Elements containers definition. More...
 
typedef ModelPart::ConditionsContainerType ConditionsArrayType
 Conditions containers definition. More...
 
typedef Node NodeType
 Node definition. More...
 
typedef Geometry< NodeTypeGeometryType
 
typedef Mesh< NodeType, Properties, Element, ConditionMeshType
 Mesh definition. More...
 
typedef MeshType::PropertiesContainerType PropertiesContainerType
 Properties container definition. More...
 
typedef MeshType::NodeConstantIterator NodeConstantIterator
 Nodes container definition. More...
 
typedef MeshType::ConditionConstantIterator ConditionConstantIterator
 Conditions container definition. More...
 
typedef MeshType::ElementConstantIterator ElementConstantIterator
 Elements container definition. More...
 
typedef std::conditional< Dimension==2, array_1d< double, 3 >, array_1d< double, 6 > >::type TensorArrayType
 The type of array considered for the tensor. More...
 
typedef std::vector< doubleDoubleVectorType
 Double vector. More...
 
typedef std::unordered_map< DoubleVectorType, IndexType, KeyHasherRange< DoubleVectorType >, KeyComparorRange< DoubleVectorType > > DoubleVectorMapType
 Double vector map. More...
 
typedef std::unordered_map< IndexVectorType, IndexType, KeyHasherRange< IndexVectorType >, KeyComparorRange< IndexVectorType > > IndexVectorMapType
 Index vector map. More...
 
typedef std::unordered_map< IndexType, IndexTypeColorsMapType
 Colors map. More...
 
typedef std::pair< IndexType, IndexTypeIndexPairType
 Index pair. More...
 
static constexpr SizeType Dimension = (TMMGLibrary == MMGLibrary::MMG2D) ? 2 : 3
 Conditions array size. More...
 
static constexpr SizeType ConditionsArraySize = (Dimension == 2) ? 1 : 2
 Conditions array size. More...
 
static constexpr SizeType ElementsArraySize = (Dimension == 2) ? 1 : 2
 Elements array size. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (MmgIO)
 Pointer definition of MmgIO. More...
 

Additional Inherited Members

- Public Types inherited from Kratos::IO
typedef Node NodeType
 
typedef Geometry< NodeTypeGeometryType
 
typedef Mesh< NodeType, Properties, Element, ConditionMeshType
 
typedef MeshType::NodesContainerType NodesContainerType
 
typedef MeshType::PropertiesContainerType PropertiesContainerType
 
typedef ModelPart::GeometryContainerType GeometryContainerType
 
typedef MeshType::ElementsContainerType ElementsContainerType
 
typedef MeshType::ConditionsContainerType ConditionsContainerType
 
typedef std::vector< std::vector< std::size_t > > ConnectivitiesContainerType
 
typedef std::vector< std::vector< std::size_t > > PartitionIndicesContainerType
 
typedef std::vector< std::size_t > PartitionIndicesType
 
typedef std::size_t SizeType
 
typedef DenseMatrix< intGraphType
 

Detailed Description

template<MMGLibrary TMMGLibrary>
class Kratos::MmgIO< TMMGLibrary >

This class is a IO which uses the MMG library.

This class is an IO tool for MMG .mesh files

Author
Vicente Mataix Ferrandiz

Member Typedef Documentation

◆ ColorsMapType

template<MMGLibrary TMMGLibrary>
typedef std::unordered_map<IndexType,IndexType> Kratos::MmgIO< TMMGLibrary >::ColorsMapType

Colors map.

◆ ConditionConstantIterator

template<MMGLibrary TMMGLibrary>
typedef MeshType::ConditionConstantIterator Kratos::MmgIO< TMMGLibrary >::ConditionConstantIterator

Conditions container definition.

◆ ConditionsArrayType

template<MMGLibrary TMMGLibrary>
typedef ModelPart::ConditionsContainerType Kratos::MmgIO< TMMGLibrary >::ConditionsArrayType

Conditions containers definition.

◆ DoubleVectorMapType

template<MMGLibrary TMMGLibrary>
typedef std::unordered_map<DoubleVectorType, IndexType, KeyHasherRange<DoubleVectorType>, KeyComparorRange<DoubleVectorType> > Kratos::MmgIO< TMMGLibrary >::DoubleVectorMapType

Double vector map.

◆ DoubleVectorType

template<MMGLibrary TMMGLibrary>
typedef std::vector<double> Kratos::MmgIO< TMMGLibrary >::DoubleVectorType

Double vector.

◆ ElementConstantIterator

template<MMGLibrary TMMGLibrary>
typedef MeshType::ElementConstantIterator Kratos::MmgIO< TMMGLibrary >::ElementConstantIterator

Elements container definition.

◆ ElementsArrayType

template<MMGLibrary TMMGLibrary>
typedef ModelPart::ElementsContainerType Kratos::MmgIO< TMMGLibrary >::ElementsArrayType

Elements containers definition.

◆ GeometryType

template<MMGLibrary TMMGLibrary>
typedef Geometry<NodeType> Kratos::MmgIO< TMMGLibrary >::GeometryType

◆ IndexPairType

template<MMGLibrary TMMGLibrary>
typedef std::pair<IndexType,IndexType> Kratos::MmgIO< TMMGLibrary >::IndexPairType

Index pair.

◆ IndexVectorMapType

template<MMGLibrary TMMGLibrary>
typedef std::unordered_map<IndexVectorType, IndexType, KeyHasherRange<IndexVectorType>, KeyComparorRange<IndexVectorType> > Kratos::MmgIO< TMMGLibrary >::IndexVectorMapType

Index vector map.

◆ MeshType

template<MMGLibrary TMMGLibrary>
typedef Mesh<NodeType, Properties, Element, Condition> Kratos::MmgIO< TMMGLibrary >::MeshType

Mesh definition.

◆ NodeConstantIterator

template<MMGLibrary TMMGLibrary>
typedef MeshType::NodeConstantIterator Kratos::MmgIO< TMMGLibrary >::NodeConstantIterator

Nodes container definition.

◆ NodesArrayType

template<MMGLibrary TMMGLibrary>
typedef ModelPart::NodesContainerType Kratos::MmgIO< TMMGLibrary >::NodesArrayType

Node containers definition.

◆ NodeType

template<MMGLibrary TMMGLibrary>
typedef Node Kratos::MmgIO< TMMGLibrary >::NodeType

Node definition.

◆ PropertiesContainerType

template<MMGLibrary TMMGLibrary>
typedef MeshType::PropertiesContainerType Kratos::MmgIO< TMMGLibrary >::PropertiesContainerType

Properties container definition.

◆ TensorArrayType

template<MMGLibrary TMMGLibrary>
typedef std::conditional<Dimension == 2, array_1d<double, 3>, array_1d<double, 6> >::type Kratos::MmgIO< TMMGLibrary >::TensorArrayType

The type of array considered for the tensor.

Constructor & Destructor Documentation

◆ MmgIO()

template<MMGLibrary TMMGLibrary>
Kratos::MmgIO< TMMGLibrary >::MmgIO ( std::string const &  rFilename,
Parameters  ThisParameters = Parameters(R"({})"),
const Flags  Options = IO::READ | IO::IGNORE_VARIABLES_ERROR.AsFalse() | IO::SKIP_TIMER 
)

Constructor with filenames.

◆ ~MmgIO()

template<MMGLibrary TMMGLibrary>
Kratos::MmgIO< TMMGLibrary >::~MmgIO ( )
overridedefault

Destructor.

Member Function Documentation

◆ GetMmgVersion()

template<MMGLibrary TMMGLibrary>
std::string Kratos::MmgIO< TMMGLibrary >::GetMmgVersion

This method retrieves the current Mmg version.

Returns
The current version of Mmg (as a string)

◆ Info()

template<MMGLibrary TMMGLibrary>
std::string Kratos::MmgIO< TMMGLibrary >::Info ( ) const
inlineoverridevirtual

Turn back information as a string.

Reimplemented from Kratos::IO.

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<MMGLibrary TMMGLibrary>
Kratos::MmgIO< TMMGLibrary >::KRATOS_CLASS_POINTER_DEFINITION ( MmgIO< TMMGLibrary >  )

Pointer definition of MmgIO.

◆ PrintData()

template<MMGLibrary TMMGLibrary>
void Kratos::MmgIO< TMMGLibrary >::PrintData ( std::ostream &  rOStream) const
inlineoverridevirtual

Print object's data.

Reimplemented from Kratos::IO.

◆ PrintInfo()

template<MMGLibrary TMMGLibrary>
void Kratos::MmgIO< TMMGLibrary >::PrintInfo ( std::ostream &  rOStream) const
inlineoverridevirtual

Print information about this object.

Reimplemented from Kratos::IO.

◆ ReadModelPart()

template<MMGLibrary TMMGLibrary>
void Kratos::MmgIO< TMMGLibrary >::ReadModelPart ( ModelPart rModelPart)
overridevirtual

This read the current stream file in order to write a model part.

Where the sub model parts IDs are stored

Reference condition

Reference element

Reimplemented from Kratos::IO.

◆ WriteModelPart()

template<MMGLibrary TMMGLibrary>
void Kratos::MmgIO< TMMGLibrary >::WriteModelPart ( ModelPart rModelPart)
overridevirtual

This writes the current model part info a file.

Where the sub model parts IDs are stored

Reference element

Reference condition

Reimplemented from Kratos::IO.

Member Data Documentation

◆ ConditionsArraySize

template<MMGLibrary TMMGLibrary>
constexpr SizeType Kratos::MmgIO< TMMGLibrary >::ConditionsArraySize = (Dimension == 2) ? 1 : 2
staticconstexpr

Conditions array size.

◆ Dimension

template<MMGLibrary TMMGLibrary>
constexpr SizeType Kratos::MmgIO< TMMGLibrary >::Dimension = (TMMGLibrary == MMGLibrary::MMG2D) ? 2 : 3
staticconstexpr

Conditions array size.

◆ ElementsArraySize

template<MMGLibrary TMMGLibrary>
constexpr SizeType Kratos::MmgIO< TMMGLibrary >::ElementsArraySize = (Dimension == 2) ? 1 : 2
staticconstexpr

Elements array size.


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