31#include "../variables/CDiscAdjFEABoundVariable.hpp"
41 static constexpr size_t MAXNVAR = 9;
42 unsigned short KindDirect_Solver = 0;
43 CSolver *direct_solver =
nullptr;
49 unsigned short size = 0;
56 su2double& operator[] (
unsigned short i) {
return val[i]; }
57 const su2double& operator[] (
unsigned short i)
const {
return val[i]; }
59 void resize(
unsigned short n) {
82 void GetDerivative() {
87 for (
auto i = 0u; i < size; ++i) {
90 TotalSens[i] += GlobalSens[i] - OldSens[i];
91 OldSens[i] = GlobalSens[i];
98 for (
auto i = 0u; i < size; ++i) OldSens[i] = 0.0;
101 ~SensData() { clear(); }
104 unsigned short nMPROP = 0;
110 bool de_effects =
false;
111 unsigned short nEField = 0;
115 unsigned short nDV = 0;
123 inline CVariable* GetBaseClassPointerToNodes()
override {
return nodes; }
128 void ReadDV(
const CConfig *config);
256 inline unsigned short GetnEField(
void)
const override {
return nEField; }
262 inline unsigned short GetnDVFEA(
void)
const override {
return nDV; }
290 bool reset =
false)
override;
312 unsigned short iMesh,
313 unsigned short iRKStep,
314 unsigned short RunTime_EqSystem,
315 bool Output)
override;
329 bool val_update_geo)
override;
Headers of the CSolver class which is inherited by all of the other solvers.
static Comm GetComm()
Definition mpi_structure.hpp:530
static void Allreduce(const void *sendbuf, void *recvbuf, int count, Datatype datatype, Op op, Comm comm)
Definition mpi_structure.hpp:570
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Main class for defining the variables on the FEA boundaries for adjoint applications.
Definition CDiscAdjFEABoundVariable.hpp:40
Main class for defining the discrete adjoint solver for FE structural problems.
Definition CDiscAdjFEASolver.hpp:39
void RegisterSolution(CGeometry *geometry, CConfig *config) override
Performs the preprocessing of the adjoint AD-based solver. Registers all necessary variables on the t...
Definition CDiscAdjFEASolver.cpp:165
void RegisterOutput(CGeometry *geometry, CConfig *config) override
Performs the preprocessing of the adjoint AD-based solver. Registers all necessary variables that are...
Definition CDiscAdjFEASolver.cpp:234
void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config, bool CrossTerm) override
Sets the adjoint values of the input variables of the flow (+turb.) iteration after tape has been eva...
Definition CDiscAdjFEASolver.cpp:245
su2double GetVal_Young(unsigned short iVal) const override
Get the value of the Young modulus from the adjoint solver.
Definition CDiscAdjFEASolver.hpp:232
su2double GetVal_DVFEA(unsigned short iVal) const override
Get the value of the design variables from the adjoint solver.
Definition CDiscAdjFEASolver.hpp:274
su2double GetTotal_Sens_E(unsigned short iVal) const override
Provide the total Young's modulus sensitivity.
Definition CDiscAdjFEASolver.hpp:196
su2double GetVal_Rho(unsigned short iVal) const override
Get the value of the density from the adjoint solver, for inertial effects.
Definition CDiscAdjFEASolver.hpp:244
void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) override
Load a solution from a restart file.
Definition CDiscAdjFEASolver.cpp:486
~CDiscAdjFEASolver() override
Destructor of the class.
Definition CDiscAdjFEASolver.cpp:124
su2double GetTotal_Sens_DVFEA(unsigned short iDVFEA) const override
A virtual member.
Definition CDiscAdjFEASolver.hpp:226
void RegisterVariables(CGeometry *geometry, CConfig *config, bool reset=false) override
A virtual member.
Definition CDiscAdjFEASolver.cpp:184
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override
Update the dual-time derivatives.
Definition CDiscAdjFEASolver.cpp:363
CDiscAdjFEASolver()=default
Constructor of the class.
su2double GetVal_Rho_DL(unsigned short iVal) const override
Get the value of the density from the adjoint solver, for dead loads.
Definition CDiscAdjFEASolver.hpp:250
su2double GetVal_Poisson(unsigned short iVal) const override
Get the value of the Poisson's ratio from the adjoint solver.
Definition CDiscAdjFEASolver.hpp:238
void SetSensitivity(CGeometry *geometry, CConfig *config, CSolver *) override
Extract and set the geometrical sensitivity.
Definition CDiscAdjFEASolver.cpp:373
su2double GetVal_EField(unsigned short iVal) const override
Get the value of the Electric Field from the adjoint solver.
Definition CDiscAdjFEASolver.hpp:268
void ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config) override
A virtual member.
Definition CDiscAdjFEASolver.cpp:302
void SetAdjoint_Output(CGeometry *geometry, CConfig *config) override
Sets the adjoint values of the output of the flow (+turb.) iteration before evaluation of the tape.
Definition CDiscAdjFEASolver.cpp:329
su2double GetTotal_Sens_Rho_DL(unsigned short iVal) const override
Get the total sensitivity for the structural weight.
Definition CDiscAdjFEASolver.hpp:214
unsigned short GetnDVFEA(void) const override
Get the number of design variables from the adjoint solver,.
Definition CDiscAdjFEASolver.hpp:262
su2double GetTotal_Sens_EField(unsigned short iEField) const override
A virtual member.
Definition CDiscAdjFEASolver.hpp:220
void SetRecording(CGeometry *geometry, CConfig *config) override
Prepare the solver for a new recording.
Definition CDiscAdjFEASolver.cpp:126
su2double GetTotal_Sens_Rho(unsigned short iVal) const override
Get the total sensitivity for the structural density.
Definition CDiscAdjFEASolver.hpp:208
unsigned short GetnEField(void) const override
Get the number of variables for the Electric Field from the adjoint solver.
Definition CDiscAdjFEASolver.hpp:256
su2double GetTotal_Sens_Nu(unsigned short iVal) const override
Set the total Poisson's ratio sensitivity.
Definition CDiscAdjFEASolver.hpp:202
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Definition CSolver.hpp:71
Main class for defining the variables.
Definition CVariable.hpp:50
passivedouble su2double
Definition code_config.hpp:181
#define MPI_SUM
Definition mpi_structure.hpp:486
#define MPI_DOUBLE
Definition mpi_structure.hpp:484
void RegisterInput(su2double &data)
Registers the variable as an input. I.e. as a leaf of the computational graph.
Definition ad_structure.hpp:101
passivedouble GetDerivative(const su2double &data)
Get the derivative value of the datatype (needs to be implemented for each new type).
Definition datatype_structure.hpp:117