inciter::FluxCorrector class

FluxCorrector is used to perform flux-corrected transport

Constructors, destructors, conversion operators

FluxCorrector(std::size_t is = 0) explicit

Public functions

void resize(std::size_t is)
Resize state (e.g., after mesh refinement)
void aec(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::vector<tk::real>& vol, const std::unordered_map<std::size_t, std::vector<std::pair<bool, tk::real>>>& bc, const std::vector<std::size_t>& gid, const tk::Fields& dUh, const tk::Fields& Un, tk::Fields& P)
Compute antidiffusive element contributions (AEC)
auto verify(std::size_t nchare, const std::vector<std::size_t>& inpoel, const tk::Fields& dUh, const tk::Fields& dUl) const -> bool
Verify the assembled antidiffusive element contributions.
auto lump(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel) const -> tk::Fields
Compute lumped mass matrix lhs for low order system.
auto diff(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const tk::Fields& Un) const -> tk::Fields
Compute mass diffusion contribution to the rhs of the low order system.
void alw(const std::vector<std::size_t>& inpoel, const tk::Fields& Un, const tk::Fields& Ul, tk::Fields& Q) const
Compute the maximum and minimum unknowns of all elements surrounding nodes.
void lim(const std::vector<std::size_t>& inpoel, const tk::Fields& P, const tk::Fields& Ul, tk::Fields& Q, tk::Fields& A) const
Compute limited antiffusive element contributions and apply to mesh nodes.

Charm++ pack/unpack serializer member functions

void pup(PUP::er& p)
Pack/Unpack serialize member function.
void operator|(PUP::er& p, FluxCorrector& i)
Pack/Unpack serialize operator|.

Function documentation

inciter::FluxCorrector::FluxCorrector(std::size_t is = 0) explicit

Parameters
is in Size of the mesh element connectivity vector (inpoel size)

Constructor

void inciter::FluxCorrector::aec(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::vector<tk::real>& vol, const std::unordered_map<std::size_t, std::vector<std::pair<bool, tk::real>>>& bc, const std::vector<std::size_t>& gid, const tk::Fields& dUh, const tk::Fields& Un, tk::Fields& P)

Compute antidiffusive element contributions (AEC)

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
vol in Volume associated to mesh nodes
bc in Vector of pairs of bool and boundary condition value associated to mesh node IDs at which to set Dirichlet boundary conditions. Note that this BC data structure must include boundary conditions set across all PEs, not just the ones need to be set on this PE.
gid in Local to global node ID mapping
dUh in Increment of the high order solution
Un in Solution at the previous time step
in/out The sums of positive (negative) AECs to nodes

The antidiffusive element contributions (AEC) are defined as the difference between the high and low order solution, where the high order solution is obtained from consistent mass Taylor-Galerkin discretization and the low order solution is lumped mass Taylor-Galerkin + diffusion. Note that AEC is not directly computed as dUh - dUl (although that could also be done), but as AEC = M_L^{-1} (M_Le - M_ce) (ctau * Un + dUh), where

  • M_ce is the element's consistent mass matrix,
  • M_Le is the element's lumped mass matrix,
  • ctau is the mass diffusion coefficient on the rhs of the low order solution, see also FluxCorrector::diff(),
  • Un is the solution at the previous time step
  • dUh is the increment of the high order solution, and
  • M_L^{-1} is the inverse of the assembled lumped mass matrix, i.e., the volume associated to a mesh node by summing the quarter of the element volumes surrounding the node. Note that this is the correct node volume taking into account that some nodes are on chare boundaries.

bool inciter::FluxCorrector::verify(std::size_t nchare, const std::vector<std::size_t>& inpoel, const tk::Fields& dUh, const tk::Fields& dUl) const

Verify the assembled antidiffusive element contributions.

Parameters
nchare in Total number of host chares
inpoel in Mesh element connectivity
dUh in Increment of the high order solution
dUl in Increment of the low order solution
Returns True if verification has been done

This verification only makes sense if no communication is to be done, i.e., if there is a single host chare, because the AEC assembled to mesh nodes only contains partial contributions on chare boundaries at this point. Verification in parallel would incure communication of the unlimited AEC, which in general is not necessary, so we will not do that for the sake of verification.

tk::Fields inciter::FluxCorrector::lump(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel) const

Compute lumped mass matrix lhs for low order system.

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
Returns Lumped mass matrix

tk::Fields inciter::FluxCorrector::diff(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const tk::Fields& Un) const

Compute mass diffusion contribution to the rhs of the low order system.

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
Un in Solution at the previous time step
Returns Mass diffusion contribution to the RHS of the low order system

void inciter::FluxCorrector::alw(const std::vector<std::size_t>& inpoel, const tk::Fields& Un, const tk::Fields& Ul, tk::Fields& Q) const

Compute the maximum and minimum unknowns of all elements surrounding nodes.

Parameters
inpoel in Mesh element connectivity
Un in Solution at the previous time step
Ul in Low order solution
in/out Maximum and mimimum unknowns of elements surrounding nodes

void inciter::FluxCorrector::lim(const std::vector<std::size_t>& inpoel, const tk::Fields& P, const tk::Fields& Ul, tk::Fields& Q, tk::Fields& A) const

Compute limited antiffusive element contributions and apply to mesh nodes.

Parameters
inpoel in Mesh element connectivity
in The sums of all positive (negative) AECs to nodes
Ul in Low order solution
in/out The maximum and mimimum unknowns of elements surrounding each node
in/out Limited antidiffusive element contributions scatter-added to nodes

void inciter::FluxCorrector::pup(PUP::er& p)

Pack/Unpack serialize member function.

Parameters
in/out Charm++'s PUP::er serializer object reference

void inciter::FluxCorrector::operator|(PUP::er& p, FluxCorrector& i)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out FluxCorrector object reference