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::ModelPartOperationUtilities Class Reference

#include <model_part_operation_utilities.h>

Collaboration diagram for Kratos::ModelPartOperationUtilities:

Public Types

Type definitions
using IndexType = std::size_t
 
using CNodePointersType = std::vector< ModelPart::NodeType const * >
 
template<class KeyType , class ValueType >
using RangedKeyMapType = std::unordered_map< KeyType, ValueType, KeyHasherRange< KeyType >, KeyComparorRange< KeyType > >
 

Static Public Member Functions

Static operations
static bool CheckValidityOfModelPartsForOperations (const ModelPart &rMainModelPart, const std::vector< ModelPart const * > &rCheckModelParts, const bool ThrowError=false)
 Checks the validity of main model part and check model parts to be used within operation utilities. More...
 
template<class TModelPartOperation >
static void FillSubModelPart (ModelPart &rOutputSubModelPart, const ModelPart &rMainModelPart, const std::vector< ModelPart const * > &rOperands, const bool AddNeighbourEntities)
 Fill a sub model part with the specified operation. More...
 
static bool HasIntersection (const std::vector< ModelPart * > &rIntersectionModelParts)
 Checks whether given model parts list has an intersection. More...
 

Member Typedef Documentation

◆ CNodePointersType

◆ IndexType

◆ RangedKeyMapType

template<class KeyType , class ValueType >
using Kratos::ModelPartOperationUtilities::RangedKeyMapType = std::unordered_map<KeyType, ValueType, KeyHasherRange<KeyType>, KeyComparorRange<KeyType> >

Member Function Documentation

◆ CheckValidityOfModelPartsForOperations()

bool Kratos::ModelPartOperationUtilities::CheckValidityOfModelPartsForOperations ( const ModelPart rMainModelPart,
const std::vector< ModelPart const * > &  rCheckModelParts,
const bool  ThrowError = false 
)
static

Checks the validity of main model part and check model parts to be used within operation utilities.

This method checks whether all the nodes, and geometries in rCheckModelParts are present in the rMainModelPart.

If ThrowError is shown, a meaning full error is shown.

Parameters
rMainModelPartMain model part.
rCheckModelPartsList of check model parts.
ThrowErrorTo throw an error or not.
Returns
true If the given model parts are valid.
false If the given model parts are invalid.

◆ FillSubModelPart()

template<class TModelPartOperation >
static void Kratos::ModelPartOperationUtilities::FillSubModelPart ( ModelPart rOutputSubModelPart,
const ModelPart rMainModelPart,
const std::vector< ModelPart const * > &  rOperands,
const bool  AddNeighbourEntities 
)
inlinestatic

Fill a sub model part with the specified operation.

This method finds all the nodes, geometries in rOperands in the rMainModelPart which satisfies the specified TModelPartOperation and adds them to a given rOutputSubModelPart. The TModelPartOperation check is done based on the memory locations of the entities. The corresponding entities from rMainModelPart are used to populate the sub model part. rOutputSubModelPart must be a sub model part of rMainModelPart, but does not necessarily have to be an immediate sub model part.

If AddNeighbourEntities is true, then all the neighbours of the newly created model part is found from rMainModelPart and added as well.

Please make sure to check validity of model parts using

See also
CheckValidityOfModelPartsForOperations.
Exceptions
IfrOutputSubModelPart is not a sub model part of rMainModelPart.
IfrOutputSubModelPart is not empty.
Template Parameters
TModelPartOperationType of the operation.
Parameters
rOutputSubModelPartOutput sub model part.
rMainModelPartMain Model part.
rOperandsModel parts to to find satisfying entities w.r.t. TModelPartOperation.
AddNeighbourEntitiesTo add or not the neighbours.
Returns
ModelPart& Output sub model part.

◆ HasIntersection()

bool Kratos::ModelPartOperationUtilities::HasIntersection ( const std::vector< ModelPart * > &  rIntersectionModelParts)
static

Checks whether given model parts list has an intersection.

This method checks whether rIntersectionModelParts has intersections.

The intersection is carried out by finding all the nodes, geometries in rIntersectionModelParts.

Parameters
rIntersectionModelPartsModel parts to find intersection.
Returns
true If there are entities intersecting.
false If there aren't any entities intersecting.

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