Skip to content

Commit

Permalink
Merge pull request #1344 from su2code/fix_slidingmesh_reconstructboun…
Browse files Browse the repository at this point in the history
…dary_pr1

Fix slidingmesh for SA
  • Loading branch information
pcarruscag authored Aug 7, 2021
2 parents bd75cb3 + b3863c8 commit df2469f
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,19 @@ void CSlidingInterface::GetDonor_Variable(CSolver *donor_solution, CGeometry *do
const CConfig *donor_config, unsigned long Marker_Donor,
unsigned long Vertex_Donor, unsigned long Point_Donor) {

unsigned short iVar, nDonorVar;
nDonorVar = donor_solution->GetnPrimVar();

/*--- the number of primitive variables is set to two by default for the turbulent solver ---*/
bool turbulent = (nDonorVar == 2) ;

const auto nDonorVar = donor_solution->GetnPrimVar();
/// TODO: Replace with approach compatible with any number of variables (e.g. encapsulate in a "solver info" object).
const bool turbulent = nDonorVar <= 2;
if (turbulent){

/*--- for turbulent solver retrieve solution and set it as the donor variable ---*/
Donor_Variable[0] = donor_solution->GetNodes()->GetSolution(Point_Donor,0);
Donor_Variable[1] = donor_solution->GetNodes()->GetSolution(Point_Donor,1);

} else{

/*--- Retrieve primitive variables and set them as the donor variables ---*/
for (iVar = 0; iVar < nDonorVar; iVar++)
Donor_Variable[iVar] = donor_solution->GetNodes()->GetPrimitive(Point_Donor,iVar);

/*--- For turbulent solver retrieve solution variables and set then as the donor variables. ---*/
for (unsigned short iVar = 0; iVar < nDonorVar; iVar++) {
Donor_Variable[iVar] = donor_solution->GetNodes()->GetSolution(Point_Donor, iVar);
}
} else {
/*--- For flow solver retrieve primitive variables and set them as the donor variables. ---*/
for (unsigned short iVar = 0; iVar < nDonorVar; iVar++) {
Donor_Variable[iVar] = donor_solution->GetNodes()->GetPrimitive(Point_Donor, iVar);
}
}
}

Expand Down

0 comments on commit df2469f

Please sign in to comment.