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.
optimization_application_variables.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 
18 // External includes
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "containers/variable.h"
23 
24 namespace Kratos
25 {
26  // Optimization variables
27 
28  //Auxilary field
29  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION,AUXILIARY_FIELD);
30 
31  //linear function
32  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION,D_LINEAR_D_X);
33  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION,D_LINEAR_D_CX);
34 
35  //symmetry plane
36  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION,D_PLANE_SYMMETRY_D_X);
37  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION,D_PLANE_SYMMETRY_D_CX);
38  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION,NEAREST_NEIGHBOUR_POINT);
39  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, NEAREST_NEIGHBOUR_DIST);
40  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, int, NEAREST_NEIGHBOUR_COND_ID);
41 
42  // strain energy
43  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRAIN_ENERGY_1_D_X);
44  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRAIN_ENERGY_1_D_CX);
45  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRAIN_ENERGY_2_D_X);
46  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRAIN_ENERGY_2_D_CX);
47  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRAIN_ENERGY_3_D_X);
48  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRAIN_ENERGY_3_D_CX);
49 
50  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_1_D_FD);
51  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_1_D_CD);
52 
53  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_2_D_FD);
54  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_2_D_CD);
55 
56  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_3_D_FD);
57  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_3_D_CD);
58 
59  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_1_D_FT);
60  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_1_D_CT);
61 
62  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_2_D_FT);
63  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_2_D_CT);
64 
65  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_3_D_FT);
66  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRAIN_ENERGY_3_D_CT);
67 
68  // partitioning
69  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_INTERFACE_D_FD);
70  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_INTERFACE_D_CD);
71  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_PARTITION_MASS_D_FD);
72  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_PARTITION_MASS_D_CD);
73 
74  // mass
75  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MASS_D_X);
76  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MASS_D_CX);
77  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MASS_D_FT);
78  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MASS_D_CT);
79  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MASS_D_PD);
80  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MASS_D_FD);
81  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MASS_D_CD);
82 
83  // max overhang angle
84  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MAX_OVERHANG_ANGLE_D_X);
85  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MAX_OVERHANG_ANGLE_D_CX);
86 
87  // stress
88  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRESS_D_X);
89  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_STRESS_D_CX);
90  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRESS_D_FD);
91  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_STRESS_D_CD);
92 
93  // max_stress
94  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MAX_STRESS_D_X);
95  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MAX_STRESS_D_CX);
96  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_PT);
97  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_CT);
98  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_PD);
99  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_CD);
100 
101  // max_stress
102  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MAX_STRES_D_X);
103  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, D_MAX_STRES_D_CX);
104  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_PT);
105  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_CT);
106  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_PD);
107  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, D_MAX_STRESS_D_CD);
108 
109  // shape control
114 
115  // thickness control
116  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,PT);
117  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,PPT);
118  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,FT);
119  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,CT);
120  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_CT);
121  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_PT);
122  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_PT_D_FT);
123  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_PPT_D_FT);
124 
125  // density control
126  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,PD);
127  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,PE);
128  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_PD_D_FD);
129  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_PE_D_FD);
130  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,FD);
131  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,CD);
132  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_CD);
133  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION,double,D_PD);
134 
135  // Adjoint RHS
136  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, ADJOINT_RHS);
137 
138  // For implicit vertex-morphing with Helmholtz PDE
139  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, Matrix, HELMHOLTZ_MASS_MATRIX );
140  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_SURF_RADIUS_SHAPE );
141  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_BULK_RADIUS_SHAPE );
142  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, bool, COMPUTE_CONTROL_POINTS_SHAPE );
143  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, ELEMENT_STRAIN_ENERGY );
144  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_SURF_POISSON_RATIO_SHAPE );
145  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_BULK_POISSON_RATIO_SHAPE );
146  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS( OPTIMIZATION_APPLICATION, HELMHOLTZ_VARS_SHAPE);
147  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS( OPTIMIZATION_APPLICATION, HELMHOLTZ_SOURCE_SHAPE);
148 
149  // For thickness optimization
150  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_VAR_THICKNESS);
151  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_SOURCE_THICKNESS);
152  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_RADIUS_THICKNESS);
153 
154  // For topology optimization
155  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_VAR_DENSITY);
156  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_SOURCE_DENSITY);
157  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_RADIUS_DENSITY);
158  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, bool, COMPUTE_CONTROL_DENSITIES);
159 
161  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, CROSS_AREA);
162  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, DENSITY_SENSITIVITY);
163  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, THICKNESS_SENSITIVITY);
164  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, CROSS_AREA_SENSITIVITY);
165  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, YOUNG_MODULUS_SENSITIVITY);
166  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, POISSON_RATIO_SENSITIVITY);
167 
168  // For helholtz solvers
169  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, bool, COMPUTE_HELMHOLTZ_INVERSE);
170  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, bool, HELMHOLTZ_INTEGRATED_FIELD);
171  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_RADIUS);
172  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_SCALAR);
173  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, HELMHOLTZ_SCALAR_SOURCE);
174  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS( OPTIMIZATION_APPLICATION, HELMHOLTZ_VECTOR);
175  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS( OPTIMIZATION_APPLICATION, HELMHOLTZ_VECTOR_SOURCE);
176 
177  // do not expose the following variables to python. They are used
178  // as temporary data holders. They can be changed
179  // at any point of time in an analysis.
180  // Hence, not recommended to be used for calculations
181  // unless existing values on those variables are not of interest
182  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, TEMPORARY_SCALAR_VARIABLE_1);
183  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, double, TEMPORARY_SCALAR_VARIABLE_2);
184  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, TEMPORARY_ARRAY3_VARIABLE_1);
185  KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(OPTIMIZATION_APPLICATION, TEMPORARY_ARRAY3_VARIABLE_2);
186 
187  KRATOS_DEFINE_APPLICATION_VARIABLE(OPTIMIZATION_APPLICATION, std::vector<std::string>, MODEL_PART_STATUS);
188 }
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KRATOS_DEFINE_APPLICATION_VARIABLE(CHIMERA_APPLICATION, double, CHIMERA_DISTANCE)
KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(CHIMERA_APPLICATION, ROTATION_MESH_DISPLACEMENT)