KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
quadrature_point_partitioned_geometry.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Tobias Teschemacher
11 //
12 
13 #if !defined(KRATOS_QUADRATURE_POINT_PARTITIONED_GEOMETRY_H_INCLUDED )
14 #define KRATOS_QUADRATURE_POINT_PARTITIONED_GEOMETRY_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "geometries/geometry.h"
24 
25 
26 namespace Kratos
27 {
39 template<class TPointType,
40  int TWorkingSpaceDimension,
41  int TLocalSpaceDimension = TWorkingSpaceDimension,
42  int TDimension = TLocalSpaceDimension>
44  : public QuadraturePointGeometry<TPointType, TWorkingSpaceDimension, TLocalSpaceDimension, TDimension>
45 {
46 public:
47 
50 
53 
55  typedef typename GeometryType::SizeType SizeType;
56 
59 
62 
64 
66 
70 
73  using BaseType::Jacobian;
74 
78 
81  const PointsArrayType& ThisPoints,
82  GeometryShapeFunctionContainerType& ThisGeometryShapeFunctionContainer)
83  : BaseType(ThisPoints, ThisGeometryShapeFunctionContainer)
84  {
85  }
86 
89  const PointsArrayType& ThisPoints,
90  GeometryShapeFunctionContainerType& ThisGeometryShapeFunctionContainer,
91  GeometryType* pGeometryParent)
92  : BaseType(ThisPoints, ThisGeometryShapeFunctionContainer, pGeometryParent)
93  {
94  }
95 
98 
101  QuadraturePointPartitionedGeometry const& rOther )
102  : BaseType( rOther )
103  {
104  }
105 
109 
112  const QuadraturePointPartitionedGeometry& rOther )
113  {
114  BaseType::operator=( rOther );
115 
116  return *this;
117  }
118 
119  Matrix& Jacobian(Matrix& rResult, IndexType IntegrationPointIndex, GeometryData::IntegrationMethod ThisMethod) const override
120  {
121  const SizeType working_space_dimension = this->WorkingSpaceDimension();
122  const SizeType local_space_dimension = this->LocalSpaceDimension();
123  if (rResult.size1() != working_space_dimension || rResult.size2() != local_space_dimension)
124  rResult.resize(working_space_dimension, local_space_dimension, false);
125 
126  const Matrix& r_shape_functions_gradient_in_integration_point = ShapeFunctionsLocalGradients(ThisMethod)[IntegrationPointIndex];
127  const Matrix& r_N = ShapeFunctionsValues();
128 
129  rResult.clear();
130  const SizeType points_number = this->PointsNumber();
131  IndexType active_point_index = 0;
132  for (IndexType i = 0; i < points_number; ++i) {
133  if (r_N(IntegrationPointIndex,i) >= 0.0) { // only use active nodes
134  const array_1d<double, 3>& r_coordinates = (*this)[i].Coordinates();
135  for (IndexType k = 0; k < working_space_dimension; ++k) {
136  const double value = r_coordinates[k];
137  for (IndexType m = 0; m < local_space_dimension; ++m)
138  rResult(k, m) += value * r_shape_functions_gradient_in_integration_point(active_point_index, m);
139  }
140  active_point_index += 1; // increment active node counter
141  }
142  }
143  return rResult;
144  }
145 
146 
147 
148 protected:
149 
152 
155  : BaseType()
156  {
157  }
158 
160 
161 private:
164 
165  friend class Serializer;
166 
167  void save( Serializer& rSerializer ) const override
168  {
170  }
171 
172  void load( Serializer& rSerializer ) override
173  {
175  }
176 
178 }; // Class Geometry
179 
182 
184 template<class TPointType,
185  int TWorkingSpaceDimension,
186  int TLocalSpaceDimension,
187  int TDimension>
188 inline std::istream& operator >> (
189  std::istream& rIStream,
191 
193 template<class TPointType,
194  int TWorkingSpaceDimension,
195  int TLocalSpaceDimension,
196  int TDimension>
197 inline std::ostream& operator << (
198  std::ostream& rOStream,
200 {
201  rThis.PrintInfo( rOStream );
202  rOStream << std::endl;
203  rThis.PrintData( rOStream );
204 
205  return rOStream;
206 }
207 
209 
210 } // namespace Kratos.
211 
212 #endif // KRATOS_QUADRATURE_POINT_PARTITIONED_GEOMETRY_H_INCLUDED defined
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
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
std::array< Matrix, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> ShapeFunctionsValuesContainerType
Definition: geometry.h:172
std::array< IntegrationPointsArrayType, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: geometry.h:167
SizeType WorkingSpaceDimension() const
Definition: geometry.h:1287
GeometryData::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: geometry.h:177
Definition: geometry_shape_function_container.h:60
Short class definition.
Definition: integration_point.h:52
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
void clear()
Definition: amatrix_interface.h:284
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sinlge quadrature point, that can be used for geometries without a predefined integration scheme,...
Definition: quadrature_point_geometry.h:44
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: quadrature_point_geometry.h:546
const Matrix & ShapeFunctionsValues() const
Definition: geometry.h:3393
QuadraturePointGeometry & operator=(const QuadraturePointGeometry &rOther)
Assignment operator.
Definition: quadrature_point_geometry.h:220
const ShapeFunctionsGradientsType & ShapeFunctionsLocalGradients() const
Definition: geometry.h:3539
JacobiansType & Jacobian(JacobiansType &rResult) const
using base class functions
Definition: geometry.h:2901
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: quadrature_point_geometry.h:552
Definition: quadrature_point_partitioned_geometry.h:45
KRATOS_CLASS_POINTER_DEFINITION(QuadraturePointPartitionedGeometry)
Pointer definition of QuadraturePointGeometry.
virtual Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: quadrature_point_geometry.h:509
GeometryType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: quadrature_point_partitioned_geometry.h:61
GeometryType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: quadrature_point_partitioned_geometry.h:69
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: quadrature_point_partitioned_geometry.h:63
QuadraturePointPartitionedGeometry(const PointsArrayType &ThisPoints, GeometryShapeFunctionContainerType &ThisGeometryShapeFunctionContainer)
Constructor with points and geometry shape function container.
Definition: quadrature_point_partitioned_geometry.h:80
GeometryType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: quadrature_point_partitioned_geometry.h:67
QuadraturePointPartitionedGeometry & operator=(const QuadraturePointPartitionedGeometry &rOther)
Assignment operator.
Definition: quadrature_point_partitioned_geometry.h:111
GeometryType::IntegrationPointType IntegrationPointType
Definition: quadrature_point_partitioned_geometry.h:60
GeometryType::PointsArrayType PointsArrayType
Definition: quadrature_point_partitioned_geometry.h:57
QuadraturePointGeometry< TPointType, TWorkingSpaceDimension, TLocalSpaceDimension, TDimension > BaseType
Definition: quadrature_point_partitioned_geometry.h:51
Matrix & Jacobian(Matrix &rResult, IndexType IntegrationPointIndex, GeometryData::IntegrationMethod ThisMethod) const override
Definition: quadrature_point_partitioned_geometry.h:119
Geometry< TPointType > GeometryType
Definition: quadrature_point_partitioned_geometry.h:52
QuadraturePointPartitionedGeometry(const PointsArrayType &ThisPoints, GeometryShapeFunctionContainerType &ThisGeometryShapeFunctionContainer, GeometryType *pGeometryParent)
Constructor with points, geometry shape function container, parent.
Definition: quadrature_point_partitioned_geometry.h:88
QuadraturePointPartitionedGeometry(QuadraturePointPartitionedGeometry const &rOther)
Copy constructor.
Definition: quadrature_point_partitioned_geometry.h:100
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: quadrature_point_geometry.h:497
~QuadraturePointPartitionedGeometry() override=default
Destructor.
GeometryType::CoordinatesArrayType CoordinatesArrayType
Definition: quadrature_point_partitioned_geometry.h:58
GeometryType::IndexType IndexType
Definition: quadrature_point_partitioned_geometry.h:54
GeometryType::SizeType SizeType
Definition: quadrature_point_partitioned_geometry.h:55
GeometryType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: quadrature_point_partitioned_geometry.h:68
GeometryShapeFunctionContainer< GeometryData::IntegrationMethod > GeometryShapeFunctionContainerType
Definition: quadrature_point_partitioned_geometry.h:65
QuadraturePointPartitionedGeometry()
Standard Constructor.
Definition: quadrature_point_partitioned_geometry.h:154
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
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
def load(f)
Definition: ode_solve.py:307
int k
Definition: quadrature.py:595
int m
Definition: run_marine_rain_substepping.py:8
integer i
Definition: TensorModule.f:17