inciter::Discretization class

Discretization Charm++ chare array holding common functinoality to all discretization schemes.

Public static functions

static void registerReducers()
Configure Charm++ reduction types.

Constructors, destructors, conversion operators

Discretization(const CProxy_DistFCT& fctproxy, const CProxy_Transporter& transporter, const std::vector<std::size_t>& conn, const tk::UnsMesh::CoordMap& coordmap, const std::map<int, std::unordered_set<std::size_t>>& msum, int nchare) explicit
Constructor.
Discretization(CkMigrateMessage*) explicit
Migrate constructor.

Public functions

void resize(const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<int, std::vector<std::size_t>>& msum)
Resize mesh data structures (e.g., after mesh refinement)
void vol()
Sum mesh volumes to nodes, start communicating them on chare-boundaries.
void setRefiner(const CProxy_Refiner& ref)
Set Refiner Charm++ proxy.
void comvol(const std::vector<std::size_t>& gid, const std::vector<tk::real>& nodevol)
Collect nodal volumes across chare boundaries.
void totalvol()
Sum mesh volumes and contribute own mesh volume to total volume.
void stat()
Compute mesh cell statistics.
void writeMesh(const std::map<int, std::vector<std::size_t>>& bface, const std::vector<std::size_t>& triinpoel, const std::map<int, std::vector<std::size_t>>& bnode)
Output chare element blocks to output file.
void writeNodeMeta() const
Output mesh-based fields metadata to file.
void writeElemMeta() const
Output mesh-based element fields metadata to file.
void writeNodeSolution(const tk::ExodusIIMeshWriter& ew, uint64_t it, const std::vector<std::vector<tk::real>>& u) const
Output solution to file.
void writeNodeSolution(const tk::RootMeshWriter& rmw, uint64_t it, const std::vector<std::vector<tk::real>>& u) const
void writeElemSolution(const tk::ExodusIIMeshWriter& ew, uint64_t it, const std::vector<std::vector<tk::real>>& u, const std::vector<std::vector<tk::real>>& v) const
void setdt(tk::real newdt)
Set time step size.
void next()
Prepare for next step.
void status()
Otput one-liner status report.
auto filename() const -> std::string
Compute ExodusII filename.

Accessors

auto Coord() const -> const tk::UnsMesh::Coords&
auto Coord() -> tk::UnsMesh::Coords&
Coordinates accessors as non-const ref.
auto Gid() const -> const std::vector<std::size_t>&
Global ids accessors as const-ref.
auto Gid() -> std::vector<std::size_t>&
Global ids accessors as non-const-ref.
auto Lid() const -> const std::unordered_map<std::size_t, std::size_t>&
Local ids accessors as const-ref.
auto Lid() -> std::unordered_map<std::size_t, std::size_t>&
Local ids accessors as non-const-ref.
auto Inpoel() const -> const std::vector<std::size_t>&
Tetrahedron element connectivity (with local ids) accessors as const-ref.
auto Inpoel() -> std::vector<std::size_t>&
Tetrahedron element connectivity (with local ids) accessors as non-const-ref.
auto V() const -> const std::vector<tk::real>&
Total mesh volume accessors const-ref.
auto V() -> std::vector<tk::real>&
Total mesh volume accessors non-const-ref.
auto Vol() const -> const std::vector<tk::real>&
Nodal mesh volumes accessors as const-ref.
auto Vol() -> std::vector<tk::real>&
Nodal mesh volumes accessors as non-const-ref.
auto Dt() const -> tk::real
Time step size accessor.
auto T() const -> tk::real
Physical time accessor.
auto It() const -> uint64_t
Iteration count accessor.
auto Itr() -> uint64_t&
Non-const-ref refinement iteration count accessor.
auto Timer() const -> const tk::Timer&
Timer accessor as const-ref.
auto Timer() -> tk::Timer&
Timer accessor as non-const-ref.
auto LastFieldWriteTime() const -> tk::real
Time at which field output happened last accessor as const-ref.
auto LastFieldWriteTime() -> tk::real&
Time at which field output happened last accessor as non-const-ref.
auto Tr() const -> const CProxy_Transporter&
Transporter proxy accessor as const-ref.
auto Tr() -> CProxy_Transporter&
Transporter proxy accessor as non-const-ref.
auto Ref() const -> Refiner*
Access bound Refiner class pointer.
auto FCT() const -> DistFCT*
Access bound DistFCT class pointer.
auto Bid() const -> const std::unordered_map<std::size_t, std::size_t>&
Boundary node ids accessor as const-ref.
auto Bid() -> std::unordered_map<std::size_t, std::size_t>&
Boundary node ids accessor as non-const-ref.
auto Msum() const -> const std::unordered_map<int, std::vector<std::size_t>>&
Nodal communication map accessor as const-ref.
auto Msum() -> std::unordered_map<int, std::vector<std::size_t>>&
Nodal communication map accessor as non-const-ref.
auto Psup() const -> const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>&
Points surrounding points accessor as const-ref.
auto Psup() -> std::pair<std::vector<std::size_t>, std::vector<std::size_t>>&
Points surrounding points accessor as non-const-ref.

Charm++ pack/unpack serializer member functions

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

Function documentation

static void inciter::Discretization::registerReducers()

Configure Charm++ reduction types.

Since this is a [nodeinit] routine, see cg.ci, the Charm++ 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.

inciter::Discretization::Discretization(const CProxy_DistFCT& fctproxy, const CProxy_Transporter& transporter, const std::vector<std::size_t>& conn, const tk::UnsMesh::CoordMap& coordmap, const std::map<int, std::unordered_set<std::size_t>>& msum, int nchare) explicit

Constructor.

Parameters
fctproxy in Distributed FCT proxy
transporter in Host (Transporter) proxy
conn in Vector of mesh element connectivity owned (global IDs)
coordmap in Coordinates of mesh nodes and their global IDs
msum in Global mesh node IDs associated to chare IDs bordering the mesh chunk we operate on
nchare in Total number of Discretization chares

"Contiguous-row-id" here means that the numbering of the mesh nodes (which corresponds to rows in the linear system) are (approximately) contiguous (as much as this can be done with an unstructured mesh) as the problem is distirbuted across PEs, held by Solver objects. This ordering is in start contrast with "as-in-file" ordering, which is the ordering of the mesh nodes as it is stored in the file from which the mesh is read in. The as-in-file ordering is highly non-contiguous across the distributed problem.

void inciter::Discretization::resize(const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<int, std::vector<std::size_t>>& msum)

Resize mesh data structures (e.g., after mesh refinement)

Parameters
chunk in New mesh chunk (connectivity and global<->local id maps)
coord in New mesh node coordinates
msum in New node communication map

void inciter::Discretization::setRefiner(const CProxy_Refiner& ref)

Set Refiner Charm++ proxy.

Parameters
ref in Incoming refiner proxy to store

void inciter::Discretization::comvol(const std::vector<std::size_t>& gid, const std::vector<tk::real>& nodevol)

Collect nodal volumes across chare boundaries.

Parameters
gid in Global mesh node IDs at which we receive volume contributions
nodevol in Partial sums of nodal volume contributions to chare-boundary nodes

This function receives contributions to m_vol, which stores the nodal volumes. While m_vol stores own contributions, m_volc collects the neighbor chare contributions during communication. This way work on m_vol and m_volc is overlapped. The two are combined in totalvol().

void inciter::Discretization::writeMesh(const std::map<int, std::vector<std::size_t>>& bface, const std::vector<std::size_t>& triinpoel, const std::map<int, std::vector<std::size_t>>& bnode)

Output chare element blocks to output file.

Parameters
bface in Map of boundary-face lists mapped to corresponding side set ids for this mesh chunk
triinpoel in Interconnectivity of points and boundary-face in this mesh chunk
bnode in Map of boundary-node lists mapped to corresponding side set ids for this mesh chunk

void inciter::Discretization::writeNodeSolution(const tk::ExodusIIMeshWriter& ew, uint64_t it, const std::vector<std::vector<tk::real>>& u) const

Output solution to file.

Parameters
ew in ExodusII mesh-based writer object
it in Iteration count
in Vector of fields to write to file

void inciter::Discretization::writeNodeSolution(const tk::RootMeshWriter& rmw, uint64_t it, const std::vector<std::vector<tk::real>>& u) const

Parameters
rmw in Root mesh-based writer object
it in Iteration count
in Vector of fields to write to file

void inciter::Discretization::writeElemSolution(const tk::ExodusIIMeshWriter& ew, uint64_t it, const std::vector<std::vector<tk::real>>& u, const std::vector<std::vector<tk::real>>& v) const

Parameters
ew in ExodusII mesh-based writer object
it in Iteration count
in Vector of element fields to write to file
in Vector of node fields to write to file

void inciter::Discretization::setdt(tk::real newdt)

Set time step size.

Parameters
newdt in Size of the new time step

std::string inciter::Discretization::filename() const

Compute ExodusII filename.

Returns Filename computed

We use a file naming convention for large field output data that allows ParaView to glue multiple files into a single simulation output by only loading a single file. The base filename is followed by ".e-s.", which probably stands for Exodus Sequence, followed by 3 integers: (1) {RS}: counts the number of "restart dumps", but we use this for counting the number of outputs with a different mesh, e.g., due to mesh refinement, thus if this first number is new the mesh is new compared to the previous (first) number afer ".e-s.", (2) {NP}: total number of partitions (workers, chares), this is more than the number of PEs with nonzero virtualization (overdecomposition), and (3) {RANK}: worker (chare) id. Thus {RANK} does spatial partitioning, while {RS} partitions in time, but a single {RS} id may contain multiple time steps, which equals to the number of time steps at which field output is saved without refining the mesh.

const tk::UnsMesh::Coords& inciter::Discretization::Coord() const

Coordinates accessors as const-ref

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

Pack/Unpack serialize member function.

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

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

Pack/Unpack serialize operator|.

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