@@ -108,40 +108,26 @@ void CFVMFlowSolverBase<V, R>::Allocate(const CConfig& config) {
108108 /* --- LinSysSol will always be init to 0. ---*/
109109 System.SetxIsZero (true );
110110
111- /* --- Allocates a 2D array with variable "outer" sizes and init to 0. ---*/
112-
113- auto Alloc2D = [](unsigned long M, const vector<unsigned long >& N, vector<vector<su2double> >& X) {
114- X.resize (M);
115- for (unsigned long i = 0 ; i < M; ++i) X[i].resize (N[i],0.0 );
116- };
117-
118- /* --- Allocates a 3D array with variable "middle" sizes and init to 0. ---*/
119-
120- auto Alloc3D = [](unsigned long M, const vector<unsigned long >& N, unsigned long P, vector<su2activematrix>& X) {
121- X.resize (M);
122- for (unsigned long i = 0 ; i < M; ++i) X[i].resize (N[i],P) = su2double (0.0 );
123- };
124-
125111 /* --- Store the value of the characteristic primitive variables at the boundaries ---*/
126112
127- Alloc3D (nMarker, nVertex, nPrimVar, CharacPrimVar);
113+ AllocVectorOfMatrices ( nVertex, nPrimVar, CharacPrimVar);
128114
129115 /* --- Store the value of the Total Pressure at the inlet BC ---*/
130116
131- Alloc2D (nMarker, nVertex, Inlet_Ttotal);
117+ AllocVectorOfVectors ( nVertex, Inlet_Ttotal);
132118
133119 /* --- Store the value of the Total Temperature at the inlet BC ---*/
134120
135- Alloc2D (nMarker, nVertex, Inlet_Ptotal);
121+ AllocVectorOfVectors ( nVertex, Inlet_Ptotal);
136122
137123 /* --- Store the value of the Flow direction at the inlet BC ---*/
138124
139- Alloc3D (nMarker, nVertex, nDim, Inlet_FlowDir);
125+ AllocVectorOfMatrices ( nVertex, nDim, Inlet_FlowDir);
140126
141127 /* --- Force definition and coefficient arrays for all of the markers ---*/
142128
143- Alloc2D (nMarker, nVertex, CPressure);
144- Alloc2D (nMarker, nVertex, CPressureTarget);
129+ AllocVectorOfVectors ( nVertex, CPressure);
130+ AllocVectorOfVectors ( nVertex, CPressureTarget);
145131
146132 /* --- Non dimensional aerodynamic coefficients ---*/
147133
@@ -179,26 +165,26 @@ void CFVMFlowSolverBase<V, R>::Allocate(const CConfig& config) {
179165
180166 /* --- Heat flux in all the markers ---*/
181167
182- Alloc2D (nMarker, nVertex, HeatFlux);
183- Alloc2D (nMarker, nVertex, HeatFluxTarget);
168+ AllocVectorOfVectors ( nVertex, HeatFlux);
169+ AllocVectorOfVectors ( nVertex, HeatFluxTarget);
184170
185171 /* --- Y plus in all the markers ---*/
186172
187- Alloc2D (nMarker, nVertex, YPlus);
173+ AllocVectorOfVectors ( nVertex, YPlus);
188174
189175 /* --- Skin friction in all the markers ---*/
190176
191- Alloc3D (nMarker, nVertex, nDim, CSkinFriction);
177+ AllocVectorOfMatrices ( nVertex, nDim, CSkinFriction);
192178
193179 /* --- Wall Shear Stress in all the markers ---*/
194180
195- Alloc2D (nMarker, nVertex, WallShearStress);
181+ AllocVectorOfVectors ( nVertex, WallShearStress);
196182
197183 /* --- Store the values of the temperature and the heat flux density at the boundaries,
198184 used for coupling with a solid donor cell ---*/
199185 constexpr auto nHeatConjugateVar = 4u ;
200186
201- Alloc3D (nMarker, nVertex, nHeatConjugateVar, HeatConjugateVar);
187+ AllocVectorOfMatrices ( nVertex, nHeatConjugateVar, HeatConjugateVar);
202188 for (auto & x : HeatConjugateVar) x = config.GetTemperature_FreeStreamND ();
203189
204190 if (MGLevel == MESH_0) {
0 commit comments