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.
mass_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 // Suneth Warnakulasuriya
12 //
13 
14 #pragma once
15 
16 // System includes
17 #include <variant>
18 #include <vector>
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "includes/model_part.h"
24 
25 // Application includes
26 
27 namespace Kratos
28 {
29 
32 
33 class KRATOS_API(OPTIMIZATION_APPLICATION) MassResponseUtils
34 {
35 public:
38 
39  using IndexType = std::size_t;
40 
42 
43  using PhysicalFieldVariableTypes = std::variant<const Variable<double>*, const Variable<array_1d<double, 3>>*>;
44 
46 
50 
51  static void Check(const ModelPart& rModelPart);
52 
53  static double CalculateValue(const ModelPart& rModelPart);
54 
55  static void CalculateGradient(
56  const PhysicalFieldVariableTypes& rPhysicalVariable,
57  ModelPart& rGradientRequiredModelPart,
58  ModelPart& rGradientComputedModelPart,
59  std::vector<ContainerExpressionType>& rListOfContainerExpressions);
60 
62 private:
65 
66  static bool HasVariableInProperties(
67  const ModelPart& rModelPart,
68  const Variable<double>& rVariable);
69 
70  static void CalculateMassGeometricalPropertyGradient(
71  ModelPart& rModelPart,
72  const Variable<double>& rGeometricalPropertyGradientVariable,
73  const Variable<double>& rGeometricalCoflictingPropertyGradientVariable,
74  const Variable<double>& rOutputGradientVariable);
75 
76  static void CalculateMassShapeGradient(
77  ModelPart& rModelPart,
78  const Variable<array_1d<double, 3>>& rOutputGradientVariable);
79 
80  static void CalculateMassDensityGradient(
81  ModelPart& rModelPart,
82  const Variable<double>& rOutputGradientVariable);
83 
84  static void CalculateMassThicknessGradient(
85  ModelPart& rModelPart,
86  const Variable<double>& rOutputGradientVariable);
87 
88  static void CalculateMassCrossAreaGradient(
89  ModelPart& rModelPart,
90  const Variable<double>& rOutputGradientVariable);
91 
93 };
94 
96 }
Container variable data holder.
Definition: container_expression.h:80
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
Geometry base class.
Definition: geometry.h:71
Definition: mass_response_utils.h:34
std::variant< const Variable< double > *, const Variable< array_1d< double, 3 > > * > PhysicalFieldVariableTypes
Definition: mass_response_utils.h:43
std::size_t IndexType
Definition: mass_response_utils.h:39
std::variant< ContainerExpression< ModelPart::NodesContainerType >::Pointer, ContainerExpression< ModelPart::ConditionsContainerType >::Pointer, ContainerExpression< ModelPart::ElementsContainerType >::Pointer > ContainerExpressionType
Definition: mass_response_utils.h:45
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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