@@ -349,26 +349,6 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config,
349349 /* --- Add the solver name (max 8 characters). ---*/
350350 SolverName = " C.FLOW" ;
351351
352- /* --- Vectorized numerics. ---*/
353- if (config->GetUseVectorization ()) {
354- const bool uncertain = config->GetUsing_UQ ();
355- const bool ideal_gas = (config->GetKind_FluidModel () == STANDARD_AIR) ||
356- (config->GetKind_FluidModel () == IDEAL_GAS);
357- const bool low_mach_corr = config->Low_Mach_Correction ();
358-
359- if (uncertain || !ideal_gas || low_mach_corr) {
360- SU2_MPI::Error (" Some of the requested features are not yet "
361- " supported with vectorization." , CURRENT_FUNCTION);
362- }
363-
364- edgeNumerics = CNumericsSIMD::CreateNumerics (*config, nDim, iMesh);
365-
366- if (!edgeNumerics) {
367- SU2_MPI::Error (" The numerical scheme in use does not "
368- " support vectorization." , CURRENT_FUNCTION);
369- }
370- }
371-
372352 /* --- Finally, check that the static arrays will be large enough (keep this
373353 * check at the bottom to make sure we consider the "final" values). ---*/
374354 if ((nDim > MAXNDIM) || (nPrimVar > MAXNVAR) || (nSecondaryVar > MAXNVAR))
@@ -688,6 +668,31 @@ CEulerSolver::~CEulerSolver(void) {
688668
689669}
690670
671+ void CEulerSolver::InstantiateEdgeNumerics (const CSolver* const * solver_container, const CConfig* config) {
672+
673+ SU2_OMP_MASTER {
674+
675+ const bool ideal_gas = (config->GetKind_FluidModel () == STANDARD_AIR) ||
676+ (config->GetKind_FluidModel () == IDEAL_GAS);
677+ const bool low_mach_corr = config->Low_Mach_Correction ();
678+
679+ if (!ideal_gas || low_mach_corr)
680+ SU2_MPI::Error (" Some of the requested features are not yet "
681+ " supported with vectorization." , CURRENT_FUNCTION);
682+
683+ if (solver_container[TURB_SOL])
684+ edgeNumerics = CNumericsSIMD::CreateNumerics (*config, nDim, MGLevel, solver_container[TURB_SOL]->GetNodes ());
685+ else
686+ edgeNumerics = CNumericsSIMD::CreateNumerics (*config, nDim, MGLevel);
687+
688+ if (!edgeNumerics)
689+ SU2_MPI::Error (" The numerical scheme in use does not "
690+ " support vectorization." , CURRENT_FUNCTION);
691+
692+ }
693+ SU2_OMP_BARRIER
694+ }
695+
691696void CEulerSolver::InitTurboContainers (CGeometry *geometry, CConfig *config){
692697 unsigned short iMarker, iSpan, iVar;
693698 nSpanMax = config->GetnSpanMaxAllZones ();
@@ -2645,8 +2650,10 @@ void CEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container,
26452650void CEulerSolver::Centered_Residual (CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
26462651 CConfig *config, unsigned short iMesh, unsigned short iRKStep) {
26472652
2648- /* --- If possible use the vectorized numerics instead. ---*/
2649- if (edgeNumerics) { EdgeFluxResidual (geometry, config); return ; }
2653+ if (config->GetUseVectorization ()) {
2654+ EdgeFluxResidual (geometry, solver_container, config);
2655+ return ;
2656+ }
26502657
26512658 const bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
26522659 const bool jst_scheme = (config->GetKind_Centered_Flow () == JST) && (iMesh == MESH_0);
@@ -2732,8 +2739,10 @@ void CEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_conta
27322739void CEulerSolver::Upwind_Residual (CGeometry *geometry, CSolver **solver_container,
27332740 CNumerics **numerics_container, CConfig *config, unsigned short iMesh) {
27342741
2735- /* --- If possible use the vectorized numerics instead. ---*/
2736- if (edgeNumerics) { EdgeFluxResidual (geometry, config); return ; }
2742+ if (config->GetUseVectorization ()) {
2743+ EdgeFluxResidual (geometry, solver_container, config);
2744+ return ;
2745+ }
27372746
27382747 const auto InnerIter = config->GetInnerIter ();
27392748 const bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
0 commit comments