Skip to content

Commit

Permalink
Make all comments match AB convention in LinearSolvers.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
eebasso committed Nov 21, 2023
1 parent 9e35dc1 commit 0dddfe1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Docs/sphinx_documentation/source/LinearSolvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ viscous term `divtau` explicitly:
// Note we call LPInfo().setMaxCoarseningLevel(0) because we are only applying the operator,
// not doing an implicit solve
//
// (alpha * a - beta * (del dot b grad)) sol
// (A * alpha - B * (del dot beta grad)) sol
//
// LPInfo info;
MLEBTensorOp ebtensorop(geom, grids, dmap, LPInfo().setMaxCoarseningLevel(0),
Expand Down
3 changes: 1 addition & 2 deletions Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

namespace amrex {

// (alpha * a - beta * (del dot b grad)) phi

// (A * alpha - B * (del dot beta grad)) phi
template <typename MF>
class MLABecLaplacianT
: public MLCellABecLapT<MF>
Expand Down
3 changes: 1 addition & 2 deletions Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

namespace amrex {

// (alpha * a - beta * (del dot b grad)) phi

// (A * alpha - B * (del dot beta grad)) phi
class MLEBABecLap
: public MLCellABecLap
{
Expand Down
11 changes: 5 additions & 6 deletions Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ namespace amrex {
// Tensor solver for high Reynolds flows with small gradient in viscosity.
// The system it solves is
//
// alpha a v - beta div dot tau = rhs
// A alpha v - B div dot tau = rhs
//
// where tau = eta [grad v + (grad v)^T] + (kappa-(2/3)eta) (div v) I.
// Here eta and kappa are shear and bulk viscosity, and I is identity tensor.
//
// The user needs to provide `a` by `setACoeffs`, eta by `setShearViscosity`,
// and kappa by `setBulkViscosity`. If `setBulkViscosity` is not called,
// kappa is set to zero. The user must also call `setEBShearViscosity` to set
// The user needs to provide `alpha` by `setACoeffs`, `eta` by `setShearViscosity`,
// and `kappa` by `setBulkViscosity`. If `setBulkViscosity` is not called,
// `kappa` is set to zero. The user must also call `setEBShearViscosity` to set
// viscosity on EB. Optionally, `setEBBulkViscosity` can be used to set
// bulk viscosity on EB.
//
// The scalars alpha and beta can be set with `setScalar(Real, Real)`. If
// The scalars `A` and `B` can be set with `setScalar(Real, Real)`. If
// they are not set, their default value is 1.

class MLEBTensorOp
: public MLEBABecLap
{
Expand Down
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLMG.H
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public:
Location a_loc = Location::FaceCenter);

/**
* \brief For ``(alpha * a - beta * (del dot b grad)) phi = rhs``, flux means ``-b grad phi``
* \brief For ``(A * alpha - B * (del dot beta grad)) phi = rhs``, flux means ``-beta grad phi``
*/
template <typename AMF>
void getFluxes (const Vector<Array<AMF*,AMREX_SPACEDIM> >& a_flux,
Expand Down
5 changes: 2 additions & 3 deletions Src/LinearSolvers/MLMG/AMReX_MLNodeABecLaplacian.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

namespace amrex {

// (alpha * a - beta * (del dot b grad)) phi = rhs
// a, phi and rhs are nodal. b is cell-centered.

// (A * alpha - B * (del dot beta grad)) phi = rhs
// alpha, phi and rhs are nodal. beta is cell-centered.
class MLNodeABecLaplacian
: public MLNodeLinOp
{
Expand Down
11 changes: 5 additions & 6 deletions Src/LinearSolvers/MLMG/AMReX_MLTensorOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ namespace amrex {
// Tensor solver for high Reynolds flows with small gradient in viscosity.
// The system it solves is
//
// alpha a v - beta div dot tau = rhs
// A alpha v - B div dot tau = rhs
//
// where tau = eta [grad v + (grad v)^T] + (kappa-(2/3)eta) (div v) I.
// Here eta and kappa are shear and bulk viscosity, and I is identity tensor.
//
// The user needs to provide `a` by `setACoeffs`, eta by `setShearViscosity`,
// and kappa by `setBulkViscosity`. If `setBulkViscosity` is not called,
// kappa is set to zero.
// The user needs to provide `alpha` by `setACoeffs`, `eta` by `setShearViscosity`,
// and `kappa` by `setBulkViscosity`. If `setBulkViscosity` is not called,
// `kappa` is set to zero.
//
// The scalars alpha and beta can be set with `setScalar(Real, Real)`. If
// The scalars `A` and `B` can be set with `setScalar(Real, Real)`. If
// they are not set, their default value is 1.

class MLTensorOp
: public MLABecLaplacian
{
Expand Down
8 changes: 4 additions & 4 deletions Tests/LinearSolvers/ABecLaplacian_F/README
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
This tutorial demonstrates how to solve the linear system in a
canonical ABecLaplacian form

alpha * a * phi - beta * del dot (b grad phi) = rhs.
A * alpha * phi - B * del dot (beta grad phi) = rhs.

Here phi is the unknown in a cell-centered MultiFab, alpha and beta
are scalar constants, a is a cell-centered MultiFab, and b lives on
Here phi is the unknown in a cell-centered MultiFab, A and B
are scalar constants, alpha is a cell-centered MultiFab, and beta lives on
cell faces and is thus represented by D face based MultiFabs, where D
is the number of spatial dimensions. The right-hand side, rhs, is
also cell-centered. A more specialized version of the ABecLaplacian
form is Poisson's equation. This tutorial is written with AMReX's
Fortran interfaces.

After the solution is obtained, one can also ask for grad phi, or flux
(defined as -b grad phi). Note that they live on cell faces. This
(defined as -beta grad phi). Note that they live on cell faces. This
step is not performed in this tutorial. However, one can look at
`amrex/Src/F_Interfaces/LinearSolvers/AMReX_multigrid_mod.F90` for the
interface of `get_grad_solution` and `get_fluxes`.
Expand Down

0 comments on commit 0dddfe1

Please sign in to comment.