Skip to content

Commit df2469f

Browse files
authored
Merge pull request #1344 from su2code/fix_slidingmesh_reconstructboundary_pr1
Fix slidingmesh for SA
2 parents bd75cb3 + b3863c8 commit df2469f

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,19 @@ void CSlidingInterface::GetDonor_Variable(CSolver *donor_solution, CGeometry *do
4747
const CConfig *donor_config, unsigned long Marker_Donor,
4848
unsigned long Vertex_Donor, unsigned long Point_Donor) {
4949

50-
unsigned short iVar, nDonorVar;
51-
nDonorVar = donor_solution->GetnPrimVar();
52-
53-
/*--- the number of primitive variables is set to two by default for the turbulent solver ---*/
54-
bool turbulent = (nDonorVar == 2) ;
55-
50+
const auto nDonorVar = donor_solution->GetnPrimVar();
51+
/// TODO: Replace with approach compatible with any number of variables (e.g. encapsulate in a "solver info" object).
52+
const bool turbulent = nDonorVar <= 2;
5653
if (turbulent){
57-
58-
/*--- for turbulent solver retrieve solution and set it as the donor variable ---*/
59-
Donor_Variable[0] = donor_solution->GetNodes()->GetSolution(Point_Donor,0);
60-
Donor_Variable[1] = donor_solution->GetNodes()->GetSolution(Point_Donor,1);
61-
62-
} else{
63-
64-
/*--- Retrieve primitive variables and set them as the donor variables ---*/
65-
for (iVar = 0; iVar < nDonorVar; iVar++)
66-
Donor_Variable[iVar] = donor_solution->GetNodes()->GetPrimitive(Point_Donor,iVar);
67-
54+
/*--- For turbulent solver retrieve solution variables and set then as the donor variables. ---*/
55+
for (unsigned short iVar = 0; iVar < nDonorVar; iVar++) {
56+
Donor_Variable[iVar] = donor_solution->GetNodes()->GetSolution(Point_Donor, iVar);
57+
}
58+
} else {
59+
/*--- For flow solver retrieve primitive variables and set them as the donor variables. ---*/
60+
for (unsigned short iVar = 0; iVar < nDonorVar; iVar++) {
61+
Donor_Variable[iVar] = donor_solution->GetNodes()->GetPrimitive(Point_Donor, iVar);
62+
}
6863
}
6964
}
7065

0 commit comments

Comments
 (0)