Skip to content

Commit

Permalink
More changes in names of variables related to fixed point iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
itopcuoglu committed Oct 14, 2024
1 parent 91fefe1 commit f906268
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
8 changes: 4 additions & 4 deletions amr-wind/incflo.H
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public:
bool regrid_and_update();
void pre_advance_stage1();
void pre_advance_stage2();
void do_advance(const int ifixed_point_iteration);
void advance(int inonlin);
void do_advance(const int fixed_point_iteration);
void advance(const int fixed_point_iteration);
void prescribe_advance();
void post_advance_work();

Expand Down Expand Up @@ -134,7 +134,7 @@ public:
void ComputePrescribeDt();

void ApplyPredictor(
bool incremental_projection = false,
const bool incremental_projection = false,
const int ifixed_point_iteration = 0);
void ApplyCorrector();
void ApplyPrescribeStep();
Expand Down Expand Up @@ -175,7 +175,7 @@ private:
bool m_prescribe_vel = false;

// Fixed point iterations every timestep
int m_fixed_pt_iters{1};
int m_fixed_point_iterations{1};

//! number of cells on all levels including covered cells
amrex::Long m_cell_count{-1};
Expand Down
21 changes: 10 additions & 11 deletions amr-wind/incflo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ void incflo::Evolve()

amrex::Real time1 = amrex::ParallelDescriptor::second();
// Advance to time t + dt
for (int ifixed_point_iteration = 0;
ifixed_point_iteration < m_fixed_pt_iters;
++ifixed_point_iteration)
do_advance(ifixed_point_iteration);
for (int fixed_point_iteration = 0;
fixed_point_iteration < m_fixed_point_iterations;
++fixed_point_iteration)
do_advance(fixed_point_iteration);

amrex::Print() << std::endl;
amrex::Real time2 = amrex::ParallelDescriptor::second();
Expand Down Expand Up @@ -312,17 +312,17 @@ void incflo::Evolve()
}
}

void incflo::do_advance(const int ifixed_point_iteration)
void incflo::do_advance(const int fixed_point_iteration)
{
if (m_sim.has_overset()) {
m_ovst_ops.pre_advance_work();
}
if (m_prescribe_vel && ifixed_point_iteration == 0) {
if (m_prescribe_vel && fixed_point_iteration == 0) {
prescribe_advance();
} else {
amrex::Print() << "Fixed point iteration " << ifixed_point_iteration
amrex::Print() << "Fixed point iteration " << fixed_point_iteration
<< std::endl;
advance(ifixed_point_iteration);
advance(fixed_point_iteration);
}
if (m_sim.has_overset()) {
m_ovst_ops.post_advance_work();
Expand Down Expand Up @@ -378,10 +378,9 @@ void incflo::init_physics_and_pde()
m_sim.activate_overset();
}

// Get number of advection iterations
pp.query("fixed_point_iterations", m_fixed_pt_iters);
pp.query("fixed_point_iterations", m_fixed_point_iterations);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
m_fixed_pt_iters > 0,
m_fixed_point_iterations > 0,
"The number of fixed point iterations cannot be less than 1");
}

Expand Down
10 changes: 5 additions & 5 deletions amr-wind/incflo_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ void incflo::pre_advance_stage2()
*
* \callgraph
*/
void incflo::advance(const int ifixed_point_iteration)
void incflo::advance(const int fixed_point_iteration)
{
BL_PROFILE("amr-wind::incflo::advance");
if (ifixed_point_iteration == 0) {
if (fixed_point_iteration == 0) {
m_sim.pde_manager().advance_states();
}

ApplyPredictor(false, ifixed_point_iteration);
ApplyPredictor(false, fixed_point_iteration);

if (!m_use_godunov) {
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
ifixed_point_iteration == 0,
"Advection iterations are not supported for MOL");
fixed_point_iteration == 0,
"Fixed point iterations are not supported for MOL");

ApplyCorrector();
}
Expand Down

0 comments on commit f906268

Please sign in to comment.