16 #if !defined(KRATOS_BREP_FACE_3D_H_INCLUDED )
17 #define KRATOS_BREP_FACE_3D_H_INCLUDED
42 template<
class TContainerPo
intType,
class TContainerPo
intEmbeddedType = TContainerPo
intType>
44 :
public Geometry<typename TContainerPointType::value_type>
54 typedef typename TContainerPointType::value_type
PointType;
84 typename NurbsSurfaceType::Pointer pSurface)
86 , mpNurbsSurface(pSurface)
93 typename NurbsSurfaceType::Pointer pSurface,
97 , mpNurbsSurface(pSurface)
98 , mOuterLoopArray(BrepOuterLoopArray)
99 , mInnerLoopArray(BrepInnerLoopArray)
101 mIsTrimmed = !(mOuterLoopArray.size() == 0 && mInnerLoopArray.size() == 0);
106 typename NurbsSurfaceType::Pointer pSurface,
111 , mpNurbsSurface(pSurface)
112 , mOuterLoopArray(BrepOuterLoopArray)
113 , mInnerLoopArray(BrepInnerLoopArray)
119 :
BaseType(ThisPoints, &msGeometryData)
126 , mpNurbsSurface(rOther.mpNurbsSurface)
127 , mOuterLoopArray(rOther.mOuterLoopArray)
128 , mInnerLoopArray(rOther.mInnerLoopArray)
129 , mEmbeddedEdgesArray(rOther.mEmbeddedEdgesArray)
130 , mIsTrimmed(rOther.mIsTrimmed)
135 template<
class TOtherContainerPo
intType,
class TOtherContainerPo
intEmbeddedType>
139 , mpNurbsSurface(rOther.mpNurbsSurface)
140 , mOuterLoopArray(rOther.mOuterLoopArray)
141 , mInnerLoopArray(rOther.mInnerLoopArray)
142 , mEmbeddedEdgesArray(rOther.mEmbeddedEdgesArray)
143 , mIsTrimmed(rOther.mIsTrimmed)
158 mpNurbsSurface = rOther.mpNurbsSurface;
159 mOuterLoopArray = rOther.mOuterLoopArray;
160 mInnerLoopArray = rOther.mInnerLoopArray;
161 mEmbeddedEdgesArray = rOther.mEmbeddedEdgesArray;
162 mIsTrimmed = rOther.mIsTrimmed;
167 template<
class TOtherContainerPo
intType,
class TOtherContainerPo
intEmbeddedType>
171 mpNurbsSurface = rOther.mpNurbsSurface;
172 mOuterLoopArray = rOther.mOuterLoopArray;
173 mInnerLoopArray = rOther.mInnerLoopArray;
174 mEmbeddedEdgesArray = rOther.mEmbeddedEdgesArray;
175 mIsTrimmed = rOther.mIsTrimmed;
185 return typename BaseType::Pointer(
new BrepSurface( ThisPoints ) );
201 const auto& const_this = *
this;
202 return std::const_pointer_cast<GeometryType>(
203 const_this.pGetGeometryPart(
Index));
216 return mpNurbsSurface;
222 if (mOuterLoopArray[
i][
j]->
Id() ==
Index)
223 return mOuterLoopArray[
i][
j];
231 if (mInnerLoopArray[
i][
j]->
Id() ==
Index)
232 return mInnerLoopArray[
i][
j];
236 for (
IndexType i = 0;
i < mEmbeddedEdgesArray.size(); ++
i)
238 if (mEmbeddedEdgesArray[
i]->
Id() ==
Index)
239 return mEmbeddedEdgesArray[
i];
243 << this->
Id() << std::endl;
261 if (mOuterLoopArray[
i][
j]->
Id() ==
Index)
270 if (mInnerLoopArray[
i][
j]->
Id() ==
Index)
275 for (
IndexType i = 0;
i < mEmbeddedEdgesArray.size(); ++
i)
277 if (mEmbeddedEdgesArray[
i]->
Id() ==
Index)
287 mEmbeddedEdgesArray = EmbeddedEdges;
292 return mOuterLoopArray;
297 return mInnerLoopArray;
302 return mEmbeddedEdgesArray;
314 if (rVariable == CHARACTERISTIC_GEOMETRY_LENGTH)
316 mpNurbsSurface->Calculate(rVariable, rOutput);
327 return mpNurbsSurface->PolynomialDegree(LocalDirectionIndex);
346 return mpNurbsSurface->PointsNumberInDirection(DirectionIndex);
356 return mpNurbsSurface->Center();
390 const double Tolerance = std::numeric_limits<double>::epsilon()
393 return mpNurbsSurface->ProjectionPointGlobalToLocalSpace(
394 rPointGlobalCoordinates, rProjectedPointLocalCoordinates, Tolerance);
411 mpNurbsSurface->GlobalCoordinates(rResult, rLocalCoordinates);
423 return mpNurbsSurface->GetDefaultIntegrationInfo();
438 mpNurbsSurface->CreateIntegrationPoints(
439 rIntegrationPoints, rIntegrationInfo);
443 std::vector<double> spans_u;
444 std::vector<double> spans_v;
445 mpNurbsSurface->SpansLocalSpace(spans_u, 0);
446 mpNurbsSurface->SpansLocalSpace(spans_v, 1);
450 mOuterLoopArray, mInnerLoopArray,
472 IndexType NumberOfShapeFunctionDerivatives,
476 mpNurbsSurface->CreateQuadraturePointGeometries(
477 rResultGeometries, NumberOfShapeFunctionDerivatives, rIntegrationPoints, rIntegrationInfo);
480 rResultGeometries(
i)->SetGeometryParent(
this);
492 mpNurbsSurface->ShapeFunctionsValues(rResult, rCoordinates);
501 mpNurbsSurface->ShapeFunctionsLocalGradients(rResult, rCoordinates);
525 std::string
Info()
const override
527 return "Brep surface";
533 rOStream <<
"Brep surface";
540 std::cout << std::endl;
541 rOStream <<
" Brep surface " << std::endl;
558 typename NurbsSurfaceType::Pointer mpNurbsSurface;
576 void save(
Serializer& rSerializer )
const override
579 rSerializer.
save(
"NurbsSurface", mpNurbsSurface);
580 rSerializer.
save(
"OuterLoopArray", mOuterLoopArray);
581 rSerializer.
save(
"InnerLoopArray", mInnerLoopArray);
582 rSerializer.
save(
"EmbeddedEdgesArray", mEmbeddedEdgesArray);
583 rSerializer.
save(
"IsTrimmed", mIsTrimmed);
589 rSerializer.
load(
"NurbsSurface", mpNurbsSurface);
590 rSerializer.
load(
"OuterLoopArray", mOuterLoopArray);
591 rSerializer.
load(
"InnerLoopArray", mInnerLoopArray);
592 rSerializer.
load(
"EmbeddedEdgesArray", mEmbeddedEdgesArray);
593 rSerializer.
load(
"IsTrimmed", mIsTrimmed);
608 template<
class TContainerPo
intType,
class TContainerPo
intEmbeddedType = TContainerPo
intType>
inline std::istream&
operator >> (
609 std::istream& rIStream,
613 template<
class TContainerPo
intType,
class TContainerPo
intEmbeddedType = TContainerPo
intType>
inline std::ostream&
operator << (
614 std::ostream& rOStream,
618 rOStream << std::endl;
627 template<
class TContainerPo
intType,
class TContainerPo
intEmbeddedType>
const
628 GeometryData BrepSurface<TContainerPointType, TContainerPointEmbeddedType>::msGeometryData(
633 template<
class TContainerPo
intType,
class TContainerPo
intEmbeddedType>
The BrepCurveOnSurface acts as topology for curves on surfaces.
Definition: brep_curve_on_surface.h:44
The BrepSurface acts as topology for faces. Those can be enclosed by a certain set of brep face curve...
Definition: brep_surface.h:45
BrepSurface(const PointsArrayType &ThisPoints)
Definition: brep_surface.h:118
CoordinatesArrayType & GlobalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rLocalCoordinates) const override
Definition: brep_surface.h:406
BaseType::PointsArrayType PointsArrayType
Definition: brep_surface.h:74
SizeType PolynomialDegree(IndexType LocalDirectionIndex) const override
Return polynomial degree of the nurbs surface.
Definition: brep_surface.h:325
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: brep_surface.h:531
bool IsTrimmed() const
Definition: brep_surface.h:338
DenseVector< typename BrepCurveOnSurfaceType::Pointer > BrepCurveOnSurfaceLoopType
Definition: brep_surface.h:66
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: brep_surface.h:510
NurbsSurfaceGeometry< 3, TContainerPointType > NurbsSurfaceType
Definition: brep_surface.h:62
BaseType::IndexType IndexType
Definition: brep_surface.h:71
BrepSurface(BrepSurface< TOtherContainerPointType, TOtherContainerPointEmbeddedType > const &rOther)
Copy constructor from a geometry with different point type.
Definition: brep_surface.h:136
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: brep_surface.h:515
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) override
Definition: brep_surface.h:470
BrepSurface & operator=(const BrepSurface &rOther)
Assignment operator.
Definition: brep_surface.h:155
BaseType::SizeType SizeType
Definition: brep_surface.h:72
BaseType::Pointer Create(PointsArrayType const &ThisPoints) const override
Definition: brep_surface.h:183
Geometry< typename TContainerPointType::value_type > GeometryType
Definition: brep_surface.h:57
bool HasGeometryPart(const IndexType Index) const override
This function is used to check if this BrepSurface has certain trim or surface object.
Definition: brep_surface.h:252
KRATOS_CLASS_POINTER_DEFINITION(BrepSurface)
BrepSurface & operator=(BrepSurface< TOtherContainerPointType, TOtherContainerPointEmbeddedType > const &rOther)
Assignment operator for geometries with different point type.
Definition: brep_surface.h:168
SizeType PointsNumberInDirection(IndexType DirectionIndex) const override
Returns number of points of NurbsSurface.
Definition: brep_surface.h:344
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: brep_surface.h:488
IntegrationInfo GetDefaultIntegrationInfo() const override
Provides the default integration dependent on the polynomial degree.
Definition: brep_surface.h:421
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: brep_surface.h:537
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: brep_surface.h:497
GeometryPointer pGetGeometryPart(const IndexType Index) override
This function returns the pointer of the geometry which is corresponding to the trim index....
Definition: brep_surface.h:199
const BrepCurveOnSurfaceLoopArrayType & GetInnerLoops() const
Access the nested loop of inner loops.
Definition: brep_surface.h:296
BrepSurface(BrepSurface const &rOther)
Copy constructor.
Definition: brep_surface.h:124
DenseVector< typename BrepCurveOnSurfaceType::Pointer > BrepCurveOnSurfaceArrayType
Definition: brep_surface.h:65
const BrepCurveOnSurfaceLoopArrayType & GetOuterLoops() const
Access the nested loop of outer loops.
Definition: brep_surface.h:291
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) const override
Definition: brep_surface.h:433
BrepSurface(typename NurbsSurfaceType::Pointer pSurface)
Constructor for untrimmed patch.
Definition: brep_surface.h:83
BrepSurface(typename NurbsSurfaceType::Pointer pSurface, BrepCurveOnSurfaceLoopArrayType &BrepOuterLoopArray, BrepCurveOnSurfaceLoopArrayType &BrepInnerLoopArray, bool IsTrimmed)
Constructor for trimmed patch including IsTrimmed.
Definition: brep_surface.h:105
BrepSurface(typename NurbsSurfaceType::Pointer pSurface, BrepCurveOnSurfaceLoopArrayType &BrepOuterLoopArray, BrepCurveOnSurfaceLoopArrayType &BrepInnerLoopArray)
Constructor for trimmed patch.
Definition: brep_surface.h:92
DenseVector< DenseVector< typename BrepCurveOnSurfaceType::Pointer > > BrepCurveOnSurfaceLoopArrayType
Definition: brep_surface.h:67
BaseType::GeometriesArrayType GeometriesArrayType
Definition: brep_surface.h:69
const BrepCurveOnSurfaceArrayType & GetEmbeddedEdges() const
Access the array of embedded edges.
Definition: brep_surface.h:301
Geometry< typename TContainerPointType::value_type > BaseType
Definition: brep_surface.h:56
TContainerPointType::value_type PointType
Definition: brep_surface.h:54
std::string Info() const override
Turn back information as a string.
Definition: brep_surface.h:525
void Calculate(const Variable< array_1d< double, 3 >> &rVariable, array_1d< double, 3 > &rOutput) const override
Calculate with array_1d<double, 3>
Definition: brep_surface.h:310
Point Center() const override
Provides the center of the underlying surface.
Definition: brep_surface.h:354
void AddEmbeddedEdges(BrepCurveOnSurfaceArrayType EmbeddedEdges)
Used to add the embedded edges to the brep surface.
Definition: brep_surface.h:285
~BrepSurface() override=default
Destructor.
GeometryType::Pointer GeometryPointer
Definition: brep_surface.h:58
const GeometryPointer pGetGeometryPart(const IndexType Index) const override
This function returns the pointer of the geometry which is corresponding to the trim index....
Definition: brep_surface.h:213
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: brep_surface.h:76
GeometryData::IntegrationMethod IntegrationMethod
Definition: brep_surface.h:60
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: brep_surface.h:75
int ProjectionPointGlobalToLocalSpace(const CoordinatesArrayType &rPointGlobalCoordinates, CoordinatesArrayType &rProjectedPointLocalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Calls projection of its nurbs surface. Projects a certain point on the geometry, or finds the closest...
Definition: brep_surface.h:387
BrepCurveOnSurface< TContainerPointType, TContainerPointEmbeddedType > BrepCurveOnSurfaceType
Definition: brep_surface.h:63
static void CreateBrepSurfaceTrimmingIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, const DenseVector< DenseVector< typename BrepCurveOnSurface< PointerVector< Node >, PointerVector< Point >>::Pointer >> &rOuterLoops, const DenseVector< DenseVector< typename BrepCurveOnSurface< PointerVector< Node >, PointerVector< Point >>::Pointer >> &rInnerLoops, const std::vector< double > &rSpansU, const std::vector< double > &rSpansV, IntegrationInfo &rIntegrationInfo)
Definition: brep_trimming_utilities.cpp:18
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
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
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
static constexpr IndexType BACKGROUND_GEOMETRY_INDEX
Definition: geometry.h:220
Integration information for the creation of integration points.
Definition: integration_info.h:35
Definition: amatrix_interface.h:41
Definition: nurbs_surface_geometry.h:38
Point class.
Definition: point.h:59
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
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
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
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
def load(f)
Definition: ode_solve.py:307
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17