63 template<
class TPo
intType>
163 Line3D3(
typename PointType::Pointer pFirstPoint,
typename PointType::Pointer pSecondPoint,
164 typename PointType::Pointer pThirdPoint )
173 :
BaseType( ThisPoints, &msGeometryData )
183 ) :
BaseType(GeometryId, rThisPoints, &msGeometryData)
190 const std::string& rGeometryName,
192 ) :
BaseType(rGeometryName, rThisPoints, &msGeometryData)
265 template<
class TOtherPo
intType>
287 return typename BaseType::Pointer(
new Line3D3(NewGeometryId, rThisPoints ) );
301 auto p_geometry =
typename BaseType::Pointer(
new Line3D3( NewGeometryId, rGeometry.
Points() ) );
302 p_geometry->SetData(rGeometry.
GetData());
319 if(rResult.size() != 3)
320 rResult.
resize( 3,
false );
321 rResult[0] = 1.0/6.0;
322 rResult[2] = 2.0/3.0;
323 rResult[1] = 1.0/6.0;
392 const double Tolerance = std::numeric_limits<double>::epsilon()
397 if ( std::abs( rResult[0] ) <= (1.0 + Tolerance) )
413 if( rResult.size() != number_of_integration_points)
414 rResult.
resize( number_of_integration_points,
false );
417 for (std::size_t pnt = 0; pnt < number_of_integration_points; ++pnt) {
418 this->
Jacobian( J, pnt, ThisMethod);
419 rResult[pnt] = std::sqrt(std::pow(
J(0,0), 2) + std::pow(
J(1,0), 2) + std::pow(
J(2,0), 2));
437 this->
Jacobian( J, IntegrationPointIndex, ThisMethod);
438 return std::sqrt(std::pow(
J(0,0), 2) + std::pow(
J(1,0), 2) + std::pow(
J(2,0), 2));
452 return std::sqrt(std::pow(
J(0,0), 2) + std::pow(
J(1,0), 2) + std::pow(
J(2,0), 2));
489 if(rResult.size() != 3) {
493 rResult[0] = 0.5 * (rCoordinates[0] - 1.0) * rCoordinates[0];
494 rResult[1] = 0.5 * (rCoordinates[0] + 1.0) * rCoordinates[0];
495 rResult[2] = 1.0 - rCoordinates[0] * rCoordinates[0];
512 switch ( ShapeFunctionIndex )
515 return( 0.5*( rPoint[0] - 1.0 )*rPoint[0] );
517 return( 0.5*( rPoint[0] + 1.0 )*rPoint[0] );
519 return( 1.0 -rPoint[0]*rPoint[0] );
522 KRATOS_ERROR <<
"Wrong index of shape function!" << *
this << std::endl;
536 = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
537 const int integration_points_number
541 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
543 Result[pnt] = localGradients[pnt];
557 = CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
558 const int integration_points_number
562 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
564 Result[pnt] = localGradients[pnt];
582 if(rResult.size1() != 3 || rResult.size2() != 1) {
583 rResult.
resize( 3, 1,
false );
587 rResult( 0, 0 ) = rPoint[0] - 0.5;
588 rResult( 1, 0 ) = rPoint[0] + 0.5;
589 rResult( 2, 0 ) = -rPoint[0] * 2.0;
600 if(rResult.size1() != 3 || rResult.size2() != 1) {
601 rResult.
resize( 3, 1,
false );
604 rResult( 0, 0 ) = -1.0;
605 rResult( 1, 0 ) = 1.0;
606 rResult( 2, 0 ) = 0.0;
628 constexpr
double TOLERANCE = 1
e-12;
630 const auto& r_p0 = this->
GetPoint(0);
631 const auto& r_p1 = this->
GetPoint(1);
632 const auto& r_p2 = this->
GetPoint(2);
652 if (
aux1 < TOLERANCE) {
656 return line.PointLocalCoordinates(rResult, rPoint);
660 if (std::abs(
aux2) < TOLERANCE) {
673 std::vector<PolynomialUtilities::IntervalType> root_ranges;
675 root_ranges, distance_objective,
679 for (
const auto& interval: root_ranges) {
705 if(rResult.size1() != 3 || rResult.size2() != 1) {
706 rResult.
resize( 3, 1,
false );
710 rResult( 0, 0 ) = rPoint[0] - 0.5;
711 rResult( 1, 0 ) = rPoint[0] + 0.5;
712 rResult( 2, 0 ) = -rPoint[0] * 2.0;
726 std::string
Info()
const override
728 return "1 dimensional line with 3 nodes in 3D space";
739 rOStream <<
"1 dimensional line with 3 nodes in 3D space";
754 std::cout << std::endl;
760 rOStream <<
" Jacobian\t : " << jacobian;
816 void save(
Serializer& rSerializer )
const override
841 Matrix N( integration_points_number, 3 );
843 for (
int it_gp = 0; it_gp < integration_points_number; it_gp++ )
846 N( it_gp, 0 ) = 0.5 * (
e - 1 ) *
e;
847 N( it_gp, 2 ) = 1.0 -
e *
e;
848 N( it_gp, 1 ) = 0.5 * ( 1 +
e ) *
e;
860 std::fill( DN_De.begin(), DN_De.end(),
Matrix( 3, 1 ) );
866 aux_mat(0,0) =
e - 0.5;
867 aux_mat(2,0) = -2.0 *
e;
868 aux_mat(1,0) =
e + 0.5;
869 DN_De[it_gp] = aux_mat;
878 Quadrature<LineGaussLegendreIntegrationPoints1, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
879 Quadrature<LineGaussLegendreIntegrationPoints2, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
880 Quadrature<LineGaussLegendreIntegrationPoints3, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
881 Quadrature<LineGaussLegendreIntegrationPoints4, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
882 Quadrature<LineGaussLegendreIntegrationPoints5, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
883 Quadrature<LineCollocationIntegrationPoints1, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
884 Quadrature<LineCollocationIntegrationPoints2, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
885 Quadrature<LineCollocationIntegrationPoints3, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
886 Quadrature<LineCollocationIntegrationPoints4, 1, IntegrationPoint<3> >::GenerateIntegrationPoints(),
887 Quadrature<LineCollocationIntegrationPoints5, 1, IntegrationPoint<3> >::GenerateIntegrationPoints()
890 return integration_points;
908 return shape_functions_values;
926 return shape_functions_local_gradients;
943 template<
class TOtherPo
intType>
friend class Line3D3;
965 template<
class TPo
intType>
970 template<
class TPo
intType>
975 rOStream << std::endl;
984 template<
class TPo
intType>
985 const GeometryData Line3D3<TPointType>::msGeometryData(
988 Line3D3<TPointType>::AllIntegrationPoints(),
989 Line3D3<TPointType>::AllShapeFunctionsValues(),
990 AllShapeFunctionsLocalGradients() );
992 template<
class TPo
intType>
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
SizeType IntegrationPointsNumber() const
Definition: geometry_data.h:430
IntegrationMethod
Definition: geometry_data.h:76
KratosGeometryFamily
Definition: geometry_data.h:91
IntegrationMethod DefaultIntegrationMethod() const
Definition: geometry_data.h:425
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: geometry.h:3834
Geometry & operator=(const Geometry &rOther)
Definition: geometry.h:400
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
DataValueContainer & GetData()
Definition: geometry.h:591
const Matrix & ShapeFunctionsValues() const
Definition: geometry.h:3393
std::size_t SizeType
Definition: geometry.h:144
const TPointType::Pointer pGetPoint(const int Index) const
Definition: geometry.h:1790
std::size_t IndexType
Definition: geometry.h:137
std::array< Matrix, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> ShapeFunctionsValuesContainerType
Definition: geometry.h:172
const PointsArrayType & Points() const
Definition: geometry.h:1768
bool AllPointsAreValid() const
Checks if the geometry points are valid Checks if the geometry points are valid from the pointer valu...
Definition: geometry.h:4093
std::array< IntegrationPointsArrayType, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: geometry.h:167
LumpingMethods
This defines the different methods to compute the lumping methods.
Definition: geometry.h:109
const IntegrationPointsArrayType & IntegrationPoints() const
Definition: geometry.h:2284
JacobiansType & Jacobian(JacobiansType &rResult) const
Definition: geometry.h:2901
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
GeometryData::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: geometry.h:177
SizeType IntegrationPointsNumber() const
Definition: geometry.h:2257
GeometryData::IntegrationMethod IntegrationMethod
Definition: geometry.h:122
Short class definition.
Definition: integration_point.h:52
static double ComputeDomainSize(const TGeometryType &rGeometry)
This method calculates and returns the domain size of the geometry from any geometry in a generic man...
Definition: integration_utilities.h:63
static GeometryData::IntegrationMethod GetIntegrationMethodForExactMassMatrixEvaluation(const Geometry< TPointType > &rGeometry)
This method returns the integration order for the exact mass matrix evaluation.
Definition: integration_utilities.h:42
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
An two node 3D line geometry with linear shape functions.
Definition: line_3d_2.h:64
An three node 3D line geometry with quadratic shape functions.
Definition: line_3d_3.h:66
BaseType::Pointer Create(const IndexType NewGeometryId, const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: line_3d_3.h:296
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients(IntegrationMethod ThisMethod)
Definition: line_3d_3.h:532
BaseType::IntegrationPointType IntegrationPointType
Definition: line_3d_3.h:113
double DomainSize() const override
Definition: line_3d_3.h:376
Line3D3 & operator=(const Line3D3 &rOther)
Definition: line_3d_3.h:251
Line3D3(Line3D3 const &rOther)
Definition: line_3d_3.h:204
double DeterminantOfJacobian(IndexType IntegrationPointIndex, IntegrationMethod ThisMethod) const override
Determinant of jacobian in specific integration point of given integration method....
Definition: line_3d_3.h:432
Vector & LumpingFactors(Vector &rResult, const typename BaseType::LumpingMethods LumpingMethod=BaseType::LumpingMethods::ROW_SUM) const override
Lumping factors for the calculation of the lumped mass matrix.
Definition: line_3d_3.h:314
bool IsInside(const CoordinatesArrayType &rPoint, CoordinatesArrayType &rResult, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Returns whether given arbitrary point is inside the Geometry and the respective local point for the g...
Definition: line_3d_3.h:389
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
This method gives all non-zero shape functions values evaluated at the rCoordinates provided.
Definition: line_3d_3.h:484
CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const override
Returns the local coordinates of a given arbitrary point.
Definition: line_3d_3.h:616
BaseType::GeometriesArrayType GeometriesArrayType
Definition: line_3d_3.h:85
TPointType PointType
Definition: line_3d_3.h:89
BaseType::JacobiansType JacobiansType
Definition: line_3d_3.h:142
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: line_3d_3.h:120
SizeType EdgesNumber() const override
Definition: line_3d_3.h:462
BaseType::SizeType SizeType
Definition: line_3d_3.h:102
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: line_3d_3.h:148
BaseType::IndexType IndexType
Definition: line_3d_3.h:95
std::string Info() const override
Definition: line_3d_3.h:726
BaseType::Pointer Create(const IndexType NewGeometryId, PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: line_3d_3.h:282
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients()
Definition: line_3d_3.h:553
~Line3D3() override
Destructor. Do nothing!!!
Definition: line_3d_3.h:225
BaseType::PointsArrayType PointsArrayType
Definition: line_3d_3.h:107
Geometry< TPointType > BaseType
Geometry as base class.
Definition: line_3d_3.h:73
Line3D3(typename PointType::Pointer pFirstPoint, typename PointType::Pointer pSecondPoint, typename PointType::Pointer pThirdPoint)
Definition: line_3d_3.h:163
Vector & DeterminantOfJacobian(Vector &rResult, IntegrationMethod ThisMethod) const override
Determinant of jacobians for given integration method.
Definition: line_3d_3.h:410
SizeType FacesNumber() const override
Returns the number of faces of the current geometry.
Definition: line_3d_3.h:467
double Area() const override
Definition: line_3d_3.h:360
BaseType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: line_3d_3.h:126
Line3D3 & operator=(Line3D3< TOtherPointType > const &rOther)
Definition: line_3d_3.h:266
BaseType::NormalType NormalType
Definition: line_3d_3.h:152
double Length() const override
Definition: line_3d_3.h:343
KRATOS_CLASS_POINTER_DEFINITION(Line3D3)
Pointer definition of Line3D3.
BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: line_3d_3.h:136
double ShapeFunctionValue(IndexType ShapeFunctionIndex, const CoordinatesArrayType &rPoint) const override
This method gives value of given shape function evaluated in given point.
Definition: line_3d_3.h:509
Line3D3(const IndexType GeometryId, const PointsArrayType &rThisPoints)
Constructor with Geometry Id.
Definition: line_3d_3.h:180
GeometryData::IntegrationMethod IntegrationMethod
Definition: line_3d_3.h:80
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: line_3d_3.h:227
void PrintData(std::ostream &rOStream) const override
Definition: line_3d_3.h:750
Line3D3(const std::string &rGeometryName, const PointsArrayType &rThisPoints)
Constructor with Geometry Name.
Definition: line_3d_3.h:189
Line3D3(Line3D3< TOtherPointType > const &rOther)
Definition: line_3d_3.h:219
Line3D3(const PointsArrayType &ThisPoints)
Definition: line_3d_3.h:172
BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: line_3d_3.h:131
friend class Line3D3
Definition: line_3d_3.h:943
Matrix & PointsLocalCoordinates(Matrix &rResult) const override
Definition: line_3d_3.h:598
void PrintInfo(std::ostream &rOStream) const override
Definition: line_3d_3.h:737
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: line_3d_3.h:157
double DeterminantOfJacobian(const CoordinatesArrayType &rPoint) const override
Determinant of jacobian in given point. This method calculate determinant of jacobian matrix in given...
Definition: line_3d_3.h:448
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: line_3d_3.h:232
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: line_3d_3.h:578
virtual Matrix & ShapeFunctionsGradients(Matrix &rResult, CoordinatesArrayType &rPoint)
Definition: line_3d_3.h:703
Various mathematical utilitiy functions.
Definition: math_utils.h:62
static double Dot3(const Vector &a, const Vector &b)
Performs the dot product of two vectors of dimension 3.
Definition: math_utils.h:654
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Short class definition.
Definition: array_1d.h:61
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
std::vector< double > PolynomialType
Definition: polynomial_utilities.h:26
void IsolateRoots(std::vector< IntervalType > &rRootIntervals, const PolynomialType &rPolynomial, const IntervalType &rRange)
Define disjoint subintervals of rRange, each containing a single root of rPolynomial.
Definition: polynomial_utilities.cpp:153
double FindRoot(const PolynomialType &rPolynomial, const IntervalType &rRange)
Find a root of rPolynomial within the interval defined by rRange.
Definition: polynomial_utilities.cpp:212
std::array< double, 2 > IntervalType
Definition: polynomial_utilities.h:27
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
const GeometryData Line3D3< TPointType >::msGeometryData & msGeometryDimension(), Line3D3< TPointType >::AllShapeFunctionsValues(), AllShapeFunctionsLocalGradients()
Definition: brep_curve.h:483
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
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
float aux2
Definition: isotropic_damage_automatic_differentiation.py:240
float aux1
Definition: isotropic_damage_automatic_differentiation.py:239
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
J
Definition: sensitivityMatrix.py:58
N
Definition: sensitivityMatrix.py:29
subroutine d1(DSTRAN, D, dtime, NDI, NSHR, NTENS)
Definition: TensorModule.f:594
e
Definition: run_cpp_mpi_tests.py:31