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.
max_overhang_response_utils.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 author: Reza Najian Asl
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <unordered_map>
17 #include <variant>
18 #include <vector>
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "includes/model_part.h"
23 
24 // Application includes
25 
26 namespace Kratos
27 {
28 
31 
32 class KRATOS_API(OPTIMIZATION_APPLICATION) MaxOverhangAngleResponseUtils
33 {
34 public:
37 
38  using IndexType = std::size_t;
39 
41 
43 
44  using SensitivityFieldVariableTypes = std::variant<const Variable<double>*, const Variable<array_3d>*>;
45 
46  using SensitivityVariableModelPartsListMap = std::unordered_map<SensitivityFieldVariableTypes, std::vector<ModelPart*>>;
47 
51 
52  static double CalculateValue(const std::vector<ModelPart*>& rModelParts,
53  const Parameters ResponseSettings);
54 
55  static void CalculateSensitivity(
56  const std::vector<ModelPart*>& rEvaluatedModelParts,
57  const SensitivityVariableModelPartsListMap& rSensitivityVariableModelPartInfo,
58  const Parameters ResponseSettings);
59 
61 private:
64 
65  static double CalculateConditionValue(const Condition& rCondition, const Parameters ResponseSettings);
66 
67  static void CalculateConditionFiniteDifferenceShapeSensitivity(
68  Condition& rCondition,
69  Condition::Pointer& pThreadLocalCondition,
70  ModelPart& rModelPart,
71  std::vector<std::string>& rModelPartNames,
72  const Parameters ResponseSettings,
73  const IndexType MaxNodeId,
74  const Variable<array_3d>& rOutputSensitivityVariable);
75 
76  static void CalculateFiniteDifferenceShapeSensitivity(
77  ModelPart& rModelPart,
78  const Parameters ResponseSettings,
79  const Variable<array_3d>& rOutputSensitivityVariable);
80 
82 };
83 
85 }
Base class for all Conditions.
Definition: condition.h:59
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
Geometry base class.
Definition: geometry.h:71
Definition: max_overhang_response_utils.h:33
std::unordered_map< SensitivityFieldVariableTypes, std::vector< ModelPart * > > SensitivityVariableModelPartsListMap
Definition: max_overhang_response_utils.h:46
std::variant< const Variable< double > *, const Variable< array_3d > * > SensitivityFieldVariableTypes
Definition: max_overhang_response_utils.h:44
std::size_t IndexType
Definition: max_overhang_response_utils.h:38
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
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