ALECG class
ALECG Charm++ chare array used to advance PDEs in time with ALECG+RK.
Contents
Public static functions
- static void registerReducers()
- Configure Charm++ custom reduction types initiated from this chare array.
Constructors, destructors, conversion operators
- ALECG(CkMigrateMessage* msg) explicit
- Migrate constructor.
Public functions
- auto ALECG(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>>& bnode, const std::vector<std::size_t>& triinpoel) -> ALECG_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 transferSol()
- (no-op)
- void setup()
- Start setup for solution.
-
void box(tk::
real v, const std::vector<tk:: real>& blkvols) - Receive total box IC volume and set conditions in box.
- void start()
- [start]
-
void advance(tk::
real newdt, std::array<tk:: real, 6>) - Advance equations to next time step.
- void lhs()
- Compute left-hand side of transport equations.
-
void comdfnorm(const std::unordered_map<tk::
UnsMesh:: Edge, std::array<tk:: real, 3>, tk:: UnsMesh:: Hash<2>, tk:: UnsMesh:: Eq<2>>& dfnorm) - Receive contributions to duual-face normals on chare boundaries.
-
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 comblk(const std::vector<std::size_t>& gid, const std::vector<std::set<std::size_t>>& mb)
- Receive mesh block information for nodes on chare-boundaries.
-
void comChBndGrad(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk::
real>>& G) - Receive contributions to gradients on chare-boundaries.
-
void comrhs(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk::
real>>& R) - Receive contributions to right-hand side vector on chare-boundaries.
- void update(const tk::Fields& a)
- Update solution at the end of time step.
-
void refine(const std::vector<tk::
real>& l2res) - 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 std::set<std::size_t>& removedNodes, const std::unordered_map<std::size_t, std::size_t>& amrNodeMap, const tk:: NodeCommMap& nodeCommMap, const tk:: EdgeCommMap& edgeCommMap, 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, 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&, 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 meshvelstart()
- Start computing the mesh mesh velocity for ALE.
- void meshveldone()
- Done with computing the mesh velocity for ALE mesh motion.
- 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 stage()
- Evaluate whether to continue with next time step stage.
- void next()
- Continue to next time step.
Charm++ pack/unpack serializer member functions
Function documentation
static void inciter:: ALECG:: 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:/
ALECG_SDAG_CODE inciter:: ALECG:: ALECG(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>>& bnode,
const std::vector<std::size_t>& triinpoel) explicit
Constructor.
| Parameters | |
|---|---|
| disc in | Discretization proxy |
| ghostsproxy | |
| bface in | Boundary-faces mapped to side sets used in the input file |
| bnode in | Boundary-node lists mapped to side sets used in input file |
| triinpoel in | Boundary-face connectivity where BCs set (global ids) |
void inciter:: ALECG:: 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:: ALECG:: lhs()
Compute left-hand side of transport equations.
[start]
[Compute lhs]
Also (re-)compute all data structures if the mesh changed.
void inciter:: ALECG:: comdfnorm(const std::unordered_map<tk:: UnsMesh:: Edge, std::array<tk:: real, 3>, tk:: UnsMesh:: Hash<2>, tk:: UnsMesh:: Eq<2>>& dfnorm)
Receive contributions to duual-face normals on chare boundaries.
| Parameters | |
|---|---|
| dfnorm in | Incoming partial sums of dual-face normals associated to chare-boundary edges |
void inciter:: ALECG:: 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), associated to side set ids |
void inciter:: ALECG:: comblk(const std::vector<std::size_t>& gid,
const std::vector<std::set<std::size_t>>& mb)
Receive mesh block information for nodes on chare-boundaries.
| Parameters | |
|---|---|
| gid in | Global mesh node IDs at which we receive RHS contributions |
| mb in | Block ids for each node on chare-boundaries |
This function receives mesh block information for nodes on chare boundaries. While m_nodeblockid stores block information for own nodes, m_nodeblockidc collects the neighbor chare information during communication. This way work on m_nodeblockid and m_nodeblockidc is overlapped. The two are combined in continueSetup().
void inciter:: ALECG:: comChBndGrad(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk:: real>>& G)
Receive contributions to gradients on chare-boundaries.
| Parameters | |
|---|---|
| gid in | Global mesh node IDs at which we receive grad contributions |
| G in | Partial contributions of gradients to chare-boundary nodes |
This function receives contributions to m_chBndGrad, which stores nodal gradients at mesh chare-boundary nodes. While m_chBndGrad stores own contributions, m_chBndGradc collects the neighbor chare contributions during communication. This way work on m_chBndGrad and m_chBndGradc is overlapped. The two are combined in rhs().
void inciter:: ALECG:: comrhs(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk:: real>>& R)
Receive contributions to right-hand side vector on chare-boundaries.
| Parameters | |
|---|---|
| gid in | Global mesh node IDs at which we receive RHS contributions |
| R in | Partial contributions of RHS 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().
void inciter:: ALECG:: 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 std::set<std::size_t>& removedNodes,
const std::unordered_map<std::size_t, std::size_t>& amrNodeMap,
const tk:: NodeCommMap& nodeCommMap,
const tk:: EdgeCommMap& edgeCommMap,
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,
const std::unordered_map<std::size_t, std::set<std::size_t>>& elemblockid)
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) |
| removedNodes in | Newly removed mesh node local ids |
| amrNodeMap in | Node id map after amr (local ids) |
| nodeCommMap in | New node communication map |
| edgeCommMap in | New edge communication map |
| bface in | Boundary-faces mapped to side set ids |
| bnode in | Boundary-node lists mapped to side set ids |
| triinpoel in | Boundary-face connectivity |
| elemblockid in | Local tet ids associated with mesh block ids |
[Refine]
[Resize]
const tk::Fields& inciter:: ALECG:: solution() const
| Returns | Const-ref to current solution |
|---|
Const-ref access to current solution
void inciter:: ALECG:: resized()
Resizing data sutrctures after mesh refinement has been completed.
[Resize]
void inciter:: ALECG:: evalLB(int nrestart)
| Parameters | |
|---|---|
| nrestart in | Number of times restarted |
void inciter:: ALECG:: pup(PUP::er& p) override
Pack/Unpack serialize member function.
| Parameters | |
|---|---|
| p in/out | Charm++'s PUP::er serializer object reference |