Skip to content

Commit f7f2f75

Browse files
committed
move uds to CSolver
1 parent 2756cfb commit f7f2f75

File tree

11 files changed

+9
-215
lines changed

11 files changed

+9
-215
lines changed

SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -315,39 +315,6 @@ class CFVMFlowSolverBase : public CSolver {
315315
}
316316
}
317317

318-
319-
// inline void Custom_Source_Residual(CGeometry *geometry, CSolver **solver_container,
320-
// CNumerics **numerics_container, CConfig *config, unsigned short iMesh) {
321-
322-
// /*--- Pick one numerics object per thread. ---*/
323-
// CNumerics* numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS];
324-
325-
// unsigned short iVar;
326-
// unsigned long iPoint;
327-
// AD::StartNoSharedReading();
328-
329-
// SU2_OMP_FOR_STAT(omp_chunk_size)
330-
// for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
331-
332-
// /*--- Load the volume of the dual mesh cell ---*/
333-
334-
// numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
335-
336-
// /*--- Get control volume size. ---*/
337-
// su2double Volume = geometry->nodes->GetVolume(iPoint);
338-
339-
// /*--- Compute the residual for this control volume and subtract. ---*/
340-
// for (iVar = 0; iVar < nVar; iVar++) {
341-
// LinSysRes(iPoint, iVar) += nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
342-
// }
343-
// }
344-
// END_SU2_OMP_FOR
345-
346-
// AD::EndNoSharedReading();
347-
348-
// }
349-
350-
351318
/*!
352319
* \brief Computes and sets the required auxilliary vars (and gradients) for axisymmetric flow.
353320
*/

SU2_CFD/include/solvers/CSolver.hpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,19 +1565,6 @@ class CSolver {
15651565
CNumerics **numerics_container,
15661566
CConfig *config,
15671567
unsigned short iMesh) { }
1568-
/*!
1569-
* \brief A virtual member.
1570-
* \param[in] geometry - Geometrical definition of the problem.
1571-
* \param[in] solver_container - Container vector with all the solutions.
1572-
* \param[in] numerics_container - Description of the numerical method.
1573-
* \param[in] config - Definition of the particular problem.
1574-
* \param[in] iMesh - Index of the mesh in multigrid computations.
1575-
*/
1576-
// inline virtual void Custom_Source_Residual(CGeometry *geometry,
1577-
// CSolver **solver_container,
1578-
// CNumerics **numerics_container,
1579-
// CConfig *config,
1580-
// unsigned short iMesh) { }
15811568

15821569
/*!
15831570
* \brief A virtual member.
@@ -4346,27 +4333,24 @@ class CSolver {
43464333
END_SU2_OMP_FOR
43474334
}
43484335

4349-
/*--- Why not do this? ---*/
43504336
inline void Custom_Source_Residual(CGeometry *geometry, CSolver **solver_container,
43514337
CNumerics **numerics_container, CConfig *config, unsigned short iMesh) {
43524338

43534339
/*--- Pick one numerics object per thread. ---*/
43544340
CNumerics* numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS];
43554341

4356-
unsigned short iVar;
4357-
unsigned long iPoint;
43584342
AD::StartNoSharedReading();
43594343

43604344
SU2_OMP_FOR_STAT(omp_chunk_size)
4361-
for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
4345+
for (auto iPoint = 0; iPoint < nPointDomain; iPoint++) {
43624346

43634347
/*--- Load the volume of the dual mesh cell ---*/
43644348
numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
43654349

43664350
/*--- Get control volume size. ---*/
43674351
su2double Volume = geometry->nodes->GetVolume(iPoint);
43684352
/*--- Compute the residual for this control volume and subtract. ---*/
4369-
for (iVar = 0; iVar < nVar; iVar++) {
4353+
for (auto iVar = 0; iVar < nVar; iVar++) {
43704354
LinSysRes(iPoint,iVar) -= base_nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
43714355
}
43724356
}

SU2_CFD/include/solvers/CSpeciesSolver.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,6 @@ class CSpeciesSolver : public CScalarSolver<CSpeciesVariable> {
162162
*/
163163
void Source_Residual(CGeometry* geometry, CSolver** solver_container, CNumerics** numerics_container, CConfig* config,
164164
unsigned short iMesh) override;
165-
/*!
166-
* \brief Source term computation for axisymmetric flow.
167-
* \param[in] geometry - Geometrical definition of the problem.
168-
* \param[in] solver_container - Container vector with all the solutions.
169-
* \param[in] numerics_container - Container for description of the numerical method.
170-
* \param[in] config - Definition of the particular problem.
171-
* \param[in] iMesh - Index of the mesh in multigrid computations.
172-
*/
173-
// void Custom_Source_Residual(CGeometry* geometry, CSolver** solver_container, CNumerics** numerics_container, CConfig* config,
174-
// unsigned short iMesh) override;
175-
176165

177166
/*!
178167
* \brief Impose the fluid interface boundary condition using tranfer data.

SU2_CFD/src/integration/CIntegration.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ void CIntegration::Space_Integration(CGeometry *geometry,
6363
/*--- Compute source term residuals ---*/
6464
solver_container[MainSolver]->Source_Residual(geometry, solver_container, numerics, config, iMesh);
6565

66-
/*--- Compute custom (python wrapper) source term residuals ---*/
67-
//solver_container[MainSolver]->Custom_Source_Residual(geometry, solver_container, numerics, config, iMesh);
68-
6966
/*--- Add viscous and convective residuals, and compute the Dual Time Source term ---*/
7067

7168
if (dual_time)

SU2_CFD/src/solvers/CEulerSolver.cpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,27 +2278,13 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain
22782278
}
22792279
}
22802280

2281+
AD::EndNoSharedReading();
2282+
22812283
/*--- Custom user defined source term (from the python wrapper) ---*/
22822284
if (config->GetPyCustom_Source() ) {
2283-
SU2_OMP_FOR_STAT(omp_chunk_size)
2284-
for (auto iPoint = 0; iPoint < nPointDomain; iPoint++) {
2285-
2286-
/*--- Load the volume of the dual mesh cell ---*/
2287-
2288-
numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
2289-
2290-
/*--- Get control volume size. ---*/
2291-
su2double Volume = geometry->nodes->GetVolume(iPoint);
2292-
2293-
/*--- Compute the residual for this control volume and subtract. ---*/
2294-
for (auto iVar = 0; iVar < nVar; iVar++) {
2295-
LinSysRes(iPoint, iVar) += nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
2296-
}
2297-
}
2298-
END_SU2_OMP_FOR
2285+
Custom_Source_Residual(geometry, solver_container, numerics_container, config, iMesh);
22992286
}
23002287

2301-
AD::EndNoSharedReading();
23022288
}
23032289

23042290
void CEulerSolver::Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics,

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,28 +1813,6 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont
18131813
Custom_Source_Residual(geometry, solver_container, numerics_container, config, iMesh);
18141814
}
18151815

1816-
// /*--- Custom user defined source term (from the python wrapper) ---*/
1817-
// if (config->GetPyCustom_Source() ) {
1818-
// AD::StartNoSharedReading();
1819-
// SU2_OMP_FOR_STAT(omp_chunk_size)
1820-
// for (auto iPoint = 0; iPoint < nPointDomain; iPoint++) {
1821-
1822-
// /*--- Load the volume of the dual mesh cell ---*/
1823-
1824-
// numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
1825-
1826-
// /*--- Get control volume size. ---*/
1827-
// su2double Volume = geometry->nodes->GetVolume(iPoint);
1828-
1829-
// /*--- Compute the residual for this control volume and subtract. ---*/
1830-
// for (auto iVar = 0; iVar < nVar; iVar++) {
1831-
// LinSysRes(iPoint, iVar) += nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
1832-
// }
1833-
// }
1834-
// END_SU2_OMP_FOR
1835-
// AD::EndNoSharedReading();
1836-
// }
1837-
18381816
}
18391817

18401818
void CIncEulerSolver::Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics,

SU2_CFD/src/solvers/CSolver.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4367,33 +4367,3 @@ void CSolver::SavelibROM(CGeometry *geometry, CConfig *config, bool converged) {
43674367
#endif
43684368

43694369
}
4370-
4371-
4372-
// void CSolver::Custom_Source_Residual(CGeometry *geometry, CSolver **solver_container,
4373-
// CNumerics **numerics_container, CConfig *config, unsigned short iMesh) {
4374-
4375-
// /*--- Pick one numerics object per thread. ---*/
4376-
// CNumerics* numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS];
4377-
4378-
// unsigned short iVar;
4379-
// unsigned long iPoint;
4380-
// AD::StartNoSharedReading();
4381-
4382-
// SU2_OMP_FOR_STAT(omp_chunk_size)
4383-
// for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
4384-
4385-
// /*--- Load the volume of the dual mesh cell ---*/
4386-
// numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
4387-
4388-
// /*--- Get control volume size. ---*/
4389-
// su2double Volume = geometry->nodes->GetVolume(iPoint);
4390-
// /*--- Compute the residual for this control volume and subtract. ---*/
4391-
// for (iVar = 0; iVar < nVar; iVar++) {
4392-
// LinSysRes(iPoint,iVar) -= nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
4393-
// }
4394-
// }
4395-
// END_SU2_OMP_FOR
4396-
4397-
// AD::EndNoSharedReading();
4398-
4399-
// }

SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -389,32 +389,11 @@ void CSpeciesFlameletSolver::Source_Residual(CGeometry* geometry, CSolver** solv
389389
}
390390
END_SU2_OMP_FOR
391391

392-
393-
/*--- Custom user defined source term (from the python wrapper) ---*/
392+
/*--- Custom user defined source term (from the python wrapper) ---*/
394393
if (config->GetPyCustom_Source() ) {
395394
Custom_Source_Residual(geometry, solver_container, numerics_container, config, iMesh);
396-
397-
// AD::StartNoSharedReading();
398-
// SU2_OMP_FOR_STAT(omp_chunk_size)
399-
// for (auto iPoint = 0; iPoint < nPointDomain; iPoint++) {
400-
401-
// /*--- Load the volume of the dual mesh cell ---*/
402-
403-
// numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
404-
405-
// /*--- Get control volume size. ---*/
406-
// su2double Volume = geometry->nodes->GetVolume(iPoint);
407-
408-
// /*--- Compute the residual for this control volume and subtract. ---*/
409-
// for (auto iVar = 0; iVar < nVar; iVar++) {
410-
// LinSysRes(iPoint, iVar) += nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
411-
// }
412-
// }
413-
// END_SU2_OMP_FOR
414-
// AD::EndNoSharedReading();
415395
}
416396

417-
418397
}
419398

420399
void CSpeciesFlameletSolver::BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,

SU2_CFD/src/solvers/CSpeciesSolver.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -564,63 +564,9 @@ void CSpeciesSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta
564564
END_SU2_OMP_FOR
565565
}
566566

567-
/*--- Custom user defined source term (from the python wrapper) ---*/
567+
/*--- Custom user defined source term (from the python wrapper) ---*/
568568
if (config->GetPyCustom_Source() ) {
569569
Custom_Source_Residual(geometry, solver_container, numerics_container, config, iMesh);
570570
}
571571

572-
// /*--- Custom user defined source term (from the python wrapper) ---*/
573-
// if (config->GetPyCustom_Source() ) {
574-
// CNumerics *numerics = numerics_container[SOURCE_FIRST_TERM + omp_get_thread_num()*MAX_TERMS];
575-
576-
// AD::StartNoSharedReading();
577-
// SU2_OMP_FOR_STAT(omp_chunk_size)
578-
// for (auto iPoint = 0; iPoint < nPointDomain; iPoint++) {
579-
580-
// /*--- Load the volume of the dual mesh cell ---*/
581-
582-
// numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
583-
584-
// /*--- Get control volume size. ---*/
585-
// su2double Volume = geometry->nodes->GetVolume(iPoint);
586-
587-
// /*--- Compute the residual for this control volume and subtract. ---*/
588-
// for (auto iVar = 0; iVar < nVar; iVar++) {
589-
// LinSysRes(iPoint, iVar) += nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
590-
// }
591-
// }
592-
// END_SU2_OMP_FOR
593-
// AD::EndNoSharedReading();
594-
// }
595-
596572
}
597-
598-
599-
// void CSpeciesSolver::Custom_Source_Residual(CGeometry *geometry, CSolver **solver_container,
600-
// CNumerics **numerics_container, CConfig *config, unsigned short iMesh) {
601-
602-
// /*--- Pick one numerics object per thread. ---*/
603-
// CNumerics* numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS];
604-
605-
// unsigned short iVar;
606-
// unsigned long iPoint;
607-
// AD::StartNoSharedReading();
608-
609-
// SU2_OMP_FOR_STAT(omp_chunk_size)
610-
// for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
611-
612-
// /*--- Load the volume of the dual mesh cell ---*/
613-
// numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
614-
615-
// /*--- Get control volume size. ---*/
616-
// su2double Volume = geometry->nodes->GetVolume(iPoint);
617-
// /*--- Compute the residual for this control volume and subtract. ---*/
618-
// for (iVar = 0; iVar < nVar; iVar++) {
619-
// LinSysRes(iPoint,iVar) -= nodes->GetUserDefinedSource(iPoint)[iVar] * Volume;
620-
// }
621-
// }
622-
// END_SU2_OMP_FOR
623-
624-
// AD::EndNoSharedReading();
625-
626-
// }

SU2_CFD/src/solvers/CTransLMSolver.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,11 @@ void CTransLMSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta
352352

353353
AD::EndNoSharedReading();
354354

355-
/*--- Custom user defined source term (from the python wrapper) ---*/
355+
/*--- Custom user defined source term (from the python wrapper) ---*/
356356
if (config->GetPyCustom_Source() ) {
357357
Custom_Source_Residual(geometry, solver_container, numerics_container, config, iMesh);
358358
}
359359

360-
361360
}
362361

363362
void CTransLMSolver::Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics,

0 commit comments

Comments
 (0)