Skip to content

Commit 29f27b9

Browse files
committed
update get solution call
1 parent f1bb21b commit 29f27b9

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

SU2_CFD/src/solvers/CSolver.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4262,19 +4262,10 @@ void CSolver::SavelibROM(CSolver** solver, CGeometry *geometry, CConfig *config,
42624262
}
42634263

42644264
if (unsteady) {
4265-
double* u = new double[nPointDomain*nVar];
4266-
for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) {
4267-
for (unsigned short iVar = 0; iVar < nVar; iVar++) {
4268-
unsigned long total_index = iPoint*nVar + iVar;
4269-
u[total_index] = base_nodes->GetSolution(iPoint,iVar);
4270-
}
4271-
}
4272-
42734265
// give solution and time steps to libROM:
42744266
double dt = config->GetDelta_UnstTime();
42754267
double t = config->GetCurrent_UnstTime();
4276-
u_basis_generator->takeSample(u, t, dt);
4277-
delete[] u;
4268+
u_basis_generator->takeSample(const_cast<double*>(base_nodes->GetSolution().data()), t, dt);
42784269
}
42794270

42804271
/*--- End collection of data and save POD ---*/
@@ -4285,9 +4276,7 @@ void CSolver::SavelibROM(CSolver** solver, CGeometry *geometry, CConfig *config,
42854276
// dt is different for each node, so just use a placeholder dt
42864277
double dt = base_nodes->GetDelta_Time(0);
42874278
double t = dt*TimeIter;
4288-
u_basis_generator->takeSample(base_nodes->GetSolution().data(), t, dt);
4289-
4290-
delete[] u;
4279+
u_basis_generator->takeSample(const_cast<double*>(base_nodes->GetSolution().data()), t, dt);
42914280
}
42924281

42934282
if (config->GetKind_PODBasis() == POD_KIND::STATIC) {

0 commit comments

Comments
 (0)