inciter::DGPDE class

Partial differential equation base for discontinuous Galerkin PDEs.

This class uses runtime polymorphism without client-side inheritance: inheritance is confined to the internals of the this class, invisible to client-code. The class exclusively deals with ownership enabling client-side value semantics. Credit goes to Sean Parent at Adobe: https://github.com/sean-parent/sean-parent.github.com/wiki/ Papers-and-Presentations. For example client code that models a DGPDE, see inciter::CompFlow.

Constructors, destructors, conversion operators

DGPDE() defaulted explicit
Default constructor taking no arguments for Charm++.
template<typename T>
DGPDE(T x) explicit
Constructor taking an object modeling Concept.
template<typename T, typename... Args>
DGPDE(std::function<T(Args...)> x, Args&&... args) explicit
Constructor taking a function pointer to a constructor of an object modeling Concept.
DGPDE(const DGPDE& x)
Copy constructor.
DGPDE(DGPDE&&) noexcept defaulted
Move constructor.

Public functions

auto nprim() const -> std::size_t
Public interface to find number of primitive quantities for the diff eq.
auto nmat() const -> std::size_t
Public interface to find number of materials for the diff eq.
void numEquationDofs(std::vector<std::size_t>& numEqDof) const
Public interface to find Dofs for each equation in pde system.
auto nstiffeq() const -> std::size_t
auto nnonstiffeq() const -> std::size_t
void setStiffEqIdx(std::vector<std::size_t>& stiffEqIdx) const
Public function to locate the stiff equations.
void setNonStiffEqIdx(std::vector<std::size_t>& nonStiffEqIdx) const
Public function to locate the nonstiff equations.
void IcBoxElems(const tk::Fields& geoElem, std::size_t nielem, std::vector<std::unordered_set<std::size_t>>& inbox) const
Public interface to determine elements that lie inside the IC box.
void initialize(const tk::Fields& L, const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, const std::vector<std::unordered_set<std::size_t>>& inbox, const std::unordered_map<std::size_t, std::set<std::size_t>>& elemblkid, tk::Fields& unk, tk::real t, const std::size_t nielem) const
Public interface to setting the initial conditions for the diff eq.
void computeDensityConstr(std::size_t nelem, tk::Fields& unk, std::vector<tk::real>& densityConstr) const
Public interface for computing density constraint.
void lhs(const tk::Fields& geoElem, tk::Fields& l) const
Public interface to computing the left-hand side matrix for the diff eq.
void updateInterfaceCells(tk::Fields& unk, std::size_t nielem, std::vector<std::size_t>& ndofel, std::vector<std::size_t>& interface) const
Public interface to updating the interface cells for the diff eq.
void updatePrimitives(const tk::Fields& unk, const tk::Fields& L, const tk::Fields& geoElem, tk::Fields& prim, std::size_t nielem, std::vector<std::size_t>& ndofel) const
Public interface to updating the primitives for the diff eq.
void cleanTraceMaterial(tk::real t, const tk::Fields& geoElem, tk::Fields& unk, tk::Fields& prim, std::size_t nielem) const
Public interface to cleaning up trace materials for the diff eq.
void reconstruct(tk::real t, const tk::Fields& geoFace, const tk::Fields& geoElem, const inciter::FaceData& fd, const std::map<std::size_t, std::vector<std::size_t>>& esup, const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, tk::Fields& U, tk::Fields& P, const bool pref, const std::vector<std::size_t>& ndofel) const
Public interface to reconstructing the second-order solution.
void limit(tk::real t, const bool pref, const tk::Fields& geoFace, const tk::Fields& geoElem, const inciter::FaceData& fd, const std::map<std::size_t, std::vector<std::size_t>>& esup, const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, const std::vector<std::size_t>& ndofel, const std::vector<std::size_t>& gid, const std::unordered_map<std::size_t, std::size_t>& bid, const std::vector<std::vector<tk::real>>& uNodalExtrm, const std::vector<std::vector<tk::real>>& pNodalExtrm, const std::vector<std::vector<tk::real>>& mtInv, tk::Fields& U, tk::Fields& P, std::vector<std::size_t>& shockmarker) const
Public interface to limiting the second-order solution.
void CPL(const tk::Fields& prim, const tk::Fields& geoElem, const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, tk::Fields& unk, std::size_t nielem) const
Public interface to update the conservative variable solution.
void resetAdapSol(const inciter::FaceData& fd, tk::Fields& unk, tk::Fields& prim, const std::vector<std::size_t>& ndofel) const
Public interface to reset the high order solution for p-adaptive scheme.
auto cellAvgDeformGrad(const tk::Fields& U, std::size_t nielem) const -> std::array<std::vector<tk::real>, 9>
Public interface to getting the cell-averaged deformation gradients.
void rhs(tk::real t, const bool pref, const tk::Fields& geoFace, const tk::Fields& geoElem, const inciter::FaceData& fd, const std::vector<std::size_t>& inpoel, const std::vector<std::unordered_set<std::size_t>>& boxelems, const tk::UnsMesh::Coords& coord, const tk::Fields& U, const tk::Fields& P, const std::vector<std::size_t>& ndofel, const tk::real dt, tk::Fields& R) const
Public interface to computing the P1 right-hand side vector.
void eval_ndof(std::size_t nunk, const tk::UnsMesh::Coords& coord, const std::vector<std::size_t>& inpoel, const inciter::FaceData& fd, const tk::Fields& unk, const tk::Fields& prim, inciter::ctr::PrefIndicatorType indicator, std::size_t ndof, std::size_t ndofmax, tk::real tolref, std::vector<std::size_t>& ndofel) const
Evaluate the adaptive indicator and mark the ndof for each element.
auto dt(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const inciter::FaceData& fd, const tk::Fields& geoFace, const tk::Fields& geoElem, const std::vector<std::size_t>& ndofel, const tk::Fields& U, const tk::Fields& P, const std::size_t nielem) const -> tk::real
Public interface for computing the minimum time step size.
void stiff_rhs(std::size_t e, const tk::Fields& geoElem, const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, const tk::Fields& U, const tk::Fields& P, const std::vector<std::size_t>& ndofel, tk::Fields& R) const
Public interface for computing stiff terms for an element.
auto OutVarFn() const -> std::map<std::string, tk::GetVarFn>
Public interface to returning maps of output var functions.
auto analyticFieldNames() const -> std::vector<std::string>
Public interface to returning analytic field output labels.
auto histNames() const -> std::vector<std::string>
Public interface to returning time history field output labels.
auto names() const -> std::vector<std::string>
Public interface to returning variable names.
auto surfOutput(const std::map<int, std::vector<std::size_t>>& bnd, tk::Fields& U) const -> std::vector<std::vector<tk::real>>
Public interface to returning surface field output.
auto histOutput(const std::vector<HistData>& h, const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, const tk::Fields& U, const tk::Fields& P) const -> std::vector<std::vector<tk::real>>
Public interface to return point history output.
auto analyticSolution(tk::real xi, tk::real yi, tk::real zi, tk::real t) const -> tk::InitializeFn::result_type
Public interface to returning analytic solution.
auto solution(tk::real xi, tk::real yi, tk::real zi, tk::real t) const -> tk::InitializeFn::result_type
Public interface to returning the analytic solution for conserved vars.
auto sp_totalenergy(std::size_t e, const tk::Fields& unk) const -> tk::real
Public interface to returning the specific total energy.
auto operator=(const DGPDE& x) -> DGPDE&
Copy assignment.
auto operator=(DGPDE&&) noexcept -> DGPDE& defaulted
Move assignment.

Function documentation

template<typename T>
inciter::DGPDE::DGPDE(T x) explicit

Constructor taking an object modeling Concept.

Parameters
in Instantiated object of type T given by the template argument.

The object of class T comes pre-constructed.

template<typename T, typename... Args>
inciter::DGPDE::DGPDE(std::function<T(Args...)> x, Args&&... args) explicit

Constructor taking a function pointer to a constructor of an object modeling Concept.

Parameters
in Function pointer to a constructor of an object modeling Concept.
args in Zero or more constructor arguments

Passing std::function allows late execution of the constructor, i.e., as late as inside this class' constructor, and thus usage from a factory. Note that there are at least two different ways of using this constructor:

  • Bind T's constructor arguments and place it in std::function<T()> and passing no arguments as args.... This case then instantiates the model via its constructor and stores it in here.
  • Bind a single placeholder argument to T's constructor and pass it in as host's args..., which then forwards it to model's constructor. This allows late binding, i.e., binding the argument only here.

std::size_t inciter::DGPDE::nstiffeq() const

Public interface to find how 'stiff equations', which are the inverse deformation equations because of plasticity

std::size_t inciter::DGPDE::nnonstiffeq() const

Public interface to find how 'nonstiff equations', which are the inverse deformation equations because of plasticity