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.
qs_vms_adjoint_element_data.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: Suneth Warnakulasuriya
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 
21 // Application includes
25 
26 namespace Kratos
27 {
30 
54 template <unsigned int TDim, unsigned int TNumNodes>
56 {
57 private:
60 
61  using IndexType = std::size_t;
62 
64 
65  using Data = typename TResidualsDerivatives::QSVMSResidualData;
66 
67  using ResidualsContributions = typename TResidualsDerivatives::ResidualsContributions;
68 
69  using PressureDerivativeContributions = typename TResidualsDerivatives::template VariableDerivatives<typename QSVMSDerivativeUtilities<TDim>::template PressureDerivative<TNumNodes>>;
70 
71  template<unsigned int TDirectionIndex>
72  using VelocityDerivativeContributions = typename TResidualsDerivatives::template VariableDerivatives<typename QSVMSDerivativeUtilities<TDim>::template VelocityDerivative<TNumNodes, TDirectionIndex>>;
73 
74  template<unsigned int TDirectionIndex>
75  using ShapeDerivatives = typename TResidualsDerivatives::template VariableDerivatives<typename QSVMSDerivativeUtilities<TDim>::template ShapeDerivative<TNumNodes, TDirectionIndex>>;
76 
77  template<unsigned int TDirectionIndex>
78  using AccelerationDerivativeContributions = typename TResidualsDerivatives::template SecondDerivatives<TDirectionIndex>;
79 
80  static constexpr IndexType ElementDataContainerIndex = 0;
81 
82  static constexpr IndexType ResidualColumnOffset = 0;
83 
85 
86 public:
89 
94 
99  std::tuple<
100  Data>,
101  std::tuple<
103  >;
107  using ResidualStateVariableFirstDerivatives = std::conditional_t<
108  TDim == 2,
110  std::tuple<
111  Data>,
112  std::tuple<
113  SubAssembly<VelocityDerivativeContributions<0>, ElementDataContainerIndex, 0, ResidualColumnOffset>,
114  SubAssembly<VelocityDerivativeContributions<1>, ElementDataContainerIndex, 1, ResidualColumnOffset>,
116  >,
118  std::tuple<
119  Data>,
120  std::tuple<
121  SubAssembly<VelocityDerivativeContributions<0>, ElementDataContainerIndex, 0, ResidualColumnOffset>,
122  SubAssembly<VelocityDerivativeContributions<1>, ElementDataContainerIndex, 1, ResidualColumnOffset>,
123  SubAssembly<VelocityDerivativeContributions<2>, ElementDataContainerIndex, 2, ResidualColumnOffset>,
125  >
126  >;
130  using ResidualStateVariableSecondDerivatives = std::conditional_t<
131  TDim == 2,
133  std::tuple<
134  Data>,
135  std::tuple<
136  SubAssembly<AccelerationDerivativeContributions<0>, ElementDataContainerIndex, 0, ResidualColumnOffset>,
137  SubAssembly<AccelerationDerivativeContributions<1>, ElementDataContainerIndex, 1, ResidualColumnOffset>,
138  SubAssembly<ZeroDerivatives<TNumNodes, 3>, ElementDataContainerIndex, 2, ResidualColumnOffset>>
139  >,
141  std::tuple<
142  Data>,
143  std::tuple<
144  SubAssembly<AccelerationDerivativeContributions<0>, ElementDataContainerIndex, 0, ResidualColumnOffset>,
145  SubAssembly<AccelerationDerivativeContributions<1>, ElementDataContainerIndex, 1, ResidualColumnOffset>,
146  SubAssembly<AccelerationDerivativeContributions<2>, ElementDataContainerIndex, 2, ResidualColumnOffset>,
147  SubAssembly<ZeroDerivatives<TNumNodes, 4>, ElementDataContainerIndex, 3, ResidualColumnOffset>>
148  >
149  >;
150 
154  using ResidualShapeDerivatives = std::conditional_t<
155  TDim == 2,
157  std::tuple<
158  Data>,
159  std::tuple<
160  SubAssembly<ShapeDerivatives<0>, ElementDataContainerIndex, 0, ResidualColumnOffset>,
161  SubAssembly<ShapeDerivatives<1>, ElementDataContainerIndex, 1, ResidualColumnOffset>>
162  >,
164  std::tuple<
165  Data>,
166  std::tuple<
167  SubAssembly<ShapeDerivatives<0>, ElementDataContainerIndex, 0, ResidualColumnOffset>,
168  SubAssembly<ShapeDerivatives<1>, ElementDataContainerIndex, 1, ResidualColumnOffset>,
169  SubAssembly<ShapeDerivatives<2>, ElementDataContainerIndex, 2, ResidualColumnOffset>>
170  >
171  >;
172 
174 };
175 } // namespace Kratos
This is traits clas sto hold combined data containers and calculation containers.
Definition: fluid_adjoint_derivatives.h:234
Traits class to hold QSVMS adjoint element data.
Definition: qs_vms_adjoint_element_data.h:56
std::conditional_t< TDim==2, CalculationContainerTraits< std::tuple< Data >, std::tuple< SubAssembly< AccelerationDerivativeContributions< 0 >, ElementDataContainerIndex, 0, ResidualColumnOffset >, SubAssembly< AccelerationDerivativeContributions< 1 >, ElementDataContainerIndex, 1, ResidualColumnOffset >, SubAssembly< ZeroDerivatives< TNumNodes, 3 >, ElementDataContainerIndex, 2, ResidualColumnOffset > > >, CalculationContainerTraits< std::tuple< Data >, std::tuple< SubAssembly< AccelerationDerivativeContributions< 0 >, ElementDataContainerIndex, 0, ResidualColumnOffset >, SubAssembly< AccelerationDerivativeContributions< 1 >, ElementDataContainerIndex, 1, ResidualColumnOffset >, SubAssembly< AccelerationDerivativeContributions< 2 >, ElementDataContainerIndex, 2, ResidualColumnOffset >, SubAssembly< ZeroDerivatives< TNumNodes, 4 >, ElementDataContainerIndex, 3, ResidualColumnOffset > > > > ResidualStateVariableSecondDerivatives
This holds the traits for the analytical second derivative computations.
Definition: qs_vms_adjoint_element_data.h:149
std::conditional_t< TDim==2, CalculationContainerTraits< std::tuple< Data >, std::tuple< SubAssembly< VelocityDerivativeContributions< 0 >, ElementDataContainerIndex, 0, ResidualColumnOffset >, SubAssembly< VelocityDerivativeContributions< 1 >, ElementDataContainerIndex, 1, ResidualColumnOffset >, SubAssembly< PressureDerivativeContributions, ElementDataContainerIndex, 2, ResidualColumnOffset > > >, CalculationContainerTraits< std::tuple< Data >, std::tuple< SubAssembly< VelocityDerivativeContributions< 0 >, ElementDataContainerIndex, 0, ResidualColumnOffset >, SubAssembly< VelocityDerivativeContributions< 1 >, ElementDataContainerIndex, 1, ResidualColumnOffset >, SubAssembly< VelocityDerivativeContributions< 2 >, ElementDataContainerIndex, 2, ResidualColumnOffset >, SubAssembly< PressureDerivativeContributions, ElementDataContainerIndex, 3, ResidualColumnOffset > > > > ResidualStateVariableFirstDerivatives
This holds the container traits for analytical first derivative computations.
Definition: qs_vms_adjoint_element_data.h:126
std::conditional_t< TDim==2, CalculationContainerTraits< std::tuple< Data >, std::tuple< SubAssembly< ShapeDerivatives< 0 >, ElementDataContainerIndex, 0, ResidualColumnOffset >, SubAssembly< ShapeDerivatives< 1 >, ElementDataContainerIndex, 1, ResidualColumnOffset > > >, CalculationContainerTraits< std::tuple< Data >, std::tuple< SubAssembly< ShapeDerivatives< 0 >, ElementDataContainerIndex, 0, ResidualColumnOffset >, SubAssembly< ShapeDerivatives< 1 >, ElementDataContainerIndex, 1, ResidualColumnOffset >, SubAssembly< ShapeDerivatives< 2 >, ElementDataContainerIndex, 2, ResidualColumnOffset > > > > ResidualShapeDerivatives
This holds the traits for the analytical shape derivative computations.
Definition: qs_vms_adjoint_element_data.h:171
Definition: qs_vms_residual_derivatives.h:483
Computes residual contributions.
Definition: qs_vms_residual_derivatives.h:117
Computes the QSVMS residual derivatives.
Definition: qs_vms_residual_derivatives.h:50
Assembles sub-vectors to element vectors and matrices.
Definition: fluid_adjoint_derivatives.h:83
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21