11 #if !defined(KRATOS_POINT_ON_GEOMETRY_H_INCLUDED )
12 #define KRATOS_POINT_ON_GEOMETRY_H_INCLUDED
33 template<
class TContainerPo
intType,
int TWorkingSpaceDimension,
int TLocalSpaceDimensionOfBackground>
35 :
public Geometry<typename TContainerPointType::value_type>
45 typedef typename TContainerPointType::value_type
PointType;
68 typename GeometryType::Pointer pBackgroundGeometry)
70 , mLocalCoordinates(LocalCoordinates)
71 , mpBackgroundGeometry(pBackgroundGeometry)
73 KRATOS_ERROR_IF(pBackgroundGeometry->WorkingSpaceDimension() != this->WorkingSpaceDimension())
74 <<
"Working space dimension of background geometry (" << pBackgroundGeometry->WorkingSpaceDimension()
75 <<
") does not coincide with WorkingSpaceDimension of this geometry (" << this->
WorkingSpaceDimension() <<
")."
77 KRATOS_ERROR_IF(pBackgroundGeometry->LocalSpaceDimension() != this->LocalSpaceDimension())
78 <<
"Local space dimension of background geometry (" << pBackgroundGeometry->LocalSpaceDimension()
79 <<
") does not coincide with LocalSpaceDimension of this geometry (" << this->
LocalSpaceDimension() <<
")."
86 , mLocalCoordinates(rOther.mLocalCoordinates)
87 , mpBackgroundGeometry(rOther.mpBackgroundGeometry)
102 mLocalCoordinates = rOther.mLocalCoordinates;
103 mpBackgroundGeometry = rOther.mpBackgroundGeometry;
113 return typename BaseType::Pointer(
new PointOnGeometry( ThisPoints ) );
128 const auto& const_this = *
this;
129 return std::const_pointer_cast<GeometryType>(
130 const_this.pGetGeometryPart(
Index));
142 return mpBackgroundGeometry;
144 KRATOS_ERROR <<
"Index " <<
Index <<
" not existing as geometry part in PointOnGeometry #"
145 << this->
Id() << std::endl;
163 return mpBackgroundGeometry->PolynomialDegree(LocalDirectionIndex);
177 mpBackgroundGeometry->GlobalCoordinates(global_location, mLocalCoordinates);
178 return Point(global_location);
193 KRATOS_ERROR <<
"Trying to access the GlobalCoordinates via PointOnGeometry. "
194 <<
"However, this is not possible. Try to access the global coordinates of"
195 <<
" any local coordinates via accessing the background geometry through: "
196 <<
"pGetGeometryPart(GeometryType::BACKGROUND_GEOMETRY_INDEX)." << std::endl;
222 if (rIntegrationPoints.size() != 1) { rIntegrationPoints.resize(1); }
223 rIntegrationPoints[0][0] = mLocalCoordinates[0];
224 rIntegrationPoints[0][1] = mLocalCoordinates[1];
225 rIntegrationPoints[0][2] = mLocalCoordinates[2];
226 rIntegrationPoints[0].Weight() = 1.0;
245 IndexType NumberOfShapeFunctionDerivatives,
252 mpBackgroundGeometry->CreateQuadraturePointGeometries(
253 rQuadraturePointGeometries, NumberOfShapeFunctionDerivatives, integration_point, rIntegrationInfo);
255 if (rResultGeometries.
size() != 1) { rResultGeometries.
resize(1); }
259 std::move(rQuadraturePointGeometries(0)->
Points()),
260 rQuadraturePointGeometries(0)->GetGeometryData().GetGeometryShapeFunctionContainer(),
272 mpBackgroundGeometry->ShapeFunctionsValues(rResult, mLocalCoordinates);
281 mpBackgroundGeometry->ShapeFunctionsLocalGradients(rResult, mLocalCoordinates);
300 std::string
Info()
const override
302 return "PointOnGeometry";
308 rOStream <<
"PointOnGeometry";
315 std::cout << std::endl;
316 rOStream <<
" PointOnGeometry" << std::endl;
335 typename GeometryType::Pointer mpBackgroundGeometry;
343 :
BaseType(ThisPoints, &msGeometryData)
353 void save(
Serializer& rSerializer )
const override
356 rSerializer.
save(
"LocalCoordinates", mLocalCoordinates);
357 rSerializer.
save(
"pBackgroundGeometry", mpBackgroundGeometry);
363 rSerializer.
load(
"LocalCoordinates", mLocalCoordinates);
364 rSerializer.
load(
"pBackgroundGeometry", mpBackgroundGeometry);
379 template<
class TContainerPo
intType,
int TWorkingSpaceDimension,
int TLocalSpaceDimensionOfBackground>
inline std::istream&
operator >> (
380 std::istream& rIStream,
384 template<
class TContainerPo
intType,
int TWorkingSpaceDimension,
int TLocalSpaceDimensionOfBackground>
inline std::ostream&
operator << (
385 std::ostream& rOStream,
389 rOStream << std::endl;
398 template<
class TContainerPo
intType,
int TWorkingSpaceDimension,
int TLocalSpaceDimensionOfBackground>
const
399 GeometryData PointOnGeometry<TContainerPointType, TWorkingSpaceDimension, TLocalSpaceDimensionOfBackground>::msGeometryData(
404 template<
class TContainerPo
intType,
int TWorkingSpaceDimension,
int TLocalSpaceDimensionOfBackground>
Definition: geometry_data.h:60
IntegrationMethod
Definition: geometry_data.h:76
KratosGeometryFamily
Definition: geometry_data.h:91
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
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
SizeType LocalSpaceDimension() const
Definition: geometry.h:1300
std::size_t SizeType
Definition: geometry.h:144
std::size_t IndexType
Definition: geometry.h:137
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
const PointsArrayType & Points() const
Definition: geometry.h:1768
static constexpr IndexType BACKGROUND_GEOMETRY_INDEX
Definition: geometry.h:220
SizeType WorkingSpaceDimension() const
Definition: geometry.h:1287
Integration information for the creation of integration points.
Definition: integration_info.h:35
Point class.
Definition: point.h:59
Definition: point_on_geometry.h:36
std::string Info() const override
Turn back information as a string.
Definition: point_on_geometry.h:300
IntegrationInfo GetDefaultIntegrationInfo() const override
Provides the default integration dependent on the polynomial degree.
Definition: point_on_geometry.h:206
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: point_on_geometry.h:277
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, IntegrationInfo &rIntegrationInfo) override
Definition: point_on_geometry.h:243
PointOnGeometry(const CoordinatesArrayType LocalCoordinates, typename GeometryType::Pointer pBackgroundGeometry)
Constructor with the local coordinates and background geometry.
Definition: point_on_geometry.h:66
TContainerPointType::value_type PointType
Definition: point_on_geometry.h:45
GeometryPointer pGetGeometryPart(IndexType Index) override
This function returns the pointer of the background geometry of this point. Accesseable via GeometryT...
Definition: point_on_geometry.h:126
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) const override
Definition: point_on_geometry.h:218
BaseType::Pointer Create(PointsArrayType const &ThisPoints) const override
Definition: point_on_geometry.h:111
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: point_on_geometry.h:268
BaseType::SizeType SizeType
Definition: point_on_geometry.h:54
PointOnGeometry & operator=(const PointOnGeometry &rOther)
Assignment operator.
Definition: point_on_geometry.h:99
Geometry< typename TContainerPointType::value_type > GeometryType
Definition: point_on_geometry.h:48
BaseType::GeometriesArrayType GeometriesArrayType
Definition: point_on_geometry.h:58
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: point_on_geometry.h:57
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: point_on_geometry.h:290
GeometryData::IntegrationMethod IntegrationMethod
Definition: point_on_geometry.h:51
KRATOS_CLASS_POINTER_DEFINITION(PointOnGeometry)
Pointer definition of PointOnGeometry.
BaseType::IndexType IndexType
Definition: point_on_geometry.h:53
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: point_on_geometry.h:59
~PointOnGeometry() override=default
Destructor.
GeometryType::Pointer GeometryPointer
Definition: point_on_geometry.h:49
Geometry< typename TContainerPointType::value_type > BaseType
Definition: point_on_geometry.h:47
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: point_on_geometry.h:306
bool HasGeometryPart(IndexType Index) const override
Use to check if certain Indexed object is within the geometry parts of this geometry.
Definition: point_on_geometry.h:151
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: point_on_geometry.h:312
Point Center() const override
Definition: point_on_geometry.h:174
BaseType::PointsArrayType PointsArrayType
Definition: point_on_geometry.h:56
const GeometryPointer pGetGeometryPart(IndexType Index) const override
This function returns the pointer of the background geometry of this point. Accesseable via GeometryT...
Definition: point_on_geometry.h:139
SizeType PolynomialDegree(IndexType LocalDirectionIndex) const override
Return polynomial degree of the background geometry.
Definition: point_on_geometry.h:161
CoordinatesArrayType & GlobalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rLocalCoordinates) const override
Definition: point_on_geometry.h:188
PointOnGeometry(PointOnGeometry const &rOther)
Copy constructor.
Definition: point_on_geometry.h:84
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
size_type size() const
Definition: pointer_vector.h:255
void resize(size_type dim)
Definition: pointer_vector.h:314
A sinlge quadrature point, that can be used for geometries without a predefined integration scheme,...
Definition: quadrature_point_geometry.h:44
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
Short class definition.
Definition: array_1d.h:61
#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
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
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
shared_ptr< C > make_shared(Args &&...args)
Definition: smart_pointers.h:40
def load(f)
Definition: ode_solve.py:307