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.
linear_strain_energy_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) LinearStrainEnergyResponseUtils
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 double CalculateValue(ModelPart& rEvaluatedModelPart);
52 
53  static void CalculateGradient(
54  const PhysicalFieldVariableTypes& rPhysicalVariable,
55  ModelPart& rGradientRequiredModelPart,
56  ModelPart& rGradientComputedModelPart,
57  std::vector<ContainerExpressionType>& rListOfContainerExpressions,
58  const double PerturbationSize);
59 
61 private:
64 
65  template<class TEntityType>
66  static double CalculateEntityStrainEnergy(
67  TEntityType& rEntity,
68  Matrix& rLHS,
69  Vector& rRHS,
70  Vector& rX,
71  const ProcessInfo& rProcessInfo);
72 
73  template<class TEntityType>
74  static void CalculateStrainEnergyEntitySemiAnalyticShapeGradient(
75  TEntityType& rEntity,
76  Vector& rX,
77  Vector& rRefRHS,
78  Vector& rPerturbedRHS,
79  typename TEntityType::Pointer& pThreadLocalEntity,
80  ModelPart& rModelPart,
81  const double Delta,
82  const Variable<array_1d<double, 3>>& rOutputGradientVariable);
83 
84  static void CalculateStrainEnergySemiAnalyticShapeGradient(
85  ModelPart& rModelPart,
86  const double Delta,
87  const Variable<array_1d<double, 3>>& rOutputGradientVariable);
88 
89  static void CalculateStrainEnergyLinearlyDependentPropertyGradient(
90  ModelPart& rModelPart,
91  const Variable<double>& rPrimalVariable,
92  const Variable<double>& rOutputGradientVariable);
93 
94  static void CalculateStrainEnergySemiAnalyticPropertyGradient(
95  ModelPart& rModelPart,
96  const double Delta,
97  const Variable<double>& rPrimalVariable,
98  const Variable<double>& rOutputGradientVariable);
99 
101 };
102 
104 }
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: linear_strain_energy_response_utils.h:34
std::variant< ContainerExpression< ModelPart::NodesContainerType >::Pointer, ContainerExpression< ModelPart::ConditionsContainerType >::Pointer, ContainerExpression< ModelPart::ElementsContainerType >::Pointer > ContainerExpressionType
Definition: linear_strain_energy_response_utils.h:45
std::size_t IndexType
Definition: linear_strain_energy_response_utils.h:39
std::variant< const Variable< double > *, const Variable< array_1d< double, 3 > > * > PhysicalFieldVariableTypes
Definition: linear_strain_energy_response_utils.h:43
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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