15 #if !defined(CALCULATE_NORMAL_EQ_INCLUDED )
16 #define CALCULATE_NORMAL_EQ_INCLUDED
29 #include <pybind11/pybind11.h>
36 #include "utilities/geometry_utilities.h"
119 double pi = 3.14159265359;
120 double theta_eq = ThisModelPart.
GetProcessInfo()[CONTACT_ANGLE_STATIC];
121 double theta_rad = theta_eq*
pi/180.0;
129 for(ModelPart::NodesContainerType::iterator
im = ThisModelPart.
NodesBegin() ;
im != ThisModelPart.
NodesEnd() ; ++
im)
132 if (
im->FastGetSolutionStepValue(TRIPLE_POINT) != 0.0)
134 temp[0] =
im->FastGetSolutionStepValue(NORMAL_TRIPLE_POINT_X);
135 temp[1] =
im->FastGetSolutionStepValue(NORMAL_TRIPLE_POINT_Y);
137 normal_eq[0] = sin(theta_rad)*
temp[0];
138 normal_eq[1] = sin(theta_rad)*
temp[1];
139 normal_eq[2] = cos(theta_rad);
141 im->FastGetSolutionStepValue(NORMAL_EQUILIBRIUM) = normal_eq;
143 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_EQUILIBRIUM_X) = -cos(theta_rad)*
temp[0];
144 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_EQUILIBRIUM_Y) = -cos(theta_rad)*
temp[1];
145 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_EQUILIBRIUM_Z) = sin(theta_rad);
146 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_EQUILIBRIUM) =
NormalizeVec3D(
im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_EQUILIBRIUM));
150 im->FastGetSolutionStepValue(NORMAL_CONTACT_LINE_EQUILIBRIUM) =
ZeroVector(3);
166 const double x1,
const double y1,
const double z1)
177 return sqrt(
a[0]*
a[0] +
a[1]*
a[1]);
182 return sqrt(
a[0]*
a[0] +
a[1]*
a[1] +
a[2]*
a[2]);
211 for (
unsigned int i = 0;
i < 3;
i++)
220 double pi = 3.14159265359;
224 if (norm_a*norm_b > -0.00000001 && norm_a*norm_b < 0.00000001)
228 return (acos(
temp)*180.0/
pi);
233 return (
a[0]*
b[0] +
a[1]*
b[1] +
a[2]*
b[2]);
251 std::string
Info()
const override
253 return "AssignSurfaceTensionConditions";
259 rOStream <<
"AssignSurfaceTensionConditions";
377 rOStream << std::endl;
Short class definition.
Definition: calculate_normal_eq.h:76
CalculateNormalEq()
Default constructor.
Definition: calculate_normal_eq.h:90
KRATOS_CLASS_POINTER_DEFINITION(CalculateNormalEq)
Pointer definition of PushStructureProcess.
~CalculateNormalEq() override
Destructor.
Definition: calculate_normal_eq.h:95
std::string Info() const override
Turn back information as a string.
Definition: calculate_normal_eq.h:251
array_1d< double, 2 > NormalizeVec2D(array_1d< double, 2 > &input)
Definition: calculate_normal_eq.h:185
double Angle2vecs3D(const array_1d< double, 3 > &a, const array_1d< double, 3 > &b)
Definition: calculate_normal_eq.h:218
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: calculate_normal_eq.h:263
double Norm2D(const array_1d< double, 2 > &a)
Definition: calculate_normal_eq.h:175
double Norm3D(const array_1d< double, 3 > &a)
Definition: calculate_normal_eq.h:180
array_1d< double, 2 > Vector2D(const double x0, const double y0, const double x1, const double y1)
Definition: calculate_normal_eq.h:157
array_1d< double, 3 > Vector3D(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1)
Definition: calculate_normal_eq.h:165
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_normal_eq.h:257
array_1d< double, 3 > NormalizeVec3D(array_1d< double, 3 > &input)
Definition: calculate_normal_eq.h:196
array_1d< double, 3 > SumVecs3D(const array_1d< double, 3 > &a, const array_1d< double, 3 > &b)
Definition: calculate_normal_eq.h:208
double DotProduct3D(const array_1d< double, 3 > &a, const array_1d< double, 3 > &b)
Definition: calculate_normal_eq.h:231
void CalculateNormalEq3D(ModelPart &ThisModelPart)
Definition: calculate_normal_eq.h:115
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
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
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
input
Definition: generate_frictional_mortar_condition.py:435
x1
Definition: generate_frictional_mortar_condition.py:121
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
float temp
Definition: rotating_cone.py:85
integer i
Definition: TensorModule.f:17
double precision, public pi
Definition: TensorModule.f:16