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.
helmholtz_solid_data_container.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // license: OptimizationApplication/license.txt
9 //
10 // Main authors: Reza Najian Asl
11 // Suneth Warnakulasuriya
12 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "geometries/geometry.h"
22 #include "includes/node.h"
23 #include "includes/element.h"
24 #include "includes/process_info.h"
25 
26 // Application includes
30 
31 namespace Kratos {
32 
33 template <unsigned int TDim, unsigned int TNumNodes, unsigned int TDataDimension>
35 {
36 public:
39 
40  using IndexType = std::size_t;
41 
43 
44  static constexpr IndexType NumberOfNodes = TNumNodes;
45 
46  static constexpr IndexType NumberOfVariables = (TDataDimension == 1) ? 1 : TDim;
47 
49 
51 
55 
57  {
58  public:
61 
63  const Element& rElement,
64  const GeometryData::IntegrationMethod& rIntegrationMethod,
65  const ProcessInfo& rProcessInfo)
66  : mrGeometry(rElement.GetGeometry()),
67  mrIntegrationMethod(rIntegrationMethod)
68  {
69  Vector detJ;
70  mrGeometry.ShapeFunctionsIntegrationPointsGradients(mdNdXs, detJ, mrIntegrationMethod);
71  mHelmholtzRadius = rProcessInfo[HELMHOLTZ_RADIUS];
72  }
73 
75 
76  private:
79 
80  const GeometryType& mrGeometry;
81 
82  const GeometryData::IntegrationMethod& mrIntegrationMethod;
83 
85 
86  double mHelmholtzRadius;
87 
91 
93 
95  };
96 
100 
102  {
103  }
104 
106  Matrix& rStiffnessMatrix,
107  const double W,
109  const ConstantDataContainer& rConstantData) const
110  {
111  const Matrix& rdNdX = rConstantData.mdNdXs[IntegrationPoint];
112  const BoundedMatrix<double, NumberOfNodes, NumberOfNodes>& A_dirc = W * rConstantData.mHelmholtzRadius * rConstantData.mHelmholtzRadius * prod(rdNdX, trans(rdNdX));
113 
114  for (IndexType i = 0; i < NumberOfNodes; ++i) {
115  const IndexType index_i = i * NumberOfVariables;
116  for (IndexType k = 0; k < NumberOfNodes; ++k) {
117  const IndexType index_k = k * NumberOfVariables;
118  for (IndexType j = 0; j < NumberOfVariables; ++j) {
119  rStiffnessMatrix(index_i + j, index_k + j) += A_dirc(i, k);
120  }
121  }
122  }
123  }
124 
126 };
127 
128 } // namespace Kratos
Base class for all Elements.
Definition: element.h:60
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
void ShapeFunctionsIntegrationPointsGradients(ShapeFunctionsGradientsType &rResult) const
Definition: geometry.h:3708
Definition: helmholtz_solid_data_container.h:57
ConstantDataContainer(const Element &rElement, const GeometryData::IntegrationMethod &rIntegrationMethod, const ProcessInfo &rProcessInfo)
Definition: helmholtz_solid_data_container.h:62
Definition: helmholtz_solid_data_container.h:35
std::size_t IndexType
Definition: helmholtz_solid_data_container.h:40
static constexpr auto SourceVariablesList
Definition: helmholtz_solid_data_container.h:50
static constexpr IndexType NumberOfNodes
Definition: helmholtz_solid_data_container.h:44
static constexpr IndexType NumberOfVariables
Definition: helmholtz_solid_data_container.h:46
static constexpr auto TargetVariablesList
Definition: helmholtz_solid_data_container.h:48
void AddStiffnessGaussPointContributions(Matrix &rStiffnessMatrix, const double W, const IndexType IntegrationPoint, const ConstantDataContainer &rConstantData) const
Definition: helmholtz_solid_data_container.h:105
HelmholtzSolidDataContainer(const Geometry< Node > &rGeometry)
Definition: helmholtz_solid_data_container.h:101
Short class definition.
Definition: integration_point.h:52
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
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
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17
Definition: helmholtz_variable_data.h:29