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

Collection of utilities to compute statistic of particles. More...

#include <particles_utilities.h>

Collaboration diagram for Kratos::ParticlesUtilities:

Public Member Functions

Type Definitions
 KRATOS_CLASS_POINTER_DEFINITION (ParticlesUtilities)
 Pointer definition of ParticlesUtilities. More...
 
Input and output
std::string Info () const
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Life Cycle

 ParticlesUtilities ()=delete
 Default constructor. More...
 
template<unsigned int TDim, bool CounterHasHistory = false>
static void CountParticlesInNodes (BinBasedFastPointLocator< TDim > &rLocator, ModelPart &rVolumeModelPart, const ModelPart &rParticlesModelPart, const Variable< double > &rCounterVariable, const double SearchTolerance=1e-5)
 : this function takes all the nodes in rParticlesModelPart and finds in which element they fall within the volume identified in rVolumeModelPart. Then they add one to all the nodes of the element in which the particle is inside More...
 
template<unsigned int TDim, class TScalarType , bool ParticleTypeVariableHasHistory = false>
static void ClassifyParticlesInElements (BinBasedFastPointLocator< TDim > &rLocator, ModelPart &rVolumeModelPart, const ModelPart &rParticlesModelPart, const int NumberOfTypes, const Variable< TScalarType > &rParticleTypeVariable=AUX_INDEX, const Variable< Vector > &rClassificationVectorVariable=MARKER_LABELS, const double SearchTolerance=1e-5)
 : this function takes all the nodes in rParticlesModelPart and finds in which element they fall within the volume identified in rVolumeModelPart. Particles are then classified in the "ClassificationVariable" of type vector, adding 1.0 to the entry which corresponds to the "type" of particle, intended as an integer between 0 and NumberOfTypes identifying the particle More...
 
template<unsigned int TDim, class TDataType , bool VariableHasHistory>
static void MarkOutsiderParticles (BinBasedFastPointLocator< TDim > &rLocator, ModelPart &rParticlesModelPart, const Variable< TDataType > &rVariable, const TDataType &OutsiderValue, const double SearchTolerance=1e-5)
 : this function looks if particle is found in the locator. If it is not, "rVariable" is marked with the value "OutsiderValue" More...
 
template<unsigned int TDim, class TDataType , bool InterpolationVariableHasHistory>
static std::pair< DenseVector< bool >, std::vector< TDataType > > InterpolateValuesAtCoordinates (BinBasedFastPointLocator< TDim > &rLocator, const Matrix &rCoordinates, const Variable< TDataType > &rInterpolationVariable, const double SearchTolerance)
 This function takes a matrix of coordinates and gives the intrpolated value of the variable rInterpolationVariable at those positions. Note that the value is only initialized if the particle is found. More...
 

Detailed Description

Collection of utilities to compute statistic of particles.

Author
Riccardo Rossi

Constructor & Destructor Documentation

◆ ParticlesUtilities()

Kratos::ParticlesUtilities::ParticlesUtilities ( )
delete

Default constructor.

Member Function Documentation

◆ ClassifyParticlesInElements()

template<unsigned int TDim, class TScalarType , bool ParticleTypeVariableHasHistory = false>
static void Kratos::ParticlesUtilities::ClassifyParticlesInElements ( BinBasedFastPointLocator< TDim > &  rLocator,
ModelPart rVolumeModelPart,
const ModelPart rParticlesModelPart,
const int  NumberOfTypes,
const Variable< TScalarType > &  rParticleTypeVariable = AUX_INDEX,
const Variable< Vector > &  rClassificationVectorVariable = MARKER_LABELS,
const double  SearchTolerance = 1e-5 
)
inlinestatic

: this function takes all the nodes in rParticlesModelPart and finds in which element they fall within the volume identified in rVolumeModelPart. Particles are then classified in the "ClassificationVariable" of type vector, adding 1.0 to the entry which corresponds to the "type" of particle, intended as an integer between 0 and NumberOfTypes identifying the particle

Parameters
rLocatorthis is a search structure for rVolumeModelPart
rVolumeModelPartmodel part on the top of which we will find the particles
rParticlesModelPartmodel part in which the "particles" are contained (as Nodes)
NumberOfTypesnumber of admissible types of particles (note that the particle type will be interpreted as integer)
rParticleTypeVariablethis is an integer identifying the "type" of particle. Numbers lesser than 0 or higher than NumberofTypes will be silently ignored
SearchTolerancesearch tolerance used in the spatial search

◆ CountParticlesInNodes()

template<unsigned int TDim, bool CounterHasHistory = false>
static void Kratos::ParticlesUtilities::CountParticlesInNodes ( BinBasedFastPointLocator< TDim > &  rLocator,
ModelPart rVolumeModelPart,
const ModelPart rParticlesModelPart,
const Variable< double > &  rCounterVariable,
const double  SearchTolerance = 1e-5 
)
inlinestatic

: this function takes all the nodes in rParticlesModelPart and finds in which element they fall within the volume identified in rVolumeModelPart. Then they add one to all the nodes of the element in which the particle is inside

Parameters
rLocatorthis is a search structure for rVolumeModelPart
rVolumeModelPartmodel part on the top of which we will find the particles
rParticlesModelPartmodel part in which the "particles" are contained (as Nodes)
rCounterVariablethis is the variable which will be used to store the count (has to be present in the nodes of rVolumeModelPart)
SearchTolerancesearch tolerance used in the spatial search

◆ Info()

std::string Kratos::ParticlesUtilities::Info ( ) const
inline

Turn back information as a string.

◆ InterpolateValuesAtCoordinates()

template<unsigned int TDim, class TDataType , bool InterpolationVariableHasHistory>
static std::pair< DenseVector<bool>, std::vector<TDataType> > Kratos::ParticlesUtilities::InterpolateValuesAtCoordinates ( BinBasedFastPointLocator< TDim > &  rLocator,
const Matrix rCoordinates,
const Variable< TDataType > &  rInterpolationVariable,
const double  SearchTolerance 
)
inlinestatic

This function takes a matrix of coordinates and gives the intrpolated value of the variable rInterpolationVariable at those positions. Note that the value is only initialized if the particle is found.

Parameters
rLocatorthis is a search structure for the volume
rCoordinatespositions at which we want to retrieve the interpolation values
rInterpolationVariablevariable whose value that will be interpolated
SearchTolerancesearch tolerance used in the spatial search
Returns
the function returns:
  • is_inside a vector of bools telling if the given coordinate falls within the volume
  • values the interpolated values (only valid if the corresponding value of is_inside is true)

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::ParticlesUtilities::KRATOS_CLASS_POINTER_DEFINITION ( ParticlesUtilities  )

Pointer definition of ParticlesUtilities.

◆ MarkOutsiderParticles()

template<unsigned int TDim, class TDataType , bool VariableHasHistory>
static void Kratos::ParticlesUtilities::MarkOutsiderParticles ( BinBasedFastPointLocator< TDim > &  rLocator,
ModelPart rParticlesModelPart,
const Variable< TDataType > &  rVariable,
const TDataType &  OutsiderValue,
const double  SearchTolerance = 1e-5 
)
inlinestatic

: this function looks if particle is found in the locator. If it is not, "rVariable" is marked with the value "OutsiderValue"

Parameters
rLocatorthis is a search structure for the volume
rParticlesModelPartmodel part in which the "particles" are contained (as Nodes)
rVariablevariable whose value will be modified on the nodes in rParticlesModelPart
SearchTolerancesearch tolerance used in the spatial search

◆ PrintData()

void Kratos::ParticlesUtilities::PrintData ( std::ostream &  rOStream) const
inline

Print object's data.

◆ PrintInfo()

void Kratos::ParticlesUtilities::PrintInfo ( std::ostream &  rOStream) const
inline

Print information about this object.


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