inciter::CGPDE class

Partial differential equation base for continuous 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 CGPDE, see inciter::CompFlow.

Constructors, destructors, conversion operators

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

Public functions

void initialize(const std::array<std::vector<tk::real>, 3>& coord, tk::Fields& unk, tk::real t) const
Public interface to setting the initial conditions for the diff eq.
void lhs(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>& psup, tk::Fields& lhsd, tk::Fields& lhso) const
Public interface to computing the left-hand side matrix for the diff eq.
void rhs(tk::real t, tk::real deltat, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const tk::Fields& U, tk::Fields& Ue, tk::Fields& R) const
Public interface to computing the right-hand side vector for the diff eq.
auto dt(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const tk::Fields& U) const -> tk::real
Public interface for computing the minimum time step size.
void side(std::unordered_set<int>& conf) const
Public interface for collecting all side set IDs the user has configured for all components of a PDE system.
auto dirbc(tk::real t, tk::real deltat, const std::pair<const int, std::vector<std::size_t>>& sides, const std::array<std::vector<tk::real>, 3>& coord) const -> std::map<std::size_t, std::vector<std::pair<bool, tk::real>>>
Public interface for querying Dirichlet boundary condition values set by the user on a given side set for all components in a PDE system.
auto fieldNames() const -> std::vector<std::string>
Public interface to returning field output labels.
auto names() const -> std::vector<std::string>
Public interface to returning variable names.
auto fieldOutput(tk::real t, tk::real V, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<tk::real>& v, tk::Fields& U) const -> std::vector<std::vector<tk::real>>
Public interface to returning field output.
auto analyticSolution(tk::real xi, tk::real yi, tk::real zi, tk::real t) const -> std::vector<tk::real>
Public interface to returning analytic solution.
auto operator=(const CGPDE& x) -> CGPDE&
Copy assignment.
auto operator=(CGPDE&&) noexcept -> CGPDE& defaulted
Move assignment.

Function documentation

template<typename T>
inciter::CGPDE::CGPDE(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::CGPDE::CGPDE(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.