inciter::DiagCG class

DiagCG Charm++ chare array used to advance PDEs in time with DiagCG+LW+FCT.

Public static functions

static void registerReducers()
Configure Charm++ custom reduction types initiated from this chare array.

Constructors, destructors, conversion operators

DiagCG(CkMigrateMessage* msg) explicit
Migrate constructor.

Public functions

auto DiagCG(const CProxy_Discretization& disc, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>& bnode, const std::vector<std::size_t>& triinpoel) -> DiagCG_SDAG_CODE explicit
Constructor.
void ResumeFromSync() override
Return from migration.
void resizeComm()
Size communication buffers (no-op)
void nodeNeighSetup()
Setup node-neighborhood (no-op)
void setup()
Setup: query boundary conditions, output mesh, etc.
void box(tk::real v)
Receive total box IC volume and set conditions in box.
void advance(tk::real newdt)
Advance equations to next time step.
void lhs()
Compute left-hand side of transport equations.
void comnorm(const std::unordered_map<int, std::unordered_map<std::size_t, std::array<tk::real, 4>>>& innorm)
Receive boundary point normals on chare-boundaries.
void comlhs(const std::vector<std::size_t>& gid, const std::vector<std::vector<tk::real>>& L)
Receive contributions to left-hand side matrix on chare-boundaries.
void comrhs(const std::vector<std::size_t>& gid, const std::vector<std::vector<tk::real>>& R, const std::vector<std::vector<tk::real>>& D)
Receive contributions to right-hand side vector on chare-boundaries.
void update(const tk::Fields& a, tk::Fields&& dul)
Update solution at the end of time step.
void refine(const std::vector<tk::real>& l2ref)
Optionally refine/derefine mesh.
void resizePostAMR(const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>& addedNodes, 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>>& bnode, const std::vector<std::size_t>&)
Receive new mesh from Refiner.
void extractFieldOutput(const std::vector<std::size_t>&, const tk::UnsMesh::Chunk&, const tk::UnsMesh::Coords&, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>&, const std::unordered_map<std::size_t, std::size_t>&, const tk::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)
Extract field output to file.
auto solution() const -> const tk::Fields&
void resized()
Resizing data sutrctures after mesh refinement has been completed.
void step()
Evaluate whether to continue with next time step.
void evalLB(int nrestart)
void next()
Continue to next time step.

Charm++ pack/unpack serializer member functions

CProxy_Discretization m_disc
Discretization proxy.
std::size_t m_initial
1 if starting time stepping, 0 if during time stepping
std::size_t m_nlhs
Counter for left-hand side matrix (vector) nodes updated.
std::size_t m_nrhs
Counter for right-hand side vector nodes updated.
std::size_t m_nnorm
Counter for receiving boundary point normals.
std::map<int, std::vector<std::size_t>> m_bnode
Boundary node lists mapped to side set ids.
std::map<int, std::vector<std::size_t>> m_bface
Boundary faces side-set information.
std::vector<std::size_t> m_triinpoel
Triangle face connecitivity.
tk::Fields m_u
Unknown/solution vector at mesh nodes.
tk::Fields m_ul
Unknown/solution vector at mesh nodes (low orderd)
tk::Fields m_du
Unknown/solution vector increment (high order)
tk::Fields m_ue
Unknown/solution vector at mesh cells.
tk::Fields m_lhs
Lumped lhs mass matrix.
tk::Fields m_rhs
Right-hand side vector (for the high order system)
std::unordered_map<std::size_t, std::vector<std::pair<bool, tk::real>>> m_bcdir
std::unordered_map<std::size_t, std::vector<tk::real>> m_lhsc
Receive buffer for communication of the left hand side.
std::unordered_map<std::size_t, std::vector<tk::real>> m_rhsc
Receive buffer for communication of the right hand side.
std::unordered_map<std::size_t, std::vector<tk::real>> m_difc
Receive buffer for communication of mass diffusion on the hand side.
tk::real m_vol
Total mesh volume.
std::unordered_map<int, std::unordered_map<std::size_t, std::array<tk::real, 4>>> m_bnorm
std::unordered_map<int, std::unordered_map<std::size_t, std::array<tk::real, 4>>> m_bnormc
Receive buffer for communication of the boundary point normals associated to side sets.
std::unordered_map<int, std::unordered_set<std::size_t>> m_symbcnodemap
Unique set of nodes at which symmetry BCs are set for side sets.
std::unordered_set<std::size_t> m_symbcnodes
Unique set of nodes at which symmetry BCs are set.
std::unordered_set<std::size_t> m_farfieldbcnodes
Unique set of nodes at which farfield BCs are set.
NodeDiagnostics m_diag
Diagnostics object.
std::unordered_set<std::size_t> m_boxnodes
Mesh node ids at which user-defined box ICs are defined.
std::vector<tk::real> m_dtp
Time step size for each mesh node.
std::vector<tk::real> m_tp
Physical time for each mesh node.
int m_finished
True in the last time step.
void pup(PUP::er& p) override
Pack/Unpack serialize member function.
void operator|(PUP::er& p, DiagCG& i)
Pack/Unpack serialize operator|.

Function documentation

static void inciter::DiagCG::registerReducers()

Configure Charm++ custom reduction types initiated from this chare array.

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.

DiagCG_SDAG_CODE inciter::DiagCG::DiagCG(const CProxy_Discretization& disc, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>& bnode, const std::vector<std::size_t>& triinpoel) explicit

Constructor.

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

void inciter::DiagCG::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::DiagCG::box(tk::real v)

Receive total box IC volume and set conditions in box.

Parameters
in Total volume within user-specified box

void inciter::DiagCG::advance(tk::real newdt)

Advance equations to next time step.

Parameters
newdt in Size of this new time step

void inciter::DiagCG::comnorm(const std::unordered_map<int, std::unordered_map<std::size_t, std::array<tk::real, 4>>>& innorm)

Receive boundary point normals on chare-boundaries.

Parameters
innorm in Incoming partial sums of boundary point normal contributions to normals (first 3 components), inverse distance squared (4th component)

void inciter::DiagCG::comlhs(const std::vector<std::size_t>& gid, const std::vector<std::vector<tk::real>>& L)

Receive contributions to left-hand side matrix on chare-boundaries.

Parameters
gid in Global mesh node IDs at which we receive LHS contributions
in Partial contributions of LHS to chare-boundary nodes This function receives contributions to m_lhs, which stores the diagonal (lumped) mass matrix at mesh nodes. While m_lhs stores own contributions, m_lhsc collects the neighbor chare contributions during communication. This way work on m_lhs and m_lhsc is overlapped. The two are combined in lhsmerge().

void inciter::DiagCG::comrhs(const std::vector<std::size_t>& gid, const std::vector<std::vector<tk::real>>& R, const std::vector<std::vector<tk::real>>& D)

Receive contributions to right-hand side vector on chare-boundaries.

Parameters
gid in Global mesh node IDs at which we receive RHS contributions
in Partial contributions of RHS to chare-boundary nodes
in Partial contributions to chare-boundary nodes This function receives contributions to m_rhs, which stores the right hand side vector at mesh nodes. While m_rhs stores own contributions, m_rhsc collects the neighbor chare contributions during communication. This way work on m_rhs and m_rhsc is overlapped. The two are combined in solve(). This function also receives contributions to mass diffusion term of the right hand side vector at mesh nodes.

void inciter::DiagCG::update(const tk::Fields& a, tk::Fields&& dul)

Update solution at the end of time step.

Parameters
in Limited antidiffusive element contributions
dul in Low order solution increment

void inciter::DiagCG::resizePostAMR(const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<std::size_t, tk::UnsMesh::Edge>& addedNodes, 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>>& bnode, const std::vector<std::size_t>&)

Receive new mesh from Refiner.

Parameters
ginpoel in Mesh connectivity with global node ids
chunk in New mesh chunk (connectivity and global<->local id maps)
coord in New mesh node coordinates
addedNodes in Newly added mesh nodes and their parents (local ids)
addedTets in Newly added mesh cells and their parents (local ids)
nodeCommMap in New node communication map
bnode in Boundary-node lists mapped to side set ids

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

Returns Const-ref to current solution

Const-ref access to current solution

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

Parameters
nrestart in Number of times restarted

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

Pack/Unpack serialize member function.

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

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

Pack/Unpack serialize operator|.

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

Variable documentation

std::unordered_map<std::size_t, std::vector<std::pair<bool, tk::real>>> inciter::DiagCG::m_bcdir

Boundary conditions evaluated and assigned to local mesh node IDs Vector of pairs of bool and boundary condition value associated to local mesh node IDs at which the user has set Dirichlet boundary conditions for all PDEs integrated. The bool indicates whether the BC is set at the node for that component the if true, the real value is the increment (from t to dt) in the BC specified for a component.

std::unordered_map<int, std::unordered_map<std::size_t, std::array<tk::real, 4>>> inciter::DiagCG::m_bnorm

Face normals in boundary points associated to side sets Key: local node id, value: unit normal and inverse distance square between face centroids and points, outer key: side set id

std::unordered_map<int, std::unordered_map<std::size_t, std::array<tk::real, 4>>> inciter::DiagCG::m_bnormc

Receive buffer for communication of the boundary point normals associated to side sets.

Key: global node id, value: normals (first 3 components), inverse distance squared (4th component), outer key, side set id