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.
adjoint_nodal_displacement_response_function.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Martin Fusseder, https://github.com/MFusseder
10 //
11 
12 #pragma once
13 
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
21 
22 
23 namespace Kratos
24 {
25 
28 
32 
36 
40 
44 
50 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) AdjointNodalDisplacementResponseFunction : public AdjointStructuralResponseFunction
51 {
52 public:
55 
57  typedef Node::Pointer PointTypePointer;
59 
64 
68 
70  AdjointNodalDisplacementResponseFunction(ModelPart& rModelPart, Parameters ResponseSettings);
71 
74 
78 
82 
84 
85  void CalculateGradient(const Element& rAdjointElement,
86  const Matrix& rResidualGradient,
87  Vector& rResponseGradient,
88  const ProcessInfo& rProcessInfo) override;
89 
90  void CalculateFirstDerivativesGradient(const Element& rAdjointElement,
91  const Matrix& rResidualGradient,
92  Vector& rResponseGradient,
93  const ProcessInfo& rProcessInfo) override;
94 
95  void CalculateFirstDerivativesGradient(const Condition& rAdjointCondition,
96  const Matrix& rResidualGradient,
97  Vector& rResponseGradient,
98  const ProcessInfo& rProcessInfo) override;
99 
100  void CalculateSecondDerivativesGradient(const Element& rAdjointElement,
101  const Matrix& rResidualGradient,
102  Vector& rResponseGradient,
103  const ProcessInfo& rProcessInfo) override;
104 
105  void CalculateSecondDerivativesGradient(const Condition& rAdjointCondition,
106  const Matrix& rResidualGradient,
107  Vector& rResponseGradient,
108  const ProcessInfo& rProcessInfo) override;
109 
110  void CalculatePartialSensitivity(Element& rAdjointElement,
111  const Variable<double>& rVariable,
112  const Matrix& rSensitivityMatrix,
113  Vector& rSensitivityGradient,
114  const ProcessInfo& rProcessInfo) override;
115 
116  void CalculatePartialSensitivity(Condition& rAdjointCondition,
117  const Variable<double>& rVariable,
118  const Matrix& rSensitivityMatrix,
119  Vector& rSensitivityGradient,
120  const ProcessInfo& rProcessInfo) override;
121 
122  void CalculatePartialSensitivity(Element& rAdjointElement,
123  const Variable<array_1d<double, 3>>& rVariable,
124  const Matrix& rSensitivityMatrix,
125  Vector& rSensitivityGradient,
126  const ProcessInfo& rProcessInfo) override;
127 
128  void CalculatePartialSensitivity(Condition& rAdjointCondition,
129  const Variable<array_1d<double, 3>>& rVariable,
130  const Matrix& rSensitivityMatrix,
131  Vector& rSensitivityGradient,
132  const ProcessInfo& rProcessInfo) override;
133 
134 
135  double CalculateValue(ModelPart& rModelPart) override;
136 
140 
144 
148 
152 
154 
155 protected:
158 
162 
166 
170 
174 
178 
182 
184 
185 private:
186 
189 
193 
194  std::string mTracedDofLabel;
195  std::string mResponsePartName;
196  array_1d<double,3> mResponseDirection;
197  std::unordered_map<IndexType, std::vector<IndexType>> mElementNodeMap;
198 
202 
206 
207  void ComputeNeighboringElementNodeMap();
208 
212 
216 
220 
222 
223 }; // Class AdjointNodalDisplacementResponseFunction
224 
226 
229 
233 
235 
236 } // namespace Kratos.
AdjointNodalDisplacementResponseFunction.
Definition: adjoint_nodal_displacement_response_function.h:51
Node::Pointer PointTypePointer
Definition: adjoint_nodal_displacement_response_function.h:57
KRATOS_CLASS_POINTER_DEFINITION(AdjointNodalDisplacementResponseFunction)
Variable< array_1d< double, 3 > > ArrayVariableType
Definition: adjoint_nodal_displacement_response_function.h:58
Element::DofsVectorType DofsVectorType
Definition: adjoint_nodal_displacement_response_function.h:56
AdjointStructuralResponseFunction.
Definition: adjoint_structural_response_function.h:39
virtual void CalculateGradient(const Element &rAdjointElement, const Matrix &rResidualGradient, Vector &rResponseGradient, const ProcessInfo &rProcessInfo)
Calculate the local gradient w.r.t. primal solution.
Definition: adjoint_response_function.h:88
Base class for all Conditions.
Definition: condition.h:59
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21