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_max_stress_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: Baumgaertner Daniel, https://github.com/dbaumgaertner
10 //
11 
12 #pragma once
13 
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
22 
23 namespace Kratos
24 {
25 
28 
32 
36 
40 
44 
51 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) AdjointMaxStressResponseFunction : public AdjointStructuralResponseFunction
52 {
53 public:
56 
61 
65 
67  AdjointMaxStressResponseFunction(ModelPart& rModelPart, Parameters ResponseSettings);
68 
71 
75 
79 
81 
82  void CalculateGradient(const Element& rAdjointElement,
83  const Matrix& rResidualGradient,
84  Vector& rResponseGradient,
85  const ProcessInfo& rProcessInfo) override;
86 
87  void CalculatePartialSensitivity(Element& rAdjointElement,
88  const Variable<double>& rVariable,
89  const Matrix& rSensitivityMatrix,
90  Vector& rSensitivityGradient,
91  const ProcessInfo& rProcessInfo) override;
92 
93  void CalculatePartialSensitivity(Condition& rAdjointCondition,
94  const Variable<double>& rVariable,
95  const Matrix& rSensitivityMatrix,
96  Vector& rSensitivityGradient,
97  const ProcessInfo& rProcessInfo) override;
98 
99  void CalculatePartialSensitivity(Element& rAdjointElement,
100  const Variable<array_1d<double, 3>>& rVariable,
101  const Matrix& rSensitivityMatrix,
102  Vector& rSensitivityGradient,
103  const ProcessInfo& rProcessInfo) override;
104 
105  void CalculatePartialSensitivity(Condition& rAdjointCondition,
106  const Variable<array_1d<double, 3>>& rVariable,
107  const Matrix& rSensitivityMatrix,
108  Vector& rSensitivityGradient,
109  const ProcessInfo& rProcessInfo) override;
110 
111  double CalculateValue(ModelPart& rModelPart) override;
112 
116 
120 
124 
128 
130 
131 protected:
134 
138 
142 
146 
150 
154 
158 
160 
161 private:
164 
168 
169  ModelPart& mrAdjointModelPart;
170  std::string mCriticalPartName;
171  Element::Pointer mpTracedElementInAdjointPart = nullptr;
172  StressTreatment mStressTreatment;
173  TracedStressType mTracedStressType;
174  SizeType mEchoLevel = 0;
175 
176 
180 
184 
185  void CalculateElementContributionToPartialSensitivity(Element& rAdjointElement,
186  const std::string& rVariableName,
187  const Matrix& rSensitivityMatrix,
188  Vector& rSensitivityGradient,
189  const ProcessInfo& rProcessInfo);
190 
191  void ExtractMeanStressDerivative(const Matrix& rStressDerivativesMatrix, Vector& rResponseGradient);
192 
196 
200 
204 
206 
207 }; // Class AdjointMaxStressResponseFunction
208 
210 
213 
217 
219 
220 } // namespace Kratos.
AdjointMaxStressResponseFunction.
Definition: adjoint_max_stress_response_function.h:52
KRATOS_CLASS_POINTER_DEFINITION(AdjointMaxStressResponseFunction)
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
std::size_t SizeType
Definition: adjoint_structural_response_function.h:48
Base class for all Conditions.
Definition: condition.h:59
Base class for all Elements.
Definition: element.h:60
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
StressTreatment
Definition: stress_response_definitions.h:57
TracedStressType
Definition: stress_response_definitions.h:27