@@ -50,7 +50,7 @@ CFEASolver::CFEASolver(LINEAR_SOLVER_MODE mesh_deform_mode) : CFEASolverBase(mes
5050
5151CFEASolver::CFEASolver (CGeometry *geometry, CConfig *config) : CFEASolverBase(geometry, config) {
5252
53- bool dynamic = ( config->GetTime_Domain () );
53+ bool dynamic = config->GetTime_Domain ();
5454 config->SetDelta_UnstTimeND (config->GetDelta_UnstTime ());
5555
5656 /* --- Test whether we consider dielectric elastomers ---*/
@@ -60,6 +60,7 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(ge
6060 element_based = false ;
6161 topol_filter_applied = false ;
6262 initial_calc = true ;
63+ body_forces = config->GetGravityForce () || config->GetBody_Force () || config->GetCentrifugalForce ();
6364
6465 /* --- Here is where we assign the kind of each element ---*/
6566
@@ -122,22 +123,15 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(ge
122123
123124 /* --- The length of the solution vector depends on whether the problem is static or dynamic ---*/
124125
125- unsigned short nSolVar;
126126 string text_line, filename;
127127 ifstream restart_file;
128128
129- if (dynamic) nSolVar = 3 * nVar;
130- else nSolVar = nVar;
131-
132- auto * SolInit = new su2double[nSolVar]();
133-
134129 /* --- Initialize from zero everywhere ---*/
135130
136- nodes = new CFEABoundVariable (SolInit, nPoint, nDim, nVar, config);
131+ std::array<su2double, 3 * MAXNVAR> zeros{};
132+ nodes = new CFEABoundVariable (zeros.data (), nPoint, nDim, nVar, config);
137133 SetBaseClassPointerToNodes ();
138134
139- delete [] SolInit;
140-
141135 /* --- Set which points are vertices and allocate boundary data. ---*/
142136
143137 for (unsigned long iPoint = 0 ; iPoint < nPoint; iPoint++)
@@ -568,7 +562,6 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container,
568562
569563 const bool dynamic = config->GetTime_Domain ();
570564 const bool disc_adj_fem = (config->GetKind_Solver () == MAIN_SOLVER::DISC_ADJ_FEM);
571- const bool body_forces = config->GetDeadLoad ();
572565 const bool topology_mode = config->GetTopology_Optimization ();
573566
574567 if (config->GetWeakly_Coupled_Heat ()) {
@@ -607,7 +600,7 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container,
607600 * Only initialized once, at the first iteration of the first time step.
608601 */
609602 if (body_forces && (initial_calc || disc_adj_fem))
610- Compute_DeadLoad (geometry, numerics, config);
603+ Compute_BodyForces (geometry, numerics, config);
611604
612605 /* --- Clear the linear system solution. ---*/
613606 SU2_OMP_PARALLEL
@@ -1424,7 +1417,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics,
14241417
14251418}
14261419
1427- void CFEASolver::Compute_DeadLoad (CGeometry *geometry, CNumerics **numerics, const CConfig *config) {
1420+ void CFEASolver::Compute_BodyForces (CGeometry *geometry, CNumerics **numerics, const CConfig *config) {
14281421
14291422 /* --- Start OpenMP parallel region. ---*/
14301423
@@ -1474,7 +1467,7 @@ void CFEASolver::Compute_DeadLoad(CGeometry *geometry, CNumerics **numerics, con
14741467 /* --- Set the properties of the element and compute its mass matrix. ---*/
14751468 element->Set_ElProperties (element_properties[iElem]);
14761469
1477- numerics[FEA_TERM + thread*MAX_TERMS]->Compute_Dead_Load (element, config);
1470+ numerics[FEA_TERM + thread*MAX_TERMS]->Compute_Body_Forces (element, config);
14781471
14791472 /* --- Add contributions of this element to the mass matrix. ---*/
14801473 for (iNode = 0 ; iNode < nNodes; iNode++) {
@@ -2122,7 +2115,6 @@ void CFEASolver::ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics
21222115 const bool linear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::SMALL);
21232116 const bool nonlinear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::LARGE);
21242117 const bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA () == STRUCT_SPACE_ITE::NEWTON);
2125- const bool body_forces = config->GetDeadLoad ();
21262118
21272119 /* --- For simplicity, no incremental loading is handled with increment of 1. ---*/
21282120 const su2double loadIncr = config->GetIncrementalLoad ()? loadIncrement : su2double (1.0 );
@@ -2310,7 +2302,6 @@ void CFEASolver::GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics
23102302 const bool linear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::SMALL);
23112303 const bool nonlinear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::LARGE);
23122304 const bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA () == STRUCT_SPACE_ITE::NEWTON);
2313- const bool body_forces = config->GetDeadLoad ();
23142305
23152306 /* --- Blend between previous and current timestep. ---*/
23162307 const su2double alpha_f = config->Get_Int_Coeffs (2 );
@@ -2934,9 +2925,6 @@ void CFEASolver::Compute_OFVolFrac(CGeometry *geometry, const CConfig *config)
29342925
29352926void CFEASolver::Compute_OFCompliance (CGeometry *geometry, const CConfig *config)
29362927{
2937- /* --- Types of loads to consider ---*/
2938- const bool body_forces = config->GetDeadLoad ();
2939-
29402928 /* --- If the loads are being applied incrementaly ---*/
29412929 const bool incremental_load = config->GetIncrementalLoad ();
29422930
0 commit comments