Conversation
Making vars const. Moving declaration of boolean or loop vars directly to where they are used. Some typos, line breaks fixed.
| if (time_n_needed) { | ||
| SU2_OMP_FOR_STAT(omp_chunk_size) | ||
| for (auto iPoint = 0u; iPoint < nPoint; iPoint++) { | ||
| for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { |
There was a problem hiding this comment.
this iPoint change from 0u to 0ul is less of a necessity then rather a consistency thing
| StopCalc = FinalTimeReached || MaxIterationsReached; | ||
| return (FinalTimeReached || MaxIterationsReached); | ||
| } | ||
|
|
||
| return StopCalc; |
There was a problem hiding this comment.
StopCalc is class data and was returned to itself, so I made the function to not use that var
| /*--- Read the target pressure for inverse design. ---------------------------------------------*/ | ||
| /*--- TODO: This routine should be taken out of output, and made general for multiple zones. ---*/ | ||
| // if (config_container[iZone]->GetInvDesign_Cp() == YES) | ||
| // output[iZone]->SetCp_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], |
There was a problem hiding this comment.
I removed all the inverse design stuff that was commented out in multiple places
|
|
||
| if (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) { | ||
| Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 2; | ||
| const int Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 2 + dual_time; |
There was a problem hiding this comment.
now consistent with CDiscAdjFluidIteration.cpp
There was a problem hiding this comment.
Fun fact, SU2_TYPE::Int implies a cast to su2double, followed cast to int, yeyy
There was a problem hiding this comment.
what are those casts via SU2_TYPE methods even for
|
@cvencro Merging this will most likely result in some conflicts with #1260 which are hopefully easy to resolve as it is mostly stylistic stuff without any real changes to the code. @pcarruscag I reverted CDiscADjVariable.hpp/cpp and will readd the briefs in #1260 |
SU2_CFD/src/drivers/CDriver.cpp
Outdated
| MDOFs += (su2double)DOFsPerPoint*(su2double)geometry_container[iZone][INST_0][MESH_0]->GetGlobal_nPoint()/(1.0e6); | ||
| MDOFsDomain += (su2double)DOFsPerPoint*(su2double)geometry_container[iZone][INST_0][MESH_0]->GetGlobal_nPointDomain()/(1.0e6); | ||
| Mpoints += static_cast<su2double>(geometry_container[iZone][INST_0][MESH_0]->GetGlobal_nPoint())/(1.0e6); | ||
| MpointsDomain += static_cast<su2double>(geometry_container[iZone][INST_0][MESH_0]->GetGlobal_nPointDomain())/(1.0e6); | ||
| MDOFs += static_cast<su2double>(DOFsPerPoint)*static_cast<su2double>(geometry_container[iZone][INST_0][MESH_0]->GetGlobal_nPoint())/(1.0e6); |
There was a problem hiding this comment.
The casts are not really needed.
| } | ||
| } | ||
|
|
||
| /*--- Set the adjoint values of the primal (TK::??) solution. ---*/ |
| dist_ij = sqrt(dist_ij); | ||
|
|
||
| dTdn = -(nodes->GetSolution(Point_Normal,0) - Twall)/dist_ij; | ||
| dTdn = -(nodes->GetTemperature(Point_Normal) - Twall)/dist_ij; |
| if (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) { | ||
| const int Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 2 + dual_time; | ||
| const int Direct_Iter = static_cast<int>(config[val_iZone]->GetUnst_AdjointIter()) - static_cast<int>(TimeIter) - 2 + dual_time; | ||
|
|
Hi all,
As I am stepping through DA cases with my debugger I am cleaning some things left and right. No major changes.
config->GetBooldirectly to the conditional instead of making it a var and using it 1 timePR Checklist