template<class Physics, class Problem>
inciter::cg::Transport class

Transport equation used polymorphically with tk::CGPDE.

The template argument(s) specify policies and are used to configure the behavior of the class. The policies are:

  • Physics - physics configuration, see PDE/Transport/Physics/CG.h
  • Problem - problem configuration, see PDE/Transport/Problem.h

Constructors, destructors, conversion operators

Transport(ncomp_t c) explicit

Public functions

void IcBoxNodes(const tk::UnsMesh::Coords&, std::unordered_set<std::size_t>&) const
Determine nodes that lie inside the user-defined IC box.
void initialize(const std::array<std::vector<real>, 3>& coord, tk::Fields& unk, real t, real, const std::unordered_set<std::size_t>&) const
auto analyticSolution(real xi, real yi, real zi, real t) const -> std::vector<real>
auto solution(tk::real xi, tk::real yi, tk::real zi, tk::real t) const -> std::vector<tk::real>
void chBndGrad(const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::vector<std::size_t>& bndel, const std::vector<std::size_t>& gid, const std::unordered_map<std::size_t, std::size_t>& bid, const tk::Fields& U, tk::Fields& G) const
void rhs(real, const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::vector<std::size_t>& triinpoel, const std::vector<std::size_t>&, const std::unordered_map<std::size_t, std::size_t>& bid, const std::unordered_map<std::size_t, std::size_t>& lid, const std::vector<real>& dfn, const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>& psup, const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>& esup, const std::vector<int>& symbcnode, const std::vector<real>& vol, const std::vector<std::size_t>&, const std::vector<std::size_t>& edgeid, const std::unordered_set<std::size_t>&, const tk::Fields& G, const tk::Fields& U, const std::vector<tk::real>&, real, tk::Fields& R) const
void rhs(real t, real deltat, const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, const tk::Fields& U, tk::Fields& Ue, tk::Fields& R) const
auto dt(const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, tk::real t, const tk::Fields& U) const -> real
void dt(uint64_t, const std::vector<tk::real>&, const tk::Fields&, std::vector<tk::real>&) const
Compute a time step size for each mesh node.
auto dirbc(real t, real deltat, const std::vector<tk::real>& tp, const std::vector<tk::real>& dtp, const std::pair<const int, std::vector<std::size_t>>& ss, const std::array<std::vector<real>, 3>& coord) const -> std::map<std::size_t, std::vector<std::pair<bool, real>>>
Query Dirichlet boundary condition value on a given side set for all components in this PDE system.
void symbc(tk::Fields&, const std::array<std::vector<real>, 3>&, const std::unordered_map<int, std::unordered_map<std::size_t, std::array<real, 4>>>&, const std::unordered_set<std::size_t>&) const
Set symmetry boundary conditions at nodes.
void farfieldbc(tk::Fields&, const std::array<std::vector<real>, 3>&, const std::unordered_map<int, std::unordered_map<std::size_t, std::array<real, 4>>>&, const std::unordered_set<std::size_t>&) const
Set farfield boundary conditions at nodes.
auto analyticFieldNames() const -> std::vector<std::string>
auto surfNames() const -> std::vector<std::string>
auto surfOutput(const std::map<int, std::vector<std::size_t>>&, tk::Fields&) const -> std::vector<std::vector<real>>
Return surface field output going to file.
auto histNames() const -> std::vector<std::string>
auto histOutput(const std::vector<HistData>&, const std::vector<std::size_t>&, const tk::Fields&) const -> std::vector<std::vector<real>>
Return time history field output evaluated at time history points.
auto names() const -> std::vector<std::string>

Function documentation

template<class Physics, class Problem>
inciter::cg::Transport<Physics, Problem>::Transport(ncomp_t c) explicit

Parameters
in Equation system index (among multiple systems configured)

Constructor

template<class Physics, class Problem>
void inciter::cg::Transport<Physics, Problem>::initialize(const std::array<std::vector<real>, 3>& coord, tk::Fields& unk, real t, real, const std::unordered_set<std::size_t>&) const

Parameters
coord in Mesh node coordinates
unk in/out Array of unknowns
in Physical time

Initalize the transport equations using problem policy

template<class Physics, class Problem>
std::vector<real> inciter::cg::Transport<Physics, Problem>::analyticSolution(real xi, real yi, real zi, real t) const

Parameters
xi in X-coordinate
yi in Y-coordinate
zi in Z-coordinate
in Physical time
Returns Vector of analytic solution at given location and time

Return analytic solution (if defined by Problem) at xi, yi, zi, t

template<class Physics, class Problem>
std::vector<tk::real> inciter::cg::Transport<Physics, Problem>::solution(tk::real xi, tk::real yi, tk::real zi, tk::real t) const

Parameters
xi in X-coordinate at which to evaluate the analytic solution
yi in Y-coordinate at which to evaluate the analytic solution
zi in Z-coordinate at which to evaluate the analytic solution
in Physical time at which to evaluate the analytic solution
Returns Vector of analytic solution at given location and time

Return analytic solution for conserved variables

template<class Physics, class Problem>
void inciter::cg::Transport<Physics, Problem>::chBndGrad(const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::vector<std::size_t>& bndel, const std::vector<std::size_t>& gid, const std::unordered_map<std::size_t, std::size_t>& bid, const tk::Fields& U, tk::Fields& G) const

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
bndel in List of elements contributing to chare-boundary nodes
gid in Local->global node id map
bid in Local chare-boundary node ids (value) associated to global node ids (key)
in Solution vector at recent time step
in/out Nodal gradients of primitive variables

Compute nodal gradients of primitive variables for ALECG

template<class Physics, class Problem>
void inciter::cg::Transport<Physics, Problem>::rhs(real, const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::vector<std::size_t>& triinpoel, const std::vector<std::size_t>&, const std::unordered_map<std::size_t, std::size_t>& bid, const std::unordered_map<std::size_t, std::size_t>& lid, const std::vector<real>& dfn, const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>& psup, const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>& esup, const std::vector<int>& symbcnode, const std::vector<real>& vol, const std::vector<std::size_t>&, const std::vector<std::size_t>& edgeid, const std::unordered_set<std::size_t>&, const tk::Fields& G, const tk::Fields& U, const std::vector<tk::real>&, real, tk::Fields& R) const

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
triinpoel in Boundary triangle face connecitivity
bid in Local chare-boundary node ids (value) associated to global node ids (key)
lid in Global->local node ids
dfn in Dual-face normals
psup in Points surrounding points
esup
symbcnode in Vector with 1 at symmetry BC nodes
vol in Nodal volumes
edgeid in Local node id pair -> edge id map
in Nodal gradients in chare-boundary nodes
in Solution vector at recent time step
in/out Right-hand side vector computed

Compute right hand side for ALECG

template<class Physics, class Problem>
void inciter::cg::Transport<Physics, Problem>::rhs(real t, real deltat, const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, const tk::Fields& U, tk::Fields& Ue, tk::Fields& R) const

Parameters
in Physical time
deltat in Size of time step
coord in Mesh node coordinates
inpoel in Mesh element connectivity
in Solution vector at recent time step
Ue in/out Element-centered solution vector at intermediate step (used here internally as a scratch array)
in/out Right-hand side vector computed

Compute right hand side for DiagCG (CG+FCT)

template<class Physics, class Problem>
real inciter::cg::Transport<Physics, Problem>::dt(const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, tk::real t, const tk::Fields& U) const

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
in Physical time
in Solution vector at recent time step
Returns Minimum time step size

Compute the minimum time step size

template<class Physics, class Problem>
std::map<std::size_t, std::vector<std::pair<bool, real>>> inciter::cg::Transport<Physics, Problem>::dirbc(real t, real deltat, const std::vector<tk::real>& tp, const std::vector<tk::real>& dtp, const std::pair<const int, std::vector<std::size_t>>& ss, const std::array<std::vector<real>, 3>& coord) const

Query Dirichlet boundary condition value on a given side set for all components in this PDE system.

Parameters
in Physical time
deltat in Time step size
tp in Physical time for each mesh node
dtp in Time step size for each mesh node
ss in Pair of side set ID and list of node IDs on the side set
coord in Mesh node coordinates
Returns Vector of pairs of bool and boundary condition value associated to mesh node IDs at which Dirichlet boundary conditions are set. Note that instead of the actual boundary condition value, we return the increment between t+dt and t, since that is what the solution requires as we solve for the soution increments and not the solution itself.

template<class Physics, class Problem>
std::vector<std::string> inciter::cg::Transport<Physics, Problem>::analyticFieldNames() const

Returns Vector of strings labelling analytic fields output in file

Return analytic field names to be output to file

template<class Physics, class Problem>
std::vector<std::string> inciter::cg::Transport<Physics, Problem>::surfNames() const

Returns Vector of strings labelling surface fields output in file This functions should be written in conjunction with surfOutput(), which provides the vector of surface fields to be output

Return surface field names to be output to file

template<class Physics, class Problem>
std::vector<std::string> inciter::cg::Transport<Physics, Problem>::histNames() const

Returns Vector of strings labelling time history fields output in file

Return time history field names to be output to file

template<class Physics, class Problem>
std::vector<std::string> inciter::cg::Transport<Physics, Problem>::names() const

Returns Vector of strings labelling integral variables output

Return names of integral variables to be output to diagnostics file