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() explicit
Constructor.

Public functions

void IcBoxNodes(const tk::UnsMesh::Coords&, const std::vector<std::size_t>&, const std::unordered_map<std::size_t, std::set<std::size_t>>&, std::vector<std::unordered_set<std::size_t>>&, std::unordered_map<std::size_t, std::set<std::size_t>>&, 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::vector<std::unordered_set<std::size_t>>&, const std::vector<tk::real>&, const std::unordered_map<std::size_t, std::set<std::size_t>>&) const
void velocity(const tk::Fields&, tk::UnsMesh::Coords&) const
void soundspeed(const tk::Fields&, std::vector<tk::real>&) 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>& symbctri, const std::vector<real>& vol, const std::vector<std::size_t>&, const std::vector<std::size_t>& edgeid, const std::vector<std::unordered_set<std::size_t>>&, const tk::Fields& G, const tk::Fields& U, ] const tk::Fields& W, const std::vector<tk::real>&, real, tk::Fields& R) const
void getMeshVel(real, const std::array<std::vector<real>, 3>&, const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>&, const std::unordered_set<std::size_t>&, const std::array<tk::real, 3>&, const tk::Fields&, tk::Fields&, int&) const
Compute overset mesh motion for OversetFE (no-op for transport)
auto dt(const std::array<std::vector<real>, 3>& coord, const std::vector<std::size_t>& inpoel, tk::real t, tk::real, const tk::Fields& U, const std::vector<tk::real>&, const std::vector<tk::real>&) 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 (for steady time stepping)
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, bool increment) 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.
void timedepbc(tk::real, tk::Fields&, const std::vector<std::unordered_set<std::size_t>>&, const std::vector<tk::Table<5>>&) const
Apply user defined time dependent BCs (no-op for transport)
auto OutVarFn() const -> std::map<std::string, tk::GetVarFn>
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>>&, const tk::Fields&) const -> std::vector<std::vector<real>>
Return nodal surface field output going to file.
auto elemSurfOutput(const std::map<int, std::vector<std::size_t>>&, const std::vector<std::size_t>&, const tk::Fields&) const -> std::vector<std::vector<real>>
Return elemental surface field output (on triangle faces) 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>
void inciter::cg::Transport<Physics, Problem>::initialize(const std::array<std::vector<real>, 3>& coord, tk::Fields& unk, real t, real, const std::vector<std::unordered_set<std::size_t>>&, const std::vector<tk::real>&, const std::unordered_map<std::size_t, std::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>
void inciter::cg::Transport<Physics, Problem>::velocity(const tk::Fields&, tk::UnsMesh::Coords&) const

Query a velocity

template<class Physics, class Problem>
void inciter::cg::Transport<Physics, Problem>::soundspeed(const tk::Fields&, std::vector<tk::real>&) const

Query the sound speed

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>& symbctri, const std::vector<real>& vol, const std::vector<std::size_t>&, const std::vector<std::size_t>& edgeid, const std::vector<std::unordered_set<std::size_t>>&, const tk::Fields& G, const tk::Fields& U, ] const tk::Fields& W, 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 in Elements surrounding points
symbctri 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 Mesh velocity
in/out Right-hand side vector computed

Compute right hand side for ALECG

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, tk::real, const tk::Fields& U, const std::vector<tk::real>&, const std::vector<tk::real>&) 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 (for unsteady time stepping)

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, bool increment) 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
increment in If true, evaluate the solution increment between t and t+dt for Dirichlet BCs. If false, evlauate the solution instead.
Returns Vector of pairs of bool and boundary condition value associated to mesh node IDs at which Dirichlet boundary conditions are set. Note that if increment is true, instead of the actual boundary condition value, we return the increment between t+deltat and t, since, depending on client code and solver, that may be what the solution requires.

template<class Physics, class Problem>
std::map<std::string, tk::GetVarFn> inciter::cg::Transport<Physics, Problem>::OutVarFn() const

Returns Map that associates user-specified strings to functions that compute relevant quantities to be output to file

Return a map that associates user-specified strings to functions

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

Return surface field names to be output to file This functions should be written in conjunction with surfOutput(), which provides the vector of surface fields to be output

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