10 #if !defined(KRATOS_MESH_DATA_TRANSFER_UTILITIES_H_INCLUDED)
11 #define KRATOS_MESH_DATA_TRANSFER_UTILITIES_H_INCLUDED
96 Options.
Set(ThisFlag);
101 Options.
Reset(ThisFlag);
112 VariablesSetFlag =
true;
113 DoubleVariables.push_back(&pVariable);
118 VariablesSetFlag =
true;
119 Array1DVariables.push_back(&pVariable);
125 VariablesSetFlag =
true;
126 VectorVariables.push_back(&pVariable);
132 VariablesSetFlag =
true;
133 MatrixVariables.push_back(&pVariable);
143 VariablesSetFlag =
false;
160 Array1DVariable.
clear();
161 VectorVariable.
resize(voigt_size);
181 DoubleVariableArray.resize(size);
182 Array1DVariableArray.resize(size);
183 VectorVariableArray.resize(size);
184 MatrixVariableArray.resize(size);
222 const Element & rReferenceElement,
223 PointPointerVector &list_of_new_centers,
231 void InitializeBoundaryData(
Condition* rCurrentCondition,
232 const TransferParameters& rTransferVariables,
240 void TransferInitialBoundaryData(
Condition* rCurrentCondition,
241 const TransferParameters& rTransferVariables,
242 BoundaryVariables& rVariables);
247 void TransferCurrentBoundaryData(
Element* rCurrentElement,
249 const TransferParameters& rTransferVariables,
250 BoundaryVariables& rVariables,
251 BoundaryVariableArrays& rVariableArrays,
258 void TransferBoundaryData(Condition::Pointer rCurrentCondition,
259 Condition::Pointer rReferenceCondition,
260 const TransferParameters& rTransferVariables);
266 void TransferBoundaryData(
Element* rCurrentElement,
268 const TransferParameters& rTransferVariables,
275 void TransferBoundaryData(
const TransferParameters& rTransferVariables,
282 void TransferNodalValuesToElements(
const TransferParameters& rTransferVariables,
291 void TransferNodalValuesToElements(
const TransferParameters& rTransferVariables,
293 const double& CriticalValue,
300 void TransferElementalValuesToNodes(
const TransferParameters& rTransferVariables,
308 const Element & rReferenceElement,
316 const Element & rReferenceElement,
324 void TransferElementalValuesToElements(
ModelPart& rModelPart,
325 const Element & rReferenceElement,
335 std::vector<double>& rCenter,
double& rRadius)
338 if( rPointCoordinates.size() == 3 ){
340 CalculateCenterAndSearchRadius( rPointCoordinates[0][0], rPointCoordinates[0][1],
341 rPointCoordinates[1][0], rPointCoordinates[1][1],
342 rPointCoordinates[2][0], rPointCoordinates[2][1],
343 rCenter[0], rCenter[1], rRadius);
345 else if( rPointCoordinates.size() == 4 ){
347 CalculateCenterAndSearchRadius( rPointCoordinates[0][0], rPointCoordinates[0][1], rPointCoordinates[0][2],
348 rPointCoordinates[1][0], rPointCoordinates[1][1], rPointCoordinates[1][2],
349 rPointCoordinates[2][0], rPointCoordinates[2][1], rPointCoordinates[2][2],
350 rPointCoordinates[3][0], rPointCoordinates[3][1], rPointCoordinates[3][2],
351 rCenter[0], rCenter[1], rCenter[2], rRadius);
354 KRATOS_THROW_ERROR( std::logic_error,
"Number of points supplied out of range ERROR",
"" )
365 const double x1,
const double y1,
366 double&
xc,
double&
yc,
double&
R)
371 R = sqrt( (
xc-x0)*(
xc-x0) + (
yc-y0)*(
yc-y0) );
376 const double x1,
const double y1,
const double z1,
377 const double x2,
const double y2,
const double z2,
378 double&
xc,
double&
yc,
double& zc,
double&
R)
380 xc = 0.3333333333333333333*(x0+
x1+
x2);
381 yc = 0.3333333333333333333*(y0+y1+y2);
382 zc = 0.3333333333333333333*(z0+z1+z2);
384 double R1 = (
xc-x0)*(
xc-x0) + (
yc-y0)*(
yc-y0) + (zc-z0)*(zc-z0);
385 double R2 = (
xc-
x1)*(
xc-
x1) + (
yc-y1)*(
yc-y1) + (zc-z1)*(zc-z1);
386 double R3 = (
xc-
x2)*(
xc-
x2) + (
yc-y2)*(
yc-y2) + (zc-z2)*(zc-z2);
397 const double x1,
const double y1,
398 const double x2,
const double y2,
399 double&
xc,
double&
yc,
double&
R)
401 xc = 0.3333333333333333333*(x0+
x1+
x2);
402 yc = 0.3333333333333333333*(y0+y1+y2);
404 double R1 = (
xc-x0)*(
xc-x0) + (
yc-y0)*(
yc-y0);
416 const double x1,
const double y1,
const double z1,
417 const double x2,
const double y2,
const double z2,
418 const double x3,
const double y3,
const double z3,
419 double&
xc,
double&
yc,
double& zc,
double&
R)
422 yc = 0.25*(y0+y1+y2+y3);
423 zc = 0.25*(z0+z1+z2+z3);
425 double R1 = (
xc-x0)*(
xc-x0) + (
yc-y0)*(
yc-y0) + (zc-z0)*(zc-z0);
426 double R2 = (
xc-
x1)*(
xc-
x1) + (
yc-y1)*(
yc-y1) + (zc-z1)*(zc-z1);
427 double R3 = (
xc-
x2)*(
xc-
x2) + (
yc-y2)*(
yc-y2) + (zc-z2)*(zc-z2);
428 double R4 = (
xc-x3)*(
xc-x3) + (
yc-y3)*(
yc-y3) + (zc-z3)*(zc-z3);
448 const std::vector<double>&
N,
451 double alpha = 1.0 );
455 const std::vector<double>&
N,
458 double alpha = 1.0 );
461 const std::vector<double>&
N,
462 unsigned int step_data_size,
464 double alpha = 1.0 );
468 const std::vector<double>&
N,
469 unsigned int step_data_size,
471 double alpha = 1.0 );
489 virtual std::string
Info()
const
605 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Conditions.
Definition: condition.h:59
Base class for all Elements.
Definition: element.h:60
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
void Reset(const Flags ThisFlag)
Definition: flags.h:193
Geometry base class.
Definition: geometry.h:71
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
Short class definition.
Definition: mesh_data_transfer_utilities.hpp:46
ModelPart::MeshType::GeometryType::PointsArrayType PointsArrayType
Definition: mesh_data_transfer_utilities.hpp:59
ModelPart::MeshType MeshType
Definition: mesh_data_transfer_utilities.hpp:56
KRATOS_DEFINE_LOCAL_FLAG(MASTER_ELEMENT_TO_MASTER_CONDITION)
void CalculateCenterAndSearchRadius(const double x0, const double y0, const double x1, const double y1, double &xc, double &yc, double &R)
Definition: mesh_data_transfer_utilities.hpp:364
GlobalPointersVector< Condition > ConditionWeakPtrVectorType
Definition: mesh_data_transfer_utilities.hpp:68
Kratos::weak_ptr< Element > ElementWeakPtrType
Definition: mesh_data_transfer_utilities.hpp:63
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: mesh_data_transfer_utilities.hpp:67
void TransferElementalValuesToNodes(ModelPart &rModelPart, const Element &rReferenceElement, PointPointerVector &list_of_new_centers, std::vector< Geometry< Node > > &list_of_new_vertices)
Kratos::weak_ptr< Node > NodeWeakPtrType
Definition: mesh_data_transfer_utilities.hpp:62
Kratos::weak_ptr< Condition > ConditionWeakPtrType
Definition: mesh_data_transfer_utilities.hpp:64
void CalculateCenterAndSearchRadius(const std::vector< std::vector< double > > &rPointCoordinates, std::vector< double > &rCenter, double &rRadius)
Definition: mesh_data_transfer_utilities.hpp:334
void CalculateCenterAndSearchRadius(const double x0, const double y0, const double x1, const double y1, const double x2, const double y2, double &xc, double &yc, double &R)
Definition: mesh_data_transfer_utilities.hpp:396
ModelPart::ElementsContainerType ElementsContainerType
Definition: mesh_data_transfer_utilities.hpp:57
ModelPart::PropertiesType PropertiesType
Definition: mesh_data_transfer_utilities.hpp:55
void CalculateCenterAndSearchRadius(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, double &xc, double &yc, double &zc, double &R)
Definition: mesh_data_transfer_utilities.hpp:375
KRATOS_DEFINE_LOCAL_FLAG(ELEMENT_TO_NODE)
MeshDataTransferUtilities()
Default constructor.
Definition: mesh_data_transfer_utilities.hpp:194
void CalculateCenterAndSearchRadius(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x3, const double y3, const double z3, double &xc, double &yc, double &zc, double &R)
Definition: mesh_data_transfer_utilities.hpp:415
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: mesh_data_transfer_utilities.hpp:498
KRATOS_DEFINE_LOCAL_FLAG(INITIALIZE_MASTER_CONDITION)
ModelPart::NodesContainerType NodesContainerType
Definition: mesh_data_transfer_utilities.hpp:58
virtual std::string Info() const
Turn back information as a string.
Definition: mesh_data_transfer_utilities.hpp:489
KRATOS_DEFINE_LOCAL_FLAG(NODE_TO_ELEMENT)
MeshDataTransferUtilities(MeshDataTransferUtilities const &rOther)
Copy constructor.
Definition: mesh_data_transfer_utilities.hpp:200
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: mesh_data_transfer_utilities.hpp:66
KRATOS_CLASS_POINTER_DEFINITION(MeshDataTransferUtilities)
Pointer definition of data transfer.
std::vector< Node::Pointer > PointPointerVector
Definition: mesh_data_transfer_utilities.hpp:60
virtual ~MeshDataTransferUtilities()
Destructor.
Definition: mesh_data_transfer_utilities.hpp:206
KRATOS_DEFINE_LOCAL_FLAG(ELEMENT_TO_ELEMENT)
int mEchoLevel
Definition: mesh_data_transfer_utilities.hpp:516
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: mesh_data_transfer_utilities.hpp:495
void TransferNodalValuesToElements(ModelPart &rModelPart, const Element &rReferenceElement, PointPointerVector &list_of_new_centers, std::vector< Geometry< Node > > &list_of_new_vertices)
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class defines the node.
Definition: node.h:65
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
A shared variable list gives the position of each variable in the containers sharing it.
Definition: variables_list_data_value_container.h:61
Holds a list of variables and their position in VariablesListDataValueContainer.
Definition: variables_list.h:50
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
void InterpolateVariables(std::vector< double > &rValuesList, const GeometryType &rGeometry, const Vector &rSamplingPointShapeFunctions, const SizeType LocalSamplePointValuesOffset, const TVariableInfoTuplesList &... rVariableInfoTuplesList)
Interpolates variables for given variable list tuples.
Definition: rans_line_output_process.h:290
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
std::weak_ptr< T > weak_ptr
Definition: smart_pointers.h:30
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
x2
Definition: generate_frictional_mortar_condition.py:122
x1
Definition: generate_frictional_mortar_condition.py:121
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
R
Definition: isotropic_damage_automatic_differentiation.py:172
def Interpolate(variable, entity, sf_values, historical_value)
Definition: point_output_process.py:231
float xc
Definition: rotating_cone.py:77
float yc
Definition: rotating_cone.py:78
N
Definition: sensitivityMatrix.py:29
Definition: mesh_data_transfer_utilities.hpp:171
std::vector< Matrix > MatrixVariableArray
Definition: mesh_data_transfer_utilities.hpp:176
std::vector< double > DoubleVariableArray
Definition: mesh_data_transfer_utilities.hpp:173
unsigned int array_size
Definition: mesh_data_transfer_utilities.hpp:172
void Initialize(const unsigned int &size)
Definition: mesh_data_transfer_utilities.hpp:178
std::vector< Vector > VectorVariableArray
Definition: mesh_data_transfer_utilities.hpp:175
std::vector< array_1d< double, 3 > > Array1DVariableArray
Definition: mesh_data_transfer_utilities.hpp:174
Definition: mesh_data_transfer_utilities.hpp:150
double DoubleVariable
Definition: mesh_data_transfer_utilities.hpp:152
void Initialize(const unsigned int &dimension, const unsigned int &voigt_size)
Definition: mesh_data_transfer_utilities.hpp:157
array_1d< double, 3 > Array1DVariable
Definition: mesh_data_transfer_utilities.hpp:153
Vector VectorVariable
Definition: mesh_data_transfer_utilities.hpp:154
Matrix MatrixVariable
Definition: mesh_data_transfer_utilities.hpp:155
Definition: mesh_data_transfer_utilities.hpp:80
std::vector< const Variable< Vector > * > VectorVariables
Definition: mesh_data_transfer_utilities.hpp:88
void Reset(Flags ThisFlag)
Definition: mesh_data_transfer_utilities.hpp:99
std::vector< const Variable< array_1d< double, 3 > > * > Array1DVariables
Definition: mesh_data_transfer_utilities.hpp:87
void Initialize()
Definition: mesh_data_transfer_utilities.hpp:141
void Set(Flags ThisFlag)
Definition: mesh_data_transfer_utilities.hpp:94
bool VariablesSetFlag
Definition: mesh_data_transfer_utilities.hpp:91
void SetVariable(const Variable< Matrix > &pVariable)
Definition: mesh_data_transfer_utilities.hpp:130
KRATOS_CLASS_POINTER_DEFINITION(TransferParameters)
void SetVariable(const Variable< double > &pVariable)
Definition: mesh_data_transfer_utilities.hpp:110
void SetVariable(const Variable< Vector > &pVariable)
Definition: mesh_data_transfer_utilities.hpp:123
void SetVariable(const Variable< array_1d< double, 3 > > &pVariable)
Definition: mesh_data_transfer_utilities.hpp:116
std::vector< const Variable< double > * > DoubleVariables
Definition: mesh_data_transfer_utilities.hpp:86
void SetOptions(const Flags &rOptions)
Definition: mesh_data_transfer_utilities.hpp:104
std::vector< const Variable< Matrix > * > MatrixVariables
Definition: mesh_data_transfer_utilities.hpp:89
Flags Options
Definition: mesh_data_transfer_utilities.hpp:84
Flags GetOptions()
Definition: mesh_data_transfer_utilities.hpp:136