Skip to content

Commit dd8462d

Browse files
committed
cleanup, fix AD compile error
1 parent 33603e3 commit dd8462d

File tree

11 files changed

+30
-75
lines changed

11 files changed

+30
-75
lines changed

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class CDriverBase {
180180
unsigned long GetNumberElements() const;
181181

182182
/*!
183-
* \brief Get the number of solution variables
183+
* \brief Get the number of solution variables
184184
* \return Number of solution variables.
185185
*/
186186

@@ -760,16 +760,13 @@ class CDriverBase {
760760
}
761761

762762
/*!
763-
* \brief Set the array of variables for the source in the point
763+
* \brief Set the array of variables for the source in the point
764764
* \param[in] iSolver - Solver index.
765765
* \param[in] iPoint - Point index.
766766
* \param[in] values - Vector values of the source term.
767767
*/
768768
void SetPointCustomSource(unsigned short iSolver, unsigned long iPoint, std::vector<passivedouble> values) {
769769
auto* solver = solver_container[selected_zone][INST_0][MESH_0][iSolver];
770-
771-
//if (values[0]>1.0e-6)
772-
// cout << "iPoint="<<iPoint << ", setting custom point source" << values[0]<< endl;
773770
solver->SetCustomPointSource(iPoint, values);
774771
}
775772

@@ -799,7 +796,6 @@ inline void SetSolutionVector(unsigned short iSolver, unsigned long iPoint, vect
799796
unsigned short nVar = GetNumberSolverVars(iSolver);
800797
if (nVar != solutionVector.size() )
801798
SU2_MPI::Error("Solution Vector size is not equal to Solver size.", CURRENT_FUNCTION);
802-
//cout << "setting solution vector " << nodes->GetSolution(iPoint,0) << " " << solutionVector[0] << ", "<< nVar<< endl;
803799
for (unsigned int iVar = 0u; iVar < nVar; ++iVar) {
804800
nodes->SetSolution(iPoint,iVar, solutionVector[iVar]);
805801
nodes->SetSolution_Old(iPoint,iVar, solutionVector[iVar]);
@@ -836,7 +832,6 @@ inline void SetPrimitiveVector(unsigned short iSolver, unsigned long iPoint, vec
836832
auto* nodes = solver->GetNodes();
837833
auto nPrimvar = GetNumberPrimitiveVars(iSolver);
838834
vector<passivedouble> solutionvector(nPrimvar, 0.0);
839-
//cout << "setting primitive vector " << nodes->GetPrimitive(iPoint,0) << " " << primitiveVector[0] << ", "<< nPrimvar<< endl;
840835

841836
for (auto iVar = 0u; iVar < nPrimvar; ++iVar) {
842837
nodes->SetPrimitive(iPoint,iVar, primitiveVector[iVar]);

SU2_CFD/include/solvers/CEulerSolver.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -409,19 +409,6 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, ENUM_REGIME::COMP
409409
CNumerics **numerics_container,
410410
CConfig *config,
411411
unsigned short iMesh) override;
412-
/*!
413-
* \brief Custom Source term integration.
414-
* \param[in] geometry - Geometrical definition of the problem.
415-
* \param[in] solver_container - Container vector with all the solutions.
416-
* \param[in] numerics_container - Description of the numerical method.
417-
* \param[in] config - Definition of the particular problem.
418-
* \param[in] iMesh - Index of the mesh in multigrid computations.
419-
*/
420-
// void Custom_Source_Residual(CGeometry *geometry,
421-
// CSolver **solver_container,
422-
// CNumerics **numerics_container,
423-
// CConfig *config,
424-
// unsigned short iMesh) override;
425412

426413
/*!
427414
* \brief Source term integration.

SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,6 @@ class CFVMFlowSolverBase : public CSolver {
22252225
vector<passivedouble> val_source) final {
22262226
/*--- Since this call can be accessed indirectly using python, do some error
22272227
* checking to prevent segmentation faults ---*/
2228-
//cout << "flow" << endl;
22292228
if (val_point > nPointDomain)
22302229
SU2_MPI::Error("Out-of-bounds point index used on solver.", CURRENT_FUNCTION);
22312230
else if (val_source.size() > nVar)

SU2_CFD/include/solvers/CScalarSolver.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class CScalarSolver : public CSolver {
6464
vector<su2matrix<su2double*> > SlidingState; // vector of matrix of pointers... inner dim alloc'd elsewhere (welcome, to the twilight zone)
6565
vector<vector<int> > SlidingStateNodes;
6666

67-
6867
/*--- Shallow copy of grid coloring for OpenMP parallelization. ---*/
6968

7069
#ifdef HAVE_OMP
@@ -579,5 +578,4 @@ class CScalarSolver : public CSolver {
579578
return SlidingStateNodes[val_marker][val_vertex];
580579
}
581580

582-
583581
};

SU2_CFD/include/solvers/CScalarSolver.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ CScalarSolver<VariableType>::CScalarSolver(CGeometry* geometry, CConfig* config,
3636
config->GetNEMOProblem(), geometry->GetnDim(), config->GetnSpecies()) {
3737
nMarker = config->GetnMarker_All();
3838

39-
4039
/*--- Store the number of vertices on each marker for deallocation later ---*/
4140
nVertex.resize(nMarker);
4241
for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) nVertex[iMarker] = geometry->nVertex[iMarker];

SU2_CFD/include/solvers/CSpeciesSolver.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ class CSpeciesSolver : public CScalarSolver<CSpeciesVariable> {
195195
geometry, solver_container, conv_numerics, visc_numerics, config);
196196
}
197197

198-
199198
/*!
200199
* \brief Set a component of the unit vector representing the flow direction at an inlet boundary.
201200
* \param[in] val_marker - Surface marker where the flow direction is set.
@@ -207,19 +206,17 @@ class CSpeciesSolver : public CScalarSolver<CSpeciesVariable> {
207206
vector<passivedouble> val_source) final {
208207
/*--- Since this call can be accessed indirectly using python, do some error
209208
* checking to prevent segmentation faults ---*/
210-
//cout << "***** set custom point source species *****" << endl;
211209
if (val_point > nPointDomain)
212210
SU2_MPI::Error("Out-of-bounds point index used on solver.", CURRENT_FUNCTION);
213211
else if (val_source.size() > nVar)
214212
SU2_MPI::Error("Out-of-bounds source size used on solver.", CURRENT_FUNCTION);
215213
else {
216214
for (size_t iVar=0; iVar < val_source.size(); iVar++) {
217215
SpeciesPointSource[val_point][iVar] = val_source[iVar];
218-
//if (SpeciesPointSource[val_point][iVar] > 1.0e-6)
219-
// cout << iVar<<", setcustompointsource: "<< SpeciesPointSource[val_point][iVar] << endl;
220216
}
221217
}
222218
}
219+
223220
/*!
224221
* \brief A component of the unit vector representing the flow direction at an inlet boundary.
225222
* \param[in] val_marker - Surface marker where the flow direction is evaluated

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ unsigned long CDriver::GetNumberTimeIter() const { return config_container[selec
6161
unsigned long CDriver::GetNumberInnerIter() const { return config_container[selected_zone]->GetnInner_Iter(); }
6262
unsigned long CDriver::GetNumberOuterIter() const { return config_container[selected_zone]->GetnOuter_Iter(); }
6363

64-
unsigned long CDriver::GetDensity_FreeStreamND() const { return config_container[selected_zone]->GetDensity_FreeStreamND(); }
65-
unsigned long CDriver::GetForce_Ref() const { return config_container[selected_zone]->GetForce_Ref(); }
64+
unsigned long CDriver::GetDensity_FreeStreamND() const {
65+
return SU2_TYPE::GetValue(config_container[selected_zone]->GetDensity_FreeStreamND());
66+
}
67+
unsigned long CDriver::GetForce_Ref() const {
68+
return SU2_TYPE::GetValue(config_container[selected_zone]->GetForce_Ref());
69+
}
6670

6771
unsigned long CDriver::GetTimeIter() const { return TimeIter; }
6872

@@ -74,7 +78,7 @@ string CDriver::GetSurfaceFileName() const { return config_container[selected_zo
7478

7579
unsigned long CDriver::GetSolution(unsigned short iSOLVER, unsigned long iPoint, unsigned short iVar) {
7680
auto solver = solver_container[iZone][INST_0][MESH_0][iSOLVER];
77-
return solver->GetNodes()->GetSolution(iPoint,iVar);
81+
return SU2_TYPE::GetValue(solver->GetNodes()->GetSolution(iPoint,iVar));
7882
}
7983

8084
////////////////////////////////////////////////////////////////////////////////

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,6 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i
303303

304304
config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0));
305305
Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant();
306-
cout << "gas constant = " << config->GetGas_Constant() << endl;
307-
cout << "pressure = " << Pressure_Thermodynamic << endl;
308-
cout << "rho="<< Density_FreeStream<< endl;
309-
cout << "T="<< Temperature_FreeStream<< endl;
310306
auxFluidModel = new CIncIdealGas(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic);
311307
auxFluidModel->SetTDState_T(Temperature_FreeStream);
312308
Pressure_Thermodynamic = auxFluidModel->GetPressure();
@@ -1842,14 +1838,8 @@ void CIncEulerSolver::Custom_Source_Residual(CGeometry *geometry, CSolver **solv
18421838

18431839
/*--- Compute the residual for this control volume and subtract. ---*/
18441840
for (iVar = 0; iVar < nVar; iVar++) {
1845-
//cout << iPoint << " " << iVar << ",S="<< PointSource[iPoint][iVar]<< endl;
18461841
LinSysRes[iPoint*nVar+iVar] += PointSource[iPoint][iVar] * Volume;
18471842
}
1848-
// cout << "source = " << iPoint << " " << PointSource[iPoint][0]*Volume
1849-
// << " " << PointSource[iPoint][1]*Volume
1850-
// << " " << PointSource[iPoint][2]*Volume
1851-
// << " " << PointSource[iPoint][3]*Volume << endl;
1852-
18531843
}
18541844
END_SU2_OMP_FOR
18551845

SU2_CFD/src/solvers/CSpeciesSolver.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ void CSpeciesSolver::Initialize(CGeometry* geometry, CConfig* config, unsigned s
9494
/*--- Store if an implicit scheme is used, for use during periodic boundary conditions. ---*/
9595
SetImplicitPeriodic(config->GetKind_TimeIntScheme_Species() == EULER_IMPLICIT);
9696

97-
9897
nPrimVar = nVar;
9998

10099
if (nVar > MAXNVAR)
@@ -111,9 +110,6 @@ void CSpeciesSolver::Initialize(CGeometry* geometry, CConfig* config, unsigned s
111110

112111
nDim = geometry->GetnDim();
113112

114-
115-
116-
std::cout << "resize species pointsource, nVar="<<nVar <<" npointdomain="<<nPointDomain << endl;
117113
SpeciesPointSource.resize(nPointDomain,nVar);
118114
SpeciesPointSource.setConstant(0.0);
119115

@@ -592,23 +588,15 @@ void CSpeciesSolver::Custom_Source_Residual(CGeometry *geometry, CSolver **solve
592588
for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
593589

594590
/*--- Load the volume of the dual mesh cell ---*/
595-
596591
numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
597592

598593
/*--- Get control volume size. ---*/
599594
su2double Volume = geometry->nodes->GetVolume(iPoint);
600595

601596
/*--- Compute the residual for this control volume and subtract. ---*/
602597
for (iVar = 0; iVar < nVar; iVar++) {
603-
//if (SpeciesPointSource[iPoint][iVar] > 1.0e-6)
604-
//cout << iPoint << " " << iVar << ",Species ="<< SpeciesPointSource[iPoint][iVar]<< endl;
605598
LinSysRes[iPoint*nVar+iVar] -= SpeciesPointSource[iPoint][iVar] * Volume;
606599
}
607-
// cout << "source = " << iPoint << " " << PointSource[iPoint][0]*Volume
608-
// << " " << PointSource[iPoint][1]*Volume
609-
// << " " << PointSource[iPoint][2]*Volume
610-
// << " " << PointSource[iPoint][3]*Volume << endl;
611-
612600
}
613601
END_SU2_OMP_FOR
614602

SU2_CFD/src/solvers/CTurbSSTSolver.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh
191191
/*--- Add the solver name. ---*/
192192
SolverName = "SST";
193193

194-
cout << "end initialize sst" << endl;
195194
}
196195

197196
void CTurbSSTSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config,

0 commit comments

Comments
 (0)