15 #if !defined(CALCULATE_NODAL_LENGTH_INCLUDED )
16 #define CALCULATE_NODAL_LENGTH_INCLUDED
29 #include <pybind11/pybind11.h>
36 #include "utilities/geometry_utilities.h"
119 double x0,y0,
x1,y1,
x2,y2,norm10,norm20;
124 for(ModelPart::NodesContainerType::iterator
im = ThisModelPart.
NodesBegin() ;
im != ThisModelPart.
NodesEnd() ; ++
im)
127 if ((
im->FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0)
137 for (
unsigned int i = 0;
i < neighb.
size();
i++)
139 if (neighb[
i].FastGetSolutionStepValue(IS_BOUNDARY) != 0.0)
160 im->FastGetSolutionStepValue(NODAL_LENGTH) = 0.5*(norm10+norm20);
165 if (
im->FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0)
175 for (
unsigned int i = 0;
i < neighb.
size();
i++)
177 if ((neighb[
i].FastGetSolutionStepValue(IS_FREE_SURFACE) != 0.0) || ((
im->FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0 ))
198 im->FastGetSolutionStepValue(NODAL_LENGTH) = 0.5*(norm10+norm20);
214 for(ModelPart::NodesContainerType::iterator
im = ThisModelPart.
NodesBegin() ;
218 if ((
im->FastGetSolutionStepValue(TRIPLE_POINT))*1000 != 0.0)
231 for (
unsigned int i = 0;
i < neighb.
size();
i++)
233 if ((neighb[
i].FastGetSolutionStepValue(TRIPLE_POINT))*1000.0 != 0.0)
235 if (neighb[
i].
X() != x0 || neighb[
i].
Y() != y0 || neighb[
i].
Z() != z0)
259 double norm10 =
Norm3D(r10);
260 double norm20 =
Norm3D(r20);
262 im->FastGetSolutionStepValue(NODAL_LENGTH) = 0.5*(norm10+norm20);
275 void Vector3D(
const double x0,
const double y0,
const double z0,
285 return sqrt(
a[0]*
a[0] +
a[1]*
a[1]);
290 return sqrt(
a[0]*
a[0] +
a[1]*
a[1] +
a[2]*
a[2]);
308 std::string
Info()
const override
310 return "CalculateNodalLength";
316 rOStream <<
"CalculateNodalLength";
434 rOStream << std::endl;
Short class definition.
Definition: calculate_nodal_length.h:77
double Norm3D(const array_1d< double, 3 > &a)
Definition: calculate_nodal_length.h:288
void CalculateNodalLength2D(ModelPart &ThisModelPart)
Definition: calculate_nodal_length.h:115
~CalculateNodalLength() override
Destructor.
Definition: calculate_nodal_length.h:96
void Vector2D(const double x0, const double y0, const double x1, const double y1, array_1d< double, 2 > &r01)
Definition: calculate_nodal_length.h:269
KRATOS_CLASS_POINTER_DEFINITION(CalculateNodalLength)
Pointer definition of PushStructureProcess.
void CalculateNodalLength3D(ModelPart &ThisModelPart)
Definition: calculate_nodal_length.h:208
void Vector3D(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, array_1d< double, 3 > &r01)
Definition: calculate_nodal_length.h:275
double Norm2D(const array_1d< double, 2 > &a)
Definition: calculate_nodal_length.h:283
CalculateNodalLength()
Default constructor.
Definition: calculate_nodal_length.h:91
std::string Info() const override
Turn back information as a string.
Definition: calculate_nodal_length.h:308
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_nodal_length.h:314
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: calculate_nodal_length.h:320
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
size_type size() const
Definition: global_pointers_vector.h:307
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
im
Definition: GenerateCN.py:100
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
x2
Definition: generate_frictional_mortar_condition.py:122
x1
Definition: generate_frictional_mortar_condition.py:121
a
Definition: generate_stokes_twofluid_element.py:77
integer i
Definition: TensorModule.f:17