@@ -49,7 +49,7 @@ CFEASolver::CFEASolver(LINEAR_SOLVER_MODE mesh_deform_mode) : CFEASolverBase(mes
4949
5050CFEASolver::CFEASolver (CGeometry *geometry, CConfig *config) : CFEASolverBase(geometry, config) {
5151
52- bool dynamic = ( config->GetTime_Domain () );
52+ bool dynamic = config->GetTime_Domain ();
5353 config->SetDelta_UnstTimeND (config->GetDelta_UnstTime ());
5454
5555 /* --- Test whether we consider dielectric elastomers ---*/
@@ -59,6 +59,7 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(ge
5959 element_based = false ;
6060 topol_filter_applied = false ;
6161 initial_calc = true ;
62+ body_forces = config->GetGravityForce () || config->GetBody_Force () || config->GetCentrifugalForce ();
6263
6364 /* --- Here is where we assign the kind of each element ---*/
6465
@@ -121,22 +122,15 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(ge
121122
122123 /* --- The length of the solution vector depends on whether the problem is static or dynamic ---*/
123124
124- unsigned short nSolVar;
125125 string text_line, filename;
126126 ifstream restart_file;
127127
128- if (dynamic) nSolVar = 3 * nVar;
129- else nSolVar = nVar;
130-
131- auto * SolInit = new su2double[nSolVar]();
132-
133128 /* --- Initialize from zero everywhere ---*/
134129
135- nodes = new CFEABoundVariable (SolInit, nPoint, nDim, nVar, config);
130+ std::array<su2double, 3 * MAXNVAR> zeros{};
131+ nodes = new CFEABoundVariable (zeros.data (), nPoint, nDim, nVar, config);
136132 SetBaseClassPointerToNodes ();
137133
138- delete [] SolInit;
139-
140134 /* --- Set which points are vertices and allocate boundary data. ---*/
141135
142136 for (unsigned long iPoint = 0 ; iPoint < nPoint; iPoint++)
@@ -567,7 +561,6 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container,
567561
568562 const bool dynamic = config->GetTime_Domain ();
569563 const bool disc_adj_fem = (config->GetKind_Solver () == MAIN_SOLVER::DISC_ADJ_FEM);
570- const bool body_forces = config->GetDeadLoad ();
571564 const bool topology_mode = config->GetTopology_Optimization ();
572565
573566 /*
@@ -602,7 +595,7 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container,
602595 * Only initialized once, at the first iteration of the first time step.
603596 */
604597 if (body_forces && (initial_calc || disc_adj_fem))
605- Compute_DeadLoad (geometry, numerics, config);
598+ Compute_BodyForces (geometry, numerics, config);
606599
607600 /* --- Clear the linear system solution. ---*/
608601 SU2_OMP_PARALLEL
@@ -1415,7 +1408,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics,
14151408
14161409}
14171410
1418- void CFEASolver::Compute_DeadLoad (CGeometry *geometry, CNumerics **numerics, const CConfig *config) {
1411+ void CFEASolver::Compute_BodyForces (CGeometry *geometry, CNumerics **numerics, const CConfig *config) {
14191412
14201413 /* --- Start OpenMP parallel region. ---*/
14211414
@@ -1465,7 +1458,7 @@ void CFEASolver::Compute_DeadLoad(CGeometry *geometry, CNumerics **numerics, con
14651458 /* --- Set the properties of the element and compute its mass matrix. ---*/
14661459 element->Set_ElProperties (element_properties[iElem]);
14671460
1468- numerics[FEA_TERM + thread*MAX_TERMS]->Compute_Dead_Load (element, config);
1461+ numerics[FEA_TERM + thread*MAX_TERMS]->Compute_Body_Forces (element, config);
14691462
14701463 /* --- Add contributions of this element to the mass matrix. ---*/
14711464 for (iNode = 0 ; iNode < nNodes; iNode++) {
@@ -2113,7 +2106,6 @@ void CFEASolver::ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics
21132106 const bool linear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::SMALL);
21142107 const bool nonlinear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::LARGE);
21152108 const bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA () == STRUCT_SPACE_ITE::NEWTON);
2116- const bool body_forces = config->GetDeadLoad ();
21172109
21182110 /* --- For simplicity, no incremental loading is handled with increment of 1. ---*/
21192111 const su2double loadIncr = config->GetIncrementalLoad ()? loadIncrement : su2double (1.0 );
@@ -2301,7 +2293,6 @@ void CFEASolver::GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics
23012293 const bool linear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::SMALL);
23022294 const bool nonlinear_analysis = (config->GetGeometricConditions () == STRUCT_DEFORMATION::LARGE);
23032295 const bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA () == STRUCT_SPACE_ITE::NEWTON);
2304- const bool body_forces = config->GetDeadLoad ();
23052296
23062297 /* --- Blend between previous and current timestep. ---*/
23072298 const su2double alpha_f = config->Get_Int_Coeffs (2 );
@@ -2925,9 +2916,6 @@ void CFEASolver::Compute_OFVolFrac(CGeometry *geometry, const CConfig *config)
29252916
29262917void CFEASolver::Compute_OFCompliance (CGeometry *geometry, const CConfig *config)
29272918{
2928- /* --- Types of loads to consider ---*/
2929- const bool body_forces = config->GetDeadLoad ();
2930-
29312919 /* --- If the loads are being applied incrementaly ---*/
29322920 const bool incremental_load = config->GetIncrementalLoad ();
29332921
0 commit comments