inciter::FV class

FV Charm++ chare array used to advance PDEs in time with FV.

Public static functions

static void registerReducers()
Configure Charm++ reduction types for concatenating BC nodelists.

Constructors, destructors, conversion operators

FV(CkMigrateMessage* msg) explicit
Migrate constructor.

Public functions

auto FV(const CProxy_Discretization& disc, const CProxy_Ghosts& ghostsproxy, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>& triinpoel) -> FV_SDAG_CODE explicit
Constructor.
void ResumeFromSync() override
Return from migration.
void resizeSolVectors()
Resize solution vectors after extension due to Ghosts and continue setup.
void setup()
Setup: query boundary conditions, output mesh, etc.
void box(tk::real v, const std::vector<tk::real>& blkvols)
Receive total box IC volume and set conditions in box.
void evalLB(int nrestart)
void start()
Start time stepping.
void next()
Continue to next time step.
void comlim(int fromch, const std::vector<std::size_t>& tetid, const std::vector<std::vector<tk::real>>& u, const std::vector<std::vector<tk::real>>& prim)
Receive chare-boundary limiter function data from neighboring chares.
void comsol(int fromch, const std::vector<std::size_t>& tetid, const std::vector<std::vector<tk::real>>& u, const std::vector<std::vector<tk::real>>& prim)
Receive chare-boundary ghost data from neighboring chares.
void comnodeout(const std::vector<std::size_t>& gid, const std::vector<std::size_t>& nesup, const std::vector<std::vector<tk::real>>& Lu, const std::vector<std::vector<tk::real>>& Lp)
Receive nodal solution (ofor field output) contributions from neighboring chares.
void refine(const std::vector<tk::real>& l2res)
Optionally refine/derefine mesh.
void resizePostAMR(const std::vector<std::size_t>&, const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>&, const std::unordered_map<std::size_t, std::size_t>& addedTets, const std::set<std::size_t>& removedNodes, const std::unordered_map<std::size_t, std::size_t>& amrNodeMap, const tk::NodeCommMap& nodeCommMap, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>& triinpoel, const std::unordered_map<std::size_t, std::set<std::size_t>>& elemblockid)
Receive new mesh from Refiner.
void extractFieldOutput(const std::vector<std::size_t>&, const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>&, const std::unordered_map<std::size_t, std::size_t>& addedTets, const tk::NodeCommMap& nodeCommMap, const std::map<int, std::vector<std::size_t>>&, const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>&, CkCallback c)
Extract field output going to file.
auto solution() const -> const tk::Fields&
void lhs()
Compute left hand side.
void resized()
Unused in FV.
void transferSol()
(no-op)
void advance(tk::real, tk::real)
(no-op)
void solve(tk::real newdt)
Compute right hand side and solve system.
void step()
Evaluate whether to continue with next time step.

Charm++ pack/unpack serializer member functions

CProxy_Discretization m_disc
Discretization proxy.
CProxy_Ghosts m_ghosts
Distributed Ghosts proxy.
std::size_t m_nsol
Counter signaling that we have received all our solution ghost data.
std::size_t m_ninitsol
Counter signaling that we have received all our solution ghost data during setup.
std::size_t m_nlim
Counter signaling that we have received all our limiter function ghost data.
std::size_t m_nnod
Counter signaling that we have received all our node solution contributions.
tk::Fields m_u
Vector of unknown/solution average over each mesh element.
tk::Fields m_un
Vector of unknown at previous time-step.
tk::Fields m_p
Vector of primitive quantities over each mesh element.
tk::Fields m_lhs
Left-hand side mass-matrix which is a diagonal matrix.
tk::Fields m_rhs
Vector of right-hand side.
std::size_t m_npoin
Counter for number of nodes on this chare excluding ghosts.
ElemDiagnostics m_diag
Diagnostics object.
std::size_t m_stage
Runge-Kutta stage counter.
std::array<std::vector<std::vector<tk::real>>, 2> m_uc
Solution receive buffers for ghosts only.
std::array<std::vector<std::vector<tk::real>>, 2> m_pc
Primitive-variable receive buffers for ghosts only.
std::size_t m_initial
1 if starting time stepping, 0 if during time stepping
tk::Fields m_uElemfields
Solution elem output fields.
tk::Fields m_pElemfields
Primitive elem output fields.
tk::Fields m_uNodefields
Solution nodal output fields.
tk::Fields m_pNodefields
Primitive nodal output fields.
std::unordered_map<std::size_t, std::pair<std::vector<tk::real>, std::size_t>> m_uNodefieldsc
std::unordered_map<std::size_t, std::pair<std::vector<tk::real>, std::size_t>> m_pNodefieldsc
std::vector<std::unordered_set<std::size_t>> m_boxelems
Element ids at which box ICs are defined by user (multiple boxes)
std::vector<int> m_srcFlag
Vector indicating if a source was added to element.
std::array<std::vector<tk::real>, 2> m_rkcoef
Runge-Kutta coefficients.
std::size_t m_nrk
Number of Runge-Kutta stages.
std::vector<tk::real> m_dte
Time step size for each element (for local time stepping)
int m_finished
Flag for completed calculation.
void pup(PUP::er& p) override
Pack/Unpack serialize member function.
void operator|(PUP::er& p, FV& i)
Pack/Unpack serialize operator|.

Function documentation

static void inciter::FV::registerReducers()

Configure Charm++ reduction types for concatenating BC nodelists.

Since this is a [initnode] routine, the runtime system executes the routine exactly once on every logical node early on in the Charm++ init sequence. Must be static as it is called without an object. See also: Section "Initializations at Program Startup" at in the Charm++ manual http://charm.cs.illinois.edu/manuals/html/charm++/manual.html.

FV_SDAG_CODE inciter::FV::FV(const CProxy_Discretization& disc, const CProxy_Ghosts& ghostsproxy, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>& triinpoel) explicit

Constructor.

Parameters
disc in Discretization proxy
ghostsproxy
bface in Boundary-faces mapped to side set ids
triinpoel in Boundary-face connectivity

Runge-Kutta coefficients

void inciter::FV::ResumeFromSync() override

Return from migration.

This is called when load balancing (LB) completes. The presence of this function does not affect whether or not we block on LB.

void inciter::FV::box(tk::real v, const std::vector<tk::real>& blkvols)

Receive total box IC volume and set conditions in box.

Parameters
in Total volume within user-specified box
blkvols

void inciter::FV::evalLB(int nrestart)

Parameters
nrestart in Number of times restarted

void inciter::FV::comlim(int fromch, const std::vector<std::size_t>& tetid, const std::vector<std::vector<tk::real>>& u, const std::vector<std::vector<tk::real>>& prim)

Receive chare-boundary limiter function data from neighboring chares.

Parameters
fromch in Sender chare id
tetid in Ghost tet ids we receive solution data for
in Limited high-order solution
prim in Limited high-order primitive quantities

This function receives contributions to the limited solution from fellow chares.

void inciter::FV::comsol(int fromch, const std::vector<std::size_t>& tetid, const std::vector<std::vector<tk::real>>& u, const std::vector<std::vector<tk::real>>& prim)

Receive chare-boundary ghost data from neighboring chares.

Parameters
fromch in Sender chare id
tetid in Ghost tet ids we receive solution data for
in Solution ghost data
prim in Primitive variables in ghost cells

This function receives contributions to the unlimited solution from fellow chares.

void inciter::FV::comnodeout(const std::vector<std::size_t>& gid, const std::vector<std::size_t>& nesup, const std::vector<std::vector<tk::real>>& Lu, const std::vector<std::vector<tk::real>>& Lp)

Receive nodal solution (ofor field output) contributions from neighboring chares.

Parameters
gid in Global mesh node IDs at which we receive contributions
nesup in Number of elements surrounding points
Lu in Partial contributions of solution nodal fields to chare-boundary nodes
Lp in Partial contributions of primitive quantity nodal fields to chare-boundary nodes

void inciter::FV::refine(const std::vector<tk::real>& l2res)

Optionally refine/derefine mesh.

Parameters
l2res in L2-norms of the residual for each scalar component computed across the whole problem

void inciter::FV::resizePostAMR(const std::vector<std::size_t>&, const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>&, const std::unordered_map<std::size_t, std::size_t>& addedTets, const std::set<std::size_t>& removedNodes, const std::unordered_map<std::size_t, std::size_t>& amrNodeMap, const tk::NodeCommMap& nodeCommMap, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>& triinpoel, const std::unordered_map<std::size_t, std::set<std::size_t>>& elemblockid)

Receive new mesh from Refiner.

Parameters
chunk in New mesh chunk (connectivity and global<->local id maps)
coord in New mesh node coordinates
addedTets in Newly added mesh cells and their parents (local ids)
removedNodes in Newly removed mesh node local ids
amrNodeMap in Node id map after amr (local ids)
nodeCommMap in New node communication map
bface in Boundary-faces mapped to side set ids
triinpoel in Boundary-face connectivity
elemblockid in Local tet ids associated with mesh block ids

void inciter::FV::extractFieldOutput(const std::vector<std::size_t>&, const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>&, const std::unordered_map<std::size_t, std::size_t>& addedTets, const tk::NodeCommMap& nodeCommMap, const std::map<int, std::vector<std::size_t>>&, const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>&, CkCallback c)

Extract field output going to file.

Parameters
chunk in Field-output mesh chunk (connectivity and global<->local id maps)
coord in Field-output mesh node coordinates
addedTets in Field-output mesh cells and their parents (local ids)
nodeCommMap in Field-output mesh node communication map
in Function to continue with after the write

const tk::Fields& inciter::FV::solution() const

Returns Const-ref to current solution

Const-ref access to current solution

void inciter::FV::solve(tk::real newdt)

Compute right hand side and solve system.

Parameters
newdt in Size of this new time step

void inciter::FV::pup(PUP::er& p) override

Pack/Unpack serialize member function.

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

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

Pack/Unpack serialize operator|.

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

Variable documentation

std::unordered_map<std::size_t, std::pair<std::vector<tk::real>, std::size_t>> inciter::FV::m_uNodefieldsc

Receive buffer for communication of solution node fields

Key: global node id, value: output fields and number of elements surrounding the node

std::unordered_map<std::size_t, std::pair<std::vector<tk::real>, std::size_t>> inciter::FV::m_pNodefieldsc

Receive buffer for communication of primitive quantity node fields

Key: global node id, value: output fields and number of elements surrounding the node