inciter::Refiner class

Mesh refiner for interfacing the mesh refinement library.

Public static functions

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

Constructors, destructors, conversion operators

Refiner(const CProxy_Transporter& transporter, const CProxy_Sorter& sorter, const tk::CProxy_MeshWriter& meshwriter, const Scheme& scheme, const tk::RefinerCallback& cbr, const tk::SorterCallback& cbs, const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::CoordMap& coordmap, 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, int nchare) explicit
Constructor.
Refiner(CkMigrateMessage*) explicit
Migrate constructor.

Public functions

void reorder()
Query Sorter and update local mesh with the reordered one.
void start()
Start new step of initial mesh refinement.
void next()
Continue after finishing a refinement step.
void dtref(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)
Start mesh refinement (during time stepping, t>0)
void addBndEdges(CkReductionMsg* msg)
Receive boundary edges from all PEs (including this one)
void refine()
Refine mesh.
void addRefBndEdges(int fromch, const AMR::EdgeData& ed, const std::unordered_set<size_t>& intermediates)
Receive newly added mesh edges and locks on our chare boundary.
void correctref()
Correct refinement to arrive at conforming mesh across chare boundaries.
void comExtra()
Communicate refined edges after a refinement step.
void eval()
Decide what to do after a mesh refinement step.
void sendProxy()
Send Refiner proxy to Discretization objects.
auto refinementFields() const -> std::tuple<std::vector<std::string>, std::vector<std::vector<tk::real>>>
Get refinement field data in mesh cells.

Charm++ pack/unpack serializer member functions

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

Function documentation

static void inciter::Refiner::registerReducers()

Configure Charm++ reduction types.

Since this is a [nodeinit] 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.

inciter::Refiner::Refiner(const CProxy_Transporter& transporter, const CProxy_Sorter& sorter, const tk::CProxy_MeshWriter& meshwriter, const Scheme& scheme, const tk::RefinerCallback& cbr, const tk::SorterCallback& cbs, const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::CoordMap& coordmap, 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, int nchare) explicit

Constructor.

Parameters
transporter in Transporter (host) proxy
sorter in Mesh reordering (sorter) proxy
meshwriter in Mesh writer proxy
scheme in Discretization scheme
cbr in Charm++ callbacks for Refiner
cbs in Charm++ callbacks for Sorter
ginpoel in Mesh connectivity (this chare) using global node IDs
coordmap in Mesh node coordinates (this chare) for global node IDs
bface in File-internal elem ids of side sets
triinpoel in Triangle face connectivity with global IDs
bnode in Node lists of side sets
nchare in Total number of refiner chares (chare array elements)

void inciter::Refiner::dtref(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)

Start mesh refinement (during time stepping, t>0)

Parameters
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::Refiner::addBndEdges(CkReductionMsg* msg)

Receive boundary edges from all PEs (including this one)

Parameters
msg in Charm++ message containing the aggregated map of bnd edges

Receive boundary edges from all refiner chares (including this one)

void inciter::Refiner::refine()

Refine mesh.

During initial (t<0) mesh refinement, this is a single step in a potentially multiple-entry list of initial adaptive mesh refinement steps. Distribution of the chare-boundary edges must have preceded this step, so that boundary edges (shared by multiple chares) can agree on a refinement that yields a conforming mesh across chare boundaries. During-timestepping (dtref) mesh refinement this is called once, as we only do a single step during time stepping.

void inciter::Refiner::addRefBndEdges(int fromch, const AMR::EdgeData& ed, const std::unordered_set<size_t>& intermediates)

Receive newly added mesh edges and locks on our chare boundary.

Parameters
fromch in Chare call coming from
ed in Edges on chare boundary
intermediates in Intermediate nodes

Receive edges on our chare boundary from other chares

void inciter::Refiner::correctref()

Correct refinement to arrive at conforming mesh across chare boundaries.

This function is called repeatedly until there is not a a single edge that needs correction for the whole distributed problem to arrive at a conforming mesh across chare boundaries during a mesh refinement step.

void inciter::Refiner::eval()

Decide what to do after a mesh refinement step.

First the mesh refiner object is called to perform a single step of mesh refinement. Then, if this function is called during a step (potentially multiple levels of) initial AMR, it evaluates whether to do another one. If it is called during time stepping, this concludes the single mesh refinement step and the new mesh is sent to the PDE worker (Discretization).

void inciter::Refiner::sendProxy()

Send Refiner proxy to Discretization objects.

This should be called when bound Discretization chare array elements have already been created.

std::tuple<std::vector<std::string>, std::vector<std::vector<tk::real>>> inciter::Refiner::refinementFields() const

Get refinement field data in mesh cells.

Returns The names and fields of mesh refinement data in mesh cells, ready for file output

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

Pack/Unpack serialize member function.

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

void inciter::Refiner::operator|(PUP::er& p, Refiner& r)

Pack/Unpack serialize operator|.

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