13 #if !defined(KRATOS_SURFACE_IN_NURBS_VOLUME_INCLUDE_H )
14 #define KRATOS_SURFACE_IN_NURBS_VOLUME_INCLUDE_H
24 template <
int TWorkingSpaceDimension,
class TVolumeContainerPo
intType>
31 typedef typename TVolumeContainerPointType::value_type
NodeType;
68 , mpNurbsVolume(pVolume)
81 , mpNurbsVolume(rOther.mpNurbsVolume)
82 , mpSurface(rOther.mpSurface)
87 template<
class TOtherVolumeContainerPo
intType>
90 , mpNurbsVolume(rOther.mpNurbsVolume)
91 , mpSurface(rOther.mpSurface)
106 mpNurbsVolume = rOther.mpNurbsVolume;
107 mpSurface = rOther.mpSurface;
112 template<
class TOtherVolumeContainerPo
intType>
117 mpNurbsVolume = rOther.mpNurbsVolume;
118 mpSurface = rOther.mpSurface;
127 TVolumeContainerPointType
const& ThisPoints)
const override
129 KRATOS_ERROR <<
"SurfaceInNurbsVolumeGeometry cannot be created with 'PointsArrayType const& ThisPoints'. "
130 <<
"'Create' is not allowed as it would not contain the required pointers to the surface and the nurbs volume."
146 const auto& const_this = *
this;
147 return std::const_pointer_cast<GeometryType>(
148 const_this.pGetGeometryPart(
Index));
160 return mpNurbsVolume;
162 KRATOS_ERROR <<
"Index " <<
Index <<
" not existing in SurfaceInNurbsVolume with ID: "
163 << this->
Id() << std::endl;
200 Point local_center = mpSurface->Center();
202 mpNurbsVolume->GlobalCoordinates(global_center, local_center);
204 return global_center;
215 for (
IndexType i = 0;
i < integration_points.size(); ++
i) {
217 area += integration_points[
i].Weight() * determinant_jacobian;
230 std::vector<CoordinatesArrayType> global_space_derivatives(3);
235 column(global_tangents,0) = global_space_derivatives[1];
236 column(global_tangents,1) = global_space_derivatives[2];
248 return mpSurface->GetDefaultIntegrationInfo();
263 const auto surface_method = mpSurface->GetDefaultIntegrationMethod();
264 rIntegrationPoints = mpSurface->IntegrationPoints(surface_method);
280 IndexType NumberOfShapeFunctionDerivatives,
287 mpNurbsVolume->PolynomialDegreeU(), mpNurbsVolume->PolynomialDegreeV(), mpNurbsVolume->PolynomialDegreeW(),
288 NumberOfShapeFunctionDerivatives);
296 for (
IndexType i = 0;
i < NumberOfShapeFunctionDerivatives - 1; ++
i) {
297 const IndexType num_derivatives = (2 +
i) * (3 +
i) / 2;
298 shape_function_derivatives[
i].
resize(num_nonzero_cps, num_derivatives);
302 const SizeType number_of_points = rIntegrationPoints.size();
305 if (rResultGeometries.
size() != rIntegrationPoints.size() ){
306 rResultGeometries.
resize(rIntegrationPoints.size());
309 for (
IndexType point_index = 0; point_index < number_of_points; ++point_index)
313 mpSurface->GlobalCoordinates(global_coordinates, rIntegrationPoints[point_index]);
316 mpNurbsVolume->KnotsU(), mpNurbsVolume->KnotsV(), mpNurbsVolume->KnotsW(),
317 global_coordinates[0], global_coordinates[1], global_coordinates[2]);
322 mpNurbsVolume->NumberOfControlPointsU(), mpNurbsVolume->NumberOfControlPointsV(), mpNurbsVolume->NumberOfControlPointsW());
324 nonzero_control_points(
j) = mpNurbsVolume->pGetPoint(cp_indices[
j]);
329 N(0,
j) = shape_function_container(
j, 0);
333 if (NumberOfShapeFunctionDerivatives > 0) {
335 for (
IndexType n = 0;
n < NumberOfShapeFunctionDerivatives - 1; ++
n) {
336 const IndexType num_derivatives = (2 +
n) * (3 +
n) / 2;
339 shape_function_derivatives[
n](
j,
k) = shape_function_container(
j, shape_derivative_index +
k);
342 shape_derivative_index += num_derivatives;
347 default_method, rIntegrationPoints[point_index],
348 N, shape_function_derivatives);
351 mpSurface->Jacobian(jacobian_surface, rIntegrationPoints[point_index]);
354 data_container, nonzero_control_points,
355 jacobian_surface,
this);
379 return mpNurbsVolume->GlobalCoordinates(rResult, result_local);
391 std::vector<CoordinatesArrayType>& rGlobalSpaceDerivatives,
393 const SizeType DerivativeOrder)
const override
396 KRATOS_ERROR_IF( DerivativeOrder > 1 ) <<
"SurfaceInNurbsVolume :: Global Space Derivatives are not yet "
397 <<
"implemented for derivative orders > 1." << std::endl;
400 if (rGlobalSpaceDerivatives.size() != 3) {
401 rGlobalSpaceDerivatives.resize(3);
406 mpSurface->GlobalCoordinates(global_coordinates, rCoordinates);
409 std::vector<CoordinatesArrayType> volume_derivatives(1 + DerivativeOrder*3);
410 mpNurbsVolume->GlobalSpaceDerivatives(volume_derivatives, global_coordinates, DerivativeOrder);
412 rGlobalSpaceDerivatives[0] = global_coordinates;
415 column(volume_jacobian,0) = volume_derivatives[1];
416 column(volume_jacobian,1) = volume_derivatives[2];
417 column(volume_jacobian,2) = volume_derivatives[3];
420 mpSurface->Jacobian(jacobian_surface, rCoordinates);
423 rGlobalSpaceDerivatives[1] =
column(global_tangents,0);
424 rGlobalSpaceDerivatives[2] =
column(global_tangents,1);
446 std::string
Info()
const override
448 return "2 dimensional surface in 3D nurbs volume.";
454 rOStream <<
"2 dimensional surface in 3D nurbs volume.";
484 void save(
Serializer& rSerializer)
const override
487 rSerializer.
save(
"pNurbsVolume", mpNurbsVolume);
488 rSerializer.
save(
"pSurface", mpSurface);
494 rSerializer.
load(
"pNurbsVolume", mpNurbsVolume);
495 rSerializer.
load(
"pSurface", mpSurface);
502 template<
int TWorkingSpaceDimension,
class TVolumeContainerPo
intType>
503 const GeometryData SurfaceInNurbsVolumeGeometry<TWorkingSpaceDimension, TVolumeContainerPointType>::msGeometryData(
508 template<
int TWorkingSpaceDimension,
class TVolumeContainerPo
intType>
static GeometryPointerType CreateQuadraturePointSurfaceInVolume(GeometryShapeFunctionContainer< GeometryData::IntegrationMethod > &rShapeFunctionContainer, PointsArrayType rPoints, Matrix LocalTangentMatrix, GeometryType *pGeometryParent)
Definition: quadrature_points_utility.h:133
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
@ Kratos_Surface_In_Nurbs_Volume
KratosGeometryFamily
Definition: geometry_data.h:91
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
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
const TPointType::Pointer pGetPoint(const int Index) const
Definition: geometry.h:1790
std::size_t IndexType
Definition: geometry.h:137
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
virtual void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo)
Definition: geometry.h:2331
static constexpr IndexType BACKGROUND_GEOMETRY_INDEX
Definition: geometry.h:220
IntegrationMethod GetDefaultIntegrationMethod() const
Definition: geometry.h:2004
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
Definition: geometry_shape_function_container.h:60
Integration information for the creation of integration points.
Definition: integration_info.h:35
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
static double GeneralizedDet(const TMatrixType &rA)
Calculates the determinant of any matrix (no check performed on matrix size)
Definition: math_utils.h:634
A volume geometry based on a full 3-dimensional BSpline tensor product.
Definition: nurbs_volume_geometry.h:46
Definition: nurbs_volume_shape_functions.h:32
void ComputeBSplineShapeFunctionValues(const Vector &rKnotsU, const Vector &rKnotsV, const Vector &rKnotsW, const double ParameterU, const double ParameterV, const double ParameterW)
Computes the shape function values at the given parameter.
Definition: nurbs_volume_shape_functions.h:383
std::vector< int > ControlPointIndices(SizeType NumberOfControlPointsU, SizeType NumberOfControlPointsV, SizeType NumberOfControlPointsW) const
Definition: nurbs_volume_shape_functions.h:240
SizeType NumberOfNonzeroControlPoints() const
Definition: nurbs_volume_shape_functions.h:201
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
void resize(size_type dim)
Definition: pointer_vector.h:314
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
Definition: surface_in_nurbs_volume_geometry.h:26
GeometryType::Pointer GeometryPointerType
Definition: surface_in_nurbs_volume_geometry.h:34
BaseType::Pointer Create(TVolumeContainerPointType const &ThisPoints) const override
Definition: surface_in_nurbs_volume_geometry.h:126
~SurfaceInNurbsVolumeGeometry() override=default
Destructor.
GeometryPointerType pGetSurface()
Returns the NurbsSurface::Pointer of this brep.
Definition: surface_in_nurbs_volume_geometry.h:182
IntegrationInfo GetDefaultIntegrationInfo() const override
Provides the default integration dependent on the polynomial degree.
Definition: surface_in_nurbs_volume_geometry.h:246
SurfaceInNurbsVolumeGeometry(NurbsVolumePointerType pVolume, GeometryPointerType pSurface)
Constructor.
Definition: surface_in_nurbs_volume_geometry.h:64
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: surface_in_nurbs_volume_geometry.h:452
double DeterminantOfJacobian(const CoordinatesArrayType &rPoint) const override
Definition: surface_in_nurbs_volume_geometry.h:227
void GlobalSpaceDerivatives(std::vector< CoordinatesArrayType > &rGlobalSpaceDerivatives, const CoordinatesArrayType &rCoordinates, const SizeType DerivativeOrder) const override
This method maps from dimension space to working space and computes the number of derivatives at the ...
Definition: surface_in_nurbs_volume_geometry.h:390
TVolumeContainerPointType::value_type NodeType
Definition: surface_in_nurbs_volume_geometry.h:31
BaseType::PointsArrayType PointsArrayType
Definition: surface_in_nurbs_volume_geometry.h:45
bool HasGeometryPart(const IndexType Index) const override
This function is used to check if the index is GeometryType::BACKGROUND_GEOMETRY_INDEX.
Definition: surface_in_nurbs_volume_geometry.h:172
Geometry< NodeType > GeometryType
Definition: surface_in_nurbs_volume_geometry.h:33
const GeometryPointerType pGetGeometryPart(const IndexType Index) const override
This function returns the pointer of the geometry which is corresponding to the BACKGROUND_GEOMETRY_I...
Definition: surface_in_nurbs_volume_geometry.h:157
SurfaceInNurbsVolumeGeometry()
Default constructor.
Definition: surface_in_nurbs_volume_geometry.h:74
NurbsVolumeGeometry< TVolumeContainerPointType > NurbsVolumeType
Definition: surface_in_nurbs_volume_geometry.h:41
Geometry< NodeType > BaseType
Definition: surface_in_nurbs_volume_geometry.h:36
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: surface_in_nurbs_volume_geometry.h:431
double Area() const override
Computes the area of the underlying surface.
Definition: surface_in_nurbs_volume_geometry.h:208
Point Center() const override
Provides the center of the underlying surface.
Definition: surface_in_nurbs_volume_geometry.h:198
BaseType::SizeType SizeType
Definition: surface_in_nurbs_volume_geometry.h:39
SurfaceInNurbsVolumeGeometry(SurfaceInNurbsVolumeGeometry< TWorkingSpaceDimension, TOtherVolumeContainerPointType > const &rOther)
Copy constructor, with different point type.
Definition: surface_in_nurbs_volume_geometry.h:88
static constexpr IndexType VOLUME_INDEX
Definition: surface_in_nurbs_volume_geometry.h:54
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: surface_in_nurbs_volume_geometry.h:436
CoordinatesArrayType & GlobalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rLocalCoordinates) const override
This method maps from dimension space to working space.
Definition: surface_in_nurbs_volume_geometry.h:370
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) const override
Returns the integration points of the surface.
Definition: surface_in_nurbs_volume_geometry.h:259
NurbsVolumeType::Pointer NurbsVolumePointerType
Definition: surface_in_nurbs_volume_geometry.h:42
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: surface_in_nurbs_volume_geometry.h:458
SurfaceInNurbsVolumeGeometry(SurfaceInNurbsVolumeGeometry const &rOther)
Copy constructor.
Definition: surface_in_nurbs_volume_geometry.h:79
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: surface_in_nurbs_volume_geometry.h:47
const GeometryPointerType pGetSurface() const
Returns the const NurbsSurface::Pointer of this brep.
Definition: surface_in_nurbs_volume_geometry.h:188
SurfaceInNurbsVolumeGeometry & operator=(const SurfaceInNurbsVolumeGeometry &rOther)
Assignment operator.
Definition: surface_in_nurbs_volume_geometry.h:103
BaseType::IndexType IndexType
Definition: surface_in_nurbs_volume_geometry.h:38
BaseType::GeometriesArrayType GeometriesArrayType
Definition: surface_in_nurbs_volume_geometry.h:46
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) override
This method creates a list of quadrature point geometries from a list of integration points.
Definition: surface_in_nurbs_volume_geometry.h:278
GeometryPointerType pGetGeometryPart(const IndexType Index) override
This function returns the pointer of the geometry which is corresponding to the BACKGROUND_GEOMETRY_I...
Definition: surface_in_nurbs_volume_geometry.h:144
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: surface_in_nurbs_volume_geometry.h:44
KRATOS_CLASS_POINTER_DEFINITION(SurfaceInNurbsVolumeGeometry)
Counted pointer of SurfaceInNurbsVolumeGeometry.
SurfaceInNurbsVolumeGeometry & operator=(SurfaceInNurbsVolumeGeometry< TWorkingSpaceDimension, TOtherVolumeContainerPointType > const &rOther)
Assignment operator for geometries with different point type.
Definition: surface_in_nurbs_volume_geometry.h:113
std::string Info() const override
Turn back information as a string.
Definition: surface_in_nurbs_volume_geometry.h:446
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
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
AMatrix::MatrixColumn< const TExpressionType > column(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t ColumnIndex)
Definition: amatrix_interface.h:637
def load(f)
Definition: ode_solve.py:307
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17