Skip to content

Commit

Permalink
Add runtime parameter use_gauss_seidel to MAC and nodal projectors (#143
Browse files Browse the repository at this point in the history
)

The default is true for both.
  • Loading branch information
WeiqunZhang authored Aug 19, 2024
1 parent b70350e commit eb5b891
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
17 changes: 16 additions & 1 deletion Projections/hydro_MacProjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ void MacProjector::initProjector (
m_eb_abeclap = std::make_unique<MLEBABecLap>(m_geom, ba, dm, a_lpinfo, m_eb_factory);
m_linop = m_eb_abeclap.get();

if (m_phi_loc == MLMG::Location::CellCentroid)
if (m_phi_loc == MLMG::Location::CellCentroid) {
m_eb_abeclap->setPhiOnCentroid();
}

m_eb_abeclap->setScalars(0.0, 1.0);
for (int ilev = 0; ilev < nlevs; ++ilev) {
Expand Down Expand Up @@ -131,6 +132,13 @@ void MacProjector::initProjector (
m_abeclap = std::make_unique<MLABecLaplacian>(m_geom, ba, dm, a_overset_mask, a_lpinfo);
}

bool use_gauss_seidel = true;
{
ParmParse pp("mac_proj");
pp.query("use_gauss_seidel", use_gauss_seidel);
}
m_abeclap->setGaussSeidel(use_gauss_seidel);

m_linop = m_abeclap.get();

m_abeclap->setScalars(0.0, 1.0);
Expand Down Expand Up @@ -582,6 +590,13 @@ void MacProjector::initProjector (Vector<BoxArray> const& a_grids,
m_poisson = std::make_unique<MLPoisson>(m_geom, ba, dm, a_overset_mask, a_lpinfo);
}

bool use_gauss_seidel = true;
{
ParmParse pp("mac_proj");
pp.query("use_gauss_seidel", use_gauss_seidel);
}
m_poisson->setGaussSeidel(use_gauss_seidel);

m_linop = m_poisson.get();

m_mlmg = std::make_unique<MLMG>(*m_linop);
Expand Down
7 changes: 6 additions & 1 deletion Projections/hydro_NodalProjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ void NodalProjector::define (LPInfo const& a_lpinfo)
#endif
}

m_linop->setGaussSeidel(true);
bool use_gauss_seidel = true;
{
ParmParse pp("nodal_proj");
pp.query("use_gauss_seidel", use_gauss_seidel);
}
m_linop->setGaussSeidel(use_gauss_seidel);
m_linop->setHarmonicAverage(false);

//
Expand Down

0 comments on commit eb5b891

Please sign in to comment.