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

CompFlow used polymorphically with tk::CGPDE.

The template arguments specify policies and are used to configure the behavior of the class. The policies are:

  • Physics - physics configuration, see PDE/CompFlow/Physics.h
  • Problem - problem configuration, see PDE/CompFlow/Problems.h

Constructors, destructors, conversion operators

CompFlow(ncomp_t c) explicit
Constructor.

Public functions

void IcBoxNodes(const tk::UnsMesh::Coords& coord, std::unordered_set<std::size_t>& inbox) const
void initialize(const std::array<std::vector<real>, 3>& coord, tk::Fields& unk, real t, real V, const std::unordered_set<std::size_t>& inbox) 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 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
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
Compute nodal gradients of primitive variables for ALECG along chare-boundary.
void rhs(real t, 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>& gid, 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>& edgenode, const std::vector<std::size_t>& edgeid, const std::unordered_set<std::size_t>& boxnodes, const tk::Fields& G, const tk::Fields& U, const std::vector<tk::real>& tp, real V, 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>& vol, const tk::Fields& U, std::vector<tk::real>& dtp) const
auto velocity(const tk::Fields& U, const std::array<std::vector<real>, 3>&, const std::array<std::size_t, 4>& N) const -> std::array<std::array<real, 4>, 3>
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& U, const std::array<std::vector<real>, 3>& coord, const std::unordered_map<int, std::unordered_map<std::size_t, std::array<real, 4>>>& bnorm, const std::unordered_set<std::size_t>& nodes) const
void farfieldbc(tk::Fields& U, const std::array<std::vector<real>, 3>& coord, const std::unordered_map<int, std::unordered_map<std::size_t, std::array<real, 4>>>& bnorm, const std::unordered_set<std::size_t>& nodes) const
auto analyticFieldNames() const -> std::vector<std::string>
auto surfNames() const -> std::vector<std::string>
auto histNames() const -> std::vector<std::string>
auto surfOutput(const std::map<int, std::vector<std::size_t>>& bnd, tk::Fields& U) const -> std::vector<std::vector<real>>
Return surface field output going to file.
auto histOutput(const std::vector<HistData>& h, const std::vector<std::size_t>& inpoel, const tk::Fields& U) 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::CompFlow<Physics, Problem>::CompFlow(ncomp_t c) explicit

Constructor.

Parameters
in Equation system index (among multiple systems configured)

template<class Physics, class Problem>
void inciter::cg::CompFlow<Physics, Problem>::IcBoxNodes(const tk::UnsMesh::Coords& coord, std::unordered_set<std::size_t>& inbox) const

Parameters
coord in Mesh node coordinates
inbox in/out List of nodes at which box user ICs are set

Determine nodes that lie inside the user-defined IC box

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

Parameters
coord in Mesh node coordinates
unk in/out Array of unknowns
in Physical time
in Discrete volume of user-defined IC box
inbox in List of nodes at which box user ICs are set

Initalize the compressible flow equations, prepare for time integration

template<class Physics, class Problem>
std::vector<real> inciter::cg::CompFlow<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::CompFlow<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::CompFlow<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>
void inciter::cg::CompFlow<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

Compute nodal gradients of primitive variables for ALECG along chare-boundary.

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

This function only computes local contributions to gradients at chare-boundary nodes. Internal node gradients are calculated as required, and do not need to be stored.

template<class Physics, class Problem>
void inciter::cg::CompFlow<Physics, Problem>::rhs(real t, 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>& gid, 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>& edgenode, const std::vector<std::size_t>& edgeid, const std::unordered_set<std::size_t>& boxnodes, const tk::Fields& G, const tk::Fields& U, const std::vector<tk::real>& tp, real V, tk::Fields& R) const

Parameters
in Physical time
coord in Mesh node coordinates
inpoel in Mesh element connectivity
triinpoel in Boundary triangle face connecitivity with local ids
gid in Local->glocal node ids
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 boundary triangles
vol in Nodal volumes
edgenode in Local node IDs of edges
edgeid in Edge ids in the order of access
boxnodes in Mesh node ids within user-defined box
in Nodal gradients
in Solution vector at recent time step
tp in Physical time for each mesh node
in Total box volume
in/out Right-hand side vector computed

Compute right hand side for ALECG

template<class Physics, class Problem>
real inciter::cg::CompFlow<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>
void inciter::cg::CompFlow<Physics, Problem>::dt(uint64_t, const std::vector<tk::real>& vol, const tk::Fields& U, std::vector<tk::real>& dtp) const

Parameters
vol in Nodal volume (with contributions from other chares)
in Solution vector at recent time step
dtp in/out Time step size for each mesh node

Compute a time step size for each mesh node

template<class Physics, class Problem>
std::array<std::array<real, 4>, 3> inciter::cg::CompFlow<Physics, Problem>::velocity(const tk::Fields& U, const std::array<std::vector<real>, 3>&, const std::array<std::size_t, 4>& N) const

Parameters
in Solution vector at recent time step
in Element node indices
Returns Array of the four values of the velocity field

Extract the velocity field at cell nodes. Currently unused.

template<class Physics, class Problem>
std::map<std::size_t, std::vector<std::pair<bool, real>>> inciter::cg::CompFlow<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 (local) 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+deltat 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>
void inciter::cg::CompFlow<Physics, Problem>::symbc(tk::Fields& U, const std::array<std::vector<real>, 3>& coord, const std::unordered_map<int, std::unordered_map<std::size_t, std::array<real, 4>>>& bnorm, const std::unordered_set<std::size_t>& nodes) const

Parameters
in Solution vector at recent time step
coord in Mesh node coordinates
bnorm in Face normals in boundary points, key local node id, first 3 reals of value: unit normal, outer key: side set id
nodes in Unique set of node ids at which to set symmetry BCs

Set symmetry boundary conditions at nodes

template<class Physics, class Problem>
void inciter::cg::CompFlow<Physics, Problem>::farfieldbc(tk::Fields& U, const std::array<std::vector<real>, 3>& coord, const std::unordered_map<int, std::unordered_map<std::size_t, std::array<real, 4>>>& bnorm, const std::unordered_set<std::size_t>& nodes) const

Parameters
in Solution vector at recent time step
coord in Mesh node coordinates
bnorm in Face normals in boundary points, key local node id, first 3 reals of value: unit normal, outer key: side set id
nodes in Unique set of node ids at which to set farfield BCs

Set farfield boundary conditions at nodes

template<class Physics, class Problem>
std::vector<std::string> inciter::cg::CompFlow<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::CompFlow<Physics, Problem>::surfNames() const

Returns Vector of strings labelling surface fields output in file

Return surface field names to be output to file

template<class Physics, class Problem>
std::vector<std::string> inciter::cg::CompFlow<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::CompFlow<Physics, Problem>::names() const

Returns Vector of strings labelling integral variables output

Return names of integral variables to be output to diagnostics file