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.
modified_shape_functions.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: Ruben Zorrilla
11 //
12 
13 #if !defined(KRATOS_MODIFIED_SHAPE_FUNCTIONS)
14 #define KRATOS_MODIFIED_SHAPE_FUNCTIONS
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/node.h"
22 #include "geometries/point.h"
23 #include "geometries/geometry.h"
26 
27 namespace Kratos
28 {
31 
35 
39 
43 
44 class KRATOS_API(KRATOS_CORE) ModifiedShapeFunctions
45 {
46 public:
47 
50 
53 
54  // General type definitions
56  typedef GeometryType::Pointer GeometryPointerType;
60  typedef std::vector<array_1d<double,3>> AreaNormalsContainerType;
61 
64 
66  typedef std::vector<IntegrationPointType> IntegrationPointsArrayType;
67  typedef std::array<IntegrationPointsArrayType, static_cast<int>(GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType;
68 
72 
74  ModifiedShapeFunctions(const GeometryPointerType pInputGeometry, const Vector& rNodalDistances);
75 
77  virtual ~ModifiedShapeFunctions();
78 
82 
86 
90 
92  virtual std::string Info() const;
93 
95  virtual void PrintInfo(std::ostream& rOStream) const;
96 
98  virtual void PrintData(std::ostream& rOStream) const;
99 
103 
107 
111  virtual const DivideGeometry<Node>::Pointer pGetSplittingUtil() const;
112 
116  const GeometryPointerType GetInputGeometry() const;
117 
121  const Vector& GetNodalDistances() const;
122 
128  double ComputePositiveSideDomainSize() const;
129 
135  double ComputeNegativeSideDomainSize() const;
136 
137  void ComputePositiveSideShapeFunctionsAndWeights(
138  Matrix &rPositiveSideShapeFunctionsValues,
139  Vector &rPositiveSideWeightsValues,
141 
142  void ComputeNegativeSideShapeFunctionsAndWeights(
143  Matrix &rNegativeSideShapeFunctionsValues,
144  Vector &rNegativeSideWeightsValues,
146 
154  void ComputePositiveSideShapeFunctionsAndGradientsValues(
155  Matrix &rPositiveSideShapeFunctionsValues,
156  ShapeFunctionsGradientsType &rPositiveSideShapeFunctionsGradientsValues,
157  Vector &rPositiveSideWeightsValues,
159 
167  void ComputeNegativeSideShapeFunctionsAndGradientsValues(
168  Matrix &rNegativeSideShapeFunctionsValues,
169  ShapeFunctionsGradientsType &rNegativeSideShapeFunctionsGradientsValues,
170  Vector &rNegativeSideWeightsValues,
172 
180  void ComputeInterfacePositiveSideShapeFunctionsAndGradientsValues(
181  Matrix &rInterfacePositiveSideShapeFunctionsValues,
182  ShapeFunctionsGradientsType &rInterfacePositiveSideShapeFunctionsGradientsValues,
183  Vector &rInterfacePositiveSideWeightsValues,
185 
193  void ComputeInterfaceNegativeSideShapeFunctionsAndGradientsValues(
194  Matrix &rInterfaceNegativeSideShapeFunctionsValues,
195  ShapeFunctionsGradientsType &rInterfaceNegativeSideShapeFunctionsGradientsValues,
196  Vector &rInterfaceNegativeSideWeightsValues,
198 
207  void ComputePositiveExteriorFaceShapeFunctionsAndGradientsValues(
208  Matrix &rPositiveExteriorFaceShapeFunctionsValues,
209  ShapeFunctionsGradientsType &rPositiveExteriorFaceShapeFunctionsGradientsValues,
210  Vector &rPositiveExteriorFaceWeightsValues,
211  const unsigned int FaceId,
213 
222  void ComputeNegativeExteriorFaceShapeFunctionsAndGradientsValues(
223  Matrix &rNegativeExteriorFaceShapeFunctionsValues,
224  ShapeFunctionsGradientsType &rNegativeExteriorFaceShapeFunctionsGradientsValues,
225  Vector &rNegativeExteriorFaceWeightsValues,
226  const unsigned int FaceId,
228 
234  void ComputePositiveSideInterfaceAreaNormals(
235  AreaNormalsContainerType& rPositiveSideInterfaceAreaNormal,
237 
243  void ComputeNegativeSideInterfaceAreaNormals(
244  AreaNormalsContainerType& rNegativeSideInterfaceAreaNormal,
246 
253  void ComputePositiveExteriorFaceAreaNormals(
254  AreaNormalsContainerType& rPositiveExteriorFaceAreaNormal,
255  const unsigned int FaceId,
257 
264  void ComputeNegativeExteriorFaceAreaNormals(
265  AreaNormalsContainerType& rNegativeExteriorFaceAreaNormal,
266  const unsigned int FaceId,
268 
274  void ComputeShapeFunctionsOnPositiveEdgeIntersections(Matrix &rPositiveEdgeIntersectionsShapeFunctionsValues);
275 
281  void ComputeShapeFunctionsOnNegativeEdgeIntersections(Matrix &rNegativeEdgeIntersectionsShapeFunctionsValues);
282 
286  bool IsSplit() const;
287 
289 
290 protected:
293 
297 
301 
305 
312  virtual void SetCondensationMatrix(Matrix& rIntPointCondMatrix)
313  {
314  KRATOS_ERROR << "Calling base class \'SetCondensationMatrix\'. Call the derived class one instead." << std::endl;
315  }
316 
323  virtual void SetPositiveSideCondensationMatrix(Matrix& rPosSideCondMatrix)
324  {
325  KRATOS_ERROR << "Calling base class \'SetPositiveSideCondensationMatrix\'. Call the derived class one instead." << std::endl;
326  }
327 
334  virtual void SetNegativeSideCondensationMatrix(Matrix& rNegSideCondMatrix)
335  {
336  KRATOS_ERROR << "Calling base class \'SetNegativeSideCondensationMatrix\'. Call the derived class one instead." << std::endl;
337  }
338 
348  void SetCondensationMatrix(
349  Matrix& rIntPointCondMatrix,
350  const std::vector<int>& rEdgeNodeI,
351  const std::vector<int>& rEdgeNodeJ,
352  const std::vector<int>& rSplitEdges);
353 
363  void ComputeValuesOnOneSide(
364  Matrix &rShapeFunctionsValues,
365  ShapeFunctionsGradientsType &rShapeFunctionsGradientsValues,
366  Vector &rWeightsValues,
367  const std::vector<IndexedPointGeometryPointerType> &rSubdivisionsVector,
368  const Matrix &rPmatrix,
370 
382  void ComputeFaceValuesOnOneSide(
383  Matrix &rInterfaceShapeFunctionsValues,
384  ShapeFunctionsGradientsType &rInterfaceShapeFunctionsGradientsValues,
385  Vector &rInterfaceWeightsValues,
386  const std::vector<IndexedPointGeometryPointerType> &rInterfacesVector,
387  const std::vector<IndexedPointGeometryPointerType> &rParentGeometriesVector,
388  const std::vector<unsigned int> &rInterfacesParentIdsVector,
389  const Matrix &rPmatrix,
391 
398  void ComputeFaceNormalOnOneSide(
399  AreaNormalsContainerType& rInterfaceAreaNormalValues,
400  const std::vector<IndexedPointGeometryPointerType> &rInterfacesVector,
402 
408  void ComputeEdgeIntersectionValuesOnOneSide(
409  const Matrix &rPmatrix,
410  Matrix &rEdgeShapeFunctionValues);
411 
415 
419 
423 
425 
426  private :
429 
433 
434  const GeometryPointerType mpInputGeometry;
435  const Vector mNodalDistances;
436 
440 
444 
448 
455  double ComputeDomainSizeOnOneSide(const std::vector<IndexedPointGeometryPointerType> &rSubdivisionsVector) const;
456 
466  void ComputeValuesOnOneSide(
467  Matrix &rShapeFunctionsValues,
468  Vector &rWeightsValues,
469  const std::vector<IndexedPointGeometryPointerType> &rSubdivisionsVector,
470  const Matrix &rPmatrix,
472 
476 
480 
484 
487 
490  : mpInputGeometry(rOther.mpInputGeometry) , mNodalDistances(rOther.mNodalDistances) {};
491 
493 
494 };// class ModifiedShapeFunctions
495 
496 }
497 #endif /* KRATOS_MODIFIED_SHAPE_FUNCTIONS defined */
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: divide_geometry.h:167
Geometry< IndexedPoint >::Pointer IndexedPointGeometryPointerType
Definition: divide_geometry.h:181
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
Short class definition.
Definition: integration_point.h:52
Definition: amatrix_interface.h:41
Definition: modified_shape_functions.h:45
virtual void SetPositiveSideCondensationMatrix(Matrix &rPosSideCondMatrix)
Set the Positive Side Condensation Matrix object This function sets the positive side condensation ma...
Definition: modified_shape_functions.h:323
Geometry< Node > GeometryType
Definition: modified_shape_functions.h:55
virtual void SetNegativeSideCondensationMatrix(Matrix &rNegSideCondMatrix)
Set the Negative Side Condensation Matrix object This function sets the negative side condensation ma...
Definition: modified_shape_functions.h:334
GeometryType::CoordinatesArrayType CoordinatesArrayType
Definition: modified_shape_functions.h:57
std::vector< array_1d< double, 3 > > AreaNormalsContainerType
Definition: modified_shape_functions.h:60
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: modified_shape_functions.h:66
KRATOS_CLASS_POINTER_DEFINITION(ModifiedShapeFunctions)
Pointer definition of ModifiedShapeFunctions.
GeometryType::Pointer GeometryPointerType
Definition: modified_shape_functions.h:56
DivideGeometry< Node >::IndexedPointGeometryType IndexedPointGeometryType
Definition: modified_shape_functions.h:62
DivideGeometry< Node >::IndexedPointGeometryPointerType IndexedPointGeometryPointerType
Definition: modified_shape_functions.h:63
std::array< IntegrationPointsArrayType, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: modified_shape_functions.h:67
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: modified_shape_functions.h:59
IntegrationPoint< 3 > IntegrationPointType
Definition: modified_shape_functions.h:65
virtual void SetCondensationMatrix(Matrix &rIntPointCondMatrix)
Definition: modified_shape_functions.h:312
GeometryData::IntegrationMethod IntegrationMethodType
Definition: modified_shape_functions.h:58
Short class definition.
Definition: array_1d.h:61
#define KRATOS_ERROR
Definition: exception.h:161
GeometryType::Pointer GeometryPointerType
Definition: mapping_intersection_utilities.h:38
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21