inciter::Refiner class

Mesh refiner for interfacing the mesh refinement library.

Public types

enum class RefMode: std::size_t { T0REF = 1, DTREF, OUTREF, OUTDEREF }
Mode of operation: the way Refiner is used.

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 query(int fromch, const EdgeSet& edges)
Incoming query for a list boundary edges for which this chare compiles shared edges.
void recvquery()
Receive receipt of boundary edge lists to quer.
void response()
Respond to boundary edge list queries.
void bnd(int fromch, const std::vector<int>& chares)
Receive shared boundary edges for our mesh chunk.
void recvbnd()
Receive receipt of shared boundary edges.
void reorder()
Query Sorter and update local mesh with the reordered one.
void start()
Start new step of initial mesh refinement/derefinement.
void next()
Continue after finishing a refinemen/derefinementt 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 outref(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, CkCallback c, RefMode mode = RefMode::OUTREF)
Start mesh refinement (for field output)
void refine()
Do a single step of mesh refinemen/derefinementt (only tag edges)
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/derefinement step.
void perform()
Perform mesh refinement and decide how to continue.
void sendProxy()
Send Refiner proxy to Discretization objects.
auto refinementFields() const -> std::tuple<std::vector<std::string>, std::vector<std::vector<tk::real>>, 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|.

Enum documentation

enum class inciter::Refiner::RefMode: std::size_t

Mode of operation: the way Refiner is used.

Enumerators
T0REF

Initial (t<0) refinement.

DTREF

During time stepping (t>0)

OUTREF

Refinement for field output.

OUTDEREF

Function documentation

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::query(int fromch, const EdgeSet& edges)

Incoming query for a list boundary edges for which this chare compiles shared edges.

Parameters
fromch in Sender chare ID
edges in Chare-boundary edge list from another chare

void inciter::Refiner::bnd(int fromch, const std::vector<int>& chares)

Receive shared boundary edges for our mesh chunk.

Parameters
fromch in Sender chare ID
chares in Chare ids we share edges with

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::outref(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, CkCallback c, RefMode mode = RefMode::OUTREF)

Start mesh refinement (for field output)

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
in Function to continue with after the writing field output
mode in Refinement mode

void inciter::Refiner::refine()

Do a single step of mesh refinemen/derefinementt (only tag edges)

During initial (t<0, t0ref) 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 (t>0, dtref) mesh refinement this is called once, as we only do a single step during time stepping.

During field-output (outref) mesh refinement, this may be called multiple times, depending the number of refinement levels needed for the field output.

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::perform()

Perform mesh refinement and decide how to continue.

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>>, std::vector<std::string>, std::vector<std::vector<tk::real>>> inciter::Refiner::refinementFields() const

Get refinement field data in mesh cells.

Returns Names and fields of mesh refinement data in mesh cells and nodes

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