10 #if !defined(KRATOS_CONTACT_DOMAIN_UTILITIES_H_INCLUDED )
11 #define KRATOS_CONTACT_DOMAIN_UTILITIES_H_INCLUDED
136 const double x1,
const double y1,
137 const double x2,
const double y2)
139 return 0.5*( (
x1-x0)*(y2-y0)- (y1-y0)*(
x2-x0) );
147 const double x1,
const double y1,
148 const double x2,
const double y2,
149 const double xc,
const double yc)
151 double area = CalculateVolume(x0,y0,
x1,y1,
x2,y2);
158 std::cout<<
"element with zero area found: "<<area<<
" position ("<<x0<<
", "<<y0<<
") ("<<
x1<<
", "<<y1<<
") ("<<
x2<<
", "<<y2<<
") "<<std::endl;
163 N[0] = CalculateVolume(
x1,y1,
x2,y2,
xc,
yc) / area;
164 N[1] = CalculateVolume(
x2,y2,x0,y0,
xc,
yc) / area;
165 N[2] = CalculateVolume(x0,y0,
x1,y1,
xc,
yc) / area;
168 double upper_limit = 1.0+
tol;
169 double lower_limit = -
tol;
171 if(
N[0] >= lower_limit &&
N[1] >= lower_limit &&
N[2] >= lower_limit &&
N[0] <= upper_limit &&
N[1] <= upper_limit &&
N[2] <= upper_limit)
181 const double x1,
const double y1,
182 const double xc,
const double yc)
185 double side0 = sqrt( (x0-
x1)*(x0-
x1) + (y0-y1)*(y0-y1) );
186 double side1 = sqrt( (x0-
xc)*(x0-
xc) + (y0-
yc)*(y0-
yc) );
187 double side2 = sqrt( (
xc-
x1)*(
xc-
x1) + (
yc-y1)*(
yc-y1) );
189 double cos_angle = 0;
190 double aux = (2*side1*side0);
192 cos_angle = ((side1*side1) + (side0*side0) - (side2*side2)) / aux;
197 aux = (2*side2*side0);
199 cos_angle = ((side2*side2) + (side0*side0) - (side1*side1)) / aux;
208 void CalculateBaseArea (
double& area,
213 void CalculateLineIntersection (
double&
a,
220 void CalculateEdgeDistances (std::vector<BaseLengths>& BaseVector,
227 void CalculateBaseDistances (std::vector<BaseLengths>& BaseVector,
235 void CalculateBaseDistances (BaseLengths& Base,
261 void GetOppositeEdge(
unsigned int&
i,
unsigned int&
j,
unsigned int&
k,
unsigned int&
l);
264 void BuildEdgeVector(std::vector<std::vector<std::vector<unsigned int> > >& rEdges);
280 virtual std::string
Info()
const
396 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Short class definition.
Definition: contact_domain_utilities.hpp:45
ContactDomainUtilities()
Default constructor.
Definition: contact_domain_utilities.hpp:120
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_FRICTION_STIFFNESS)
KRATOS_CLASS_POINTER_DEFINITION(ContactDomainUtilities)
Pointer definition of ContactDomainUtilities.
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_LHS_MATRIX)
bool CalculatePosition(const double x0, const double y0, const double x1, const double y1, const double x2, const double y2, const double xc, const double yc)
Definition: contact_domain_utilities.hpp:146
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_LHS_MATRIX_WITH_COMPONENTS)
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_RHS_VECTOR)
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_NODAL_CONTACT_FORCES)
virtual std::string Info() const
Turn back information as a string.
Definition: contact_domain_utilities.hpp:280
array_1d< double, 3 > PointType
Tensor order 1 definition.
Definition: contact_domain_utilities.hpp:70
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: contact_domain_utilities.hpp:289
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_FRICTION_FORCES)
double CalculateVolume(const double x0, const double y0, const double x1, const double y1, const double x2, const double y2)
Definition: contact_domain_utilities.hpp:135
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_RHS_VECTOR_WITH_COMPONENTS)
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: contact_domain_utilities.hpp:286
virtual ~ContactDomainUtilities()
Destructor.
Definition: contact_domain_utilities.hpp:123
bool CalculateObtuseAngle(const double x0, const double y0, const double x1, const double y1, const double xc, const double yc)
Definition: contact_domain_utilities.hpp:180
Point class.
Definition: point.h:59
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
int tol
Definition: hinsberg_optimization.py:138
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float xc
Definition: rotating_cone.py:77
float yc
Definition: rotating_cone.py:78
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31
Definition: contact_domain_utilities.hpp:74
double A
Definition: contact_domain_utilities.hpp:76
double L
Definition: contact_domain_utilities.hpp:75
double B
Definition: contact_domain_utilities.hpp:77
Definition: contact_domain_utilities.hpp:99
double Covariant
Definition: contact_domain_utilities.hpp:100
double Contravariant
Definition: contact_domain_utilities.hpp:101
Definition: contact_domain_utilities.hpp:107
PointType DirectionB
Definition: contact_domain_utilities.hpp:110
PointType DirectionA
Definition: contact_domain_utilities.hpp:109
Matrix Metric
Definition: contact_domain_utilities.hpp:108
Definition: contact_domain_utilities.hpp:91
double Tangent
Definition: contact_domain_utilities.hpp:93
double Normal
Definition: contact_domain_utilities.hpp:92
Definition: contact_domain_utilities.hpp:83
PointType Tangent
Definition: contact_domain_utilities.hpp:85
PointType Normal
Definition: contact_domain_utilities.hpp:84