Collection of utilities to compute statistic of particles.
More...
#include <particles_utilities.h>
|
| 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...
|
|
Collection of utilities to compute statistic of particles.
- Author
- Riccardo Rossi
◆ ParticlesUtilities()
Kratos::ParticlesUtilities::ParticlesUtilities |
( |
| ) |
|
|
delete |
◆ 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
-
rLocator | this is a search structure for rVolumeModelPart |
rVolumeModelPart | model part on the top of which we will find the particles |
rParticlesModelPart | model part in which the "particles" are contained (as Nodes) |
NumberOfTypes | number of admissible types of particles (note that the particle type will be interpreted as integer) |
rParticleTypeVariable | this is an integer identifying the "type" of particle. Numbers lesser than 0 or higher than NumberofTypes will be silently ignored |
SearchTolerance | search tolerance used in the spatial search |
◆ CountParticlesInNodes()
template<unsigned int TDim, bool CounterHasHistory = false>
: 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
-
rLocator | this is a search structure for rVolumeModelPart |
rVolumeModelPart | model part on the top of which we will find the particles |
rParticlesModelPart | model part in which the "particles" are contained (as Nodes) |
rCounterVariable | this is the variable which will be used to store the count (has to be present in the nodes of rVolumeModelPart) |
SearchTolerance | search 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>
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
-
rLocator | this is a search structure for the volume |
rCoordinates | positions at which we want to retrieve the interpolation values |
rInterpolationVariable | variable whose value that will be interpolated |
SearchTolerance | search 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()
◆ 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
-
rLocator | this is a search structure for the volume |
rParticlesModelPart | model part in which the "particles" are contained (as Nodes) |
rVariable | variable whose value will be modified on the nodes in rParticlesModelPart |
SearchTolerance | search tolerance used in the spatial search |
◆ PrintData()
void Kratos::ParticlesUtilities::PrintData |
( |
std::ostream & |
rOStream | ) |
const |
|
inline |
◆ 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: