template<class Physics, class Problem>
Transport class
Transport equation used polymorphically with tk::DGPDE.
Contents
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.h
Problem - problem configuration, see PDE/Transport/Problem.h
Constructors, destructors, conversion operators
- Transport() explicit
- Constructor.
Public functions
- auto nprim() const -> std::size_t
- auto nmat() const -> std::size_t
- void numEquationDofs(std::vector<std::size_t>& numEqDof) const
- auto nstiffeq() const -> std::size_t
- auto nnonstiffeq() const -> std::size_t
- void setStiffEqIdx(std::vector<std::size_t>& stiffEqIdx) const
- void setNonStiffEqIdx(std::vector<std::size_t>& nonStiffEqIdx) const
- void IcBoxElems(const tk::Fields&, std::size_t, std::vector<std::unordered_set<std::size_t>>&) const
- Determine elements that lie inside the user-defined 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>>&, const std::unordered_map<std::size_t, std::set<std::size_t>>&, tk::Fields& unk, tk:: real t, const std::size_t nielem) const -
void computeDensityConstr(std::size_t,
tk::Fields&,
std::vector<tk::
real>& densityConstr) const - Compute density constraint for a given material.
- void lhs(const tk::Fields& geoElem, tk::Fields& l) const
- void updateInterfaceCells(tk::Fields&, std::size_t, std::vector<std::size_t>&, std::vector<std::size_t>&) const
- void updatePrimitives(const tk::Fields&, const tk::Fields&, const tk::Fields&, tk::Fields&, std::size_t, std::vector<std::size_t>&) const
-
void cleanTraceMaterial(tk::
real, const tk::Fields&, tk::Fields&, tk::Fields&, std::size_t) const -
void reconstruct(tk::
real, const tk::Fields&, const tk::Fields&, const inciter:: FaceData&, const std::map<std::size_t, std::vector<std::size_t>>&, const std::vector<std::size_t>&, const tk:: UnsMesh:: Coords&, tk::Fields&, tk::Fields&, const bool, const std::vector<std::size_t>&) const - Reconstruct second-order solution from first-order.
-
void limit(] tk::
real t, ] const bool pref, ] const tk::Fields& geoFace, const tk::Fields&, 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>&, const std::unordered_map<std::size_t, std::size_t>&, const std::vector<std::vector<tk:: real>>&, const std::vector<std::vector<tk:: real>>&, const std::vector<std::vector<tk:: real>>&, tk::Fields& U, tk::Fields&, std::vector<std::size_t>&) const -
void CPL(const tk::Fields&,
const tk::Fields&,
const std::vector<std::size_t>&,
const tk::
UnsMesh:: Coords&, tk::Fields&, std::size_t) const -
auto cellAvgDeformGrad(const tk::Fields&,
std::size_t) const -> std::array<std::vector<tk::
real>, 9> -
void resetAdapSol(const inciter::
FaceData&, tk::Fields&, tk::Fields&, const std::vector<std::size_t>&) const -
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>>&, 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 -
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 -
auto dt(const std::array<std::vector<tk::
real>, 3>&, const std::vector<std::size_t>&, const inciter:: FaceData&, const tk::Fields&, const tk::Fields&, const std::vector<std::size_t>&, const tk::Fields&, const tk::Fields&, const std::size_t) const -> tk:: real - Compute the minimum time step size.
-
void stiff_rhs(std::size_t,
const tk::Fields&,
const std::vector<std::size_t>&,
const tk::
UnsMesh:: Coords&, const tk::Fields&, const tk::Fields&, const std::vector<std::size_t>&, tk::Fields&) const - Compute stiff terms for a single element, not implemented here.
-
auto OutVarFn() const -> std::map<std::string, tk::
GetVarFn> - auto analyticFieldNames() const -> std::vector<std::string>
-
auto surfOutput(const std::map<int, std::vector<std::size_t>>&,
tk::Fields&) const -> std::vector<std::vector<tk::
real>> - Return surface field output going to file.
- auto histNames() const -> std::vector<std::string>
- auto names() const -> std::vector<std::string>
-
auto analyticSolution(tk::
real xi, tk:: real yi, tk:: real zi, tk:: real t) const -> std::vector<tk:: real> -
auto solution(tk::
real xi, tk:: real yi, tk:: real zi, tk:: real t) const -> std::vector<tk:: real> -
auto histOutput(const std::vector<HistData>& h,
const std::vector<std::size_t>&,
const tk::
UnsMesh:: Coords&, const tk::Fields&, const tk::Fields&) const -> std::vector<std::vector<tk:: real>> -
auto sp_totalenergy(std::size_t e,
const tk::Fields& unk) const -> tk::
real
Function documentation
template<class Physics, class Problem>
std::size_t inciter:: dg:: Transport<Physics, Problem>:: nprim() const
Returns | The number of primitive quantities required to be stored for this PDE system |
---|
Find the number of primitive quantities required for this PDE system
template<class Physics, class Problem>
std::size_t inciter:: dg:: Transport<Physics, Problem>:: nmat() const
Returns | The number of materials set up for this PDE system |
---|
Find the number of materials set up for this PDE system
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: numEquationDofs(std::vector<std::size_t>& numEqDof) const
Parameters | |
---|---|
numEqDof in/out | Array storing number of Dofs for each PDE equation |
Assign number of DOFs per equation in the PDE system
template<class Physics, class Problem>
std::size_t inciter:: dg:: Transport<Physics, Problem>:: nnonstiffeq() const
Returns | number of non-stiff equations |
---|
Find how 'nonstiff equations', which we currently don't use for Transport
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: setStiffEqIdx(std::vector<std::size_t>& stiffEqIdx) const
Parameters | |
---|---|
stiffEqIdx out | list |
Locate the stiff equations. Unused for transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: setNonStiffEqIdx(std::vector<std::size_t>& nonStiffEqIdx) const
Parameters | |
---|---|
nonStiffEqIdx out | list |
Locate the nonstiff equations. Unused for transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: 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>>&,
const std::unordered_map<std::size_t, std::set<std::size_t>>&,
tk::Fields& unk,
tk:: real t,
const std::size_t nielem) const
Parameters | |
---|---|
L in | Element mass matrix |
inpoel in | Element-node connectivity |
coord in | Array of nodal coordinates |
unk in/out | Array of unknowns |
t in | Physical time |
nielem in | Number of internal elements |
Initalize the transport equations for DG
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: computeDensityConstr(std::size_t,
tk::Fields&,
std::vector<tk:: real>& densityConstr) const
Compute density constraint for a given material.
Parameters | |
---|---|
densityConstr out | Density Constraint: rho/(rho0*det(g)) |
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: lhs(const tk::Fields& geoElem,
tk::Fields& l) const
Parameters | |
---|---|
geoElem in | Element geometry array |
l in/out | Block diagonal mass matrix |
Compute the left hand side mass matrix
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: updateInterfaceCells(tk::Fields&,
std::size_t,
std::vector<std::size_t>&,
std::vector<std::size_t>&) const
Update the interface cells to first order dofs
This function resets the high-order terms in interface cells, and is currently not used in transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: updatePrimitives(const tk::Fields&,
const tk::Fields&,
const tk::Fields&,
tk::Fields&,
std::size_t,
std::vector<std::size_t>&) const
Update the primitives for this PDE system
This function computes and stores the dofs for primitive quantities, which are currently unused for transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: cleanTraceMaterial(tk:: real,
const tk::Fields&,
tk::Fields&,
tk::Fields&,
std::size_t) const
Clean up the state of trace materials for this PDE system
This function cleans up the state of materials present in trace quantities in each cell. This is currently unused for transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: limit(] tk:: real t,
] const bool pref,
] const tk::Fields& geoFace,
const tk::Fields&,
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>&,
const std::unordered_map<std::size_t, std::size_t>&,
const std::vector<std::vector<tk:: real>>&,
const std::vector<std::vector<tk:: real>>&,
const std::vector<std::vector<tk:: real>>&,
tk::Fields& U,
tk::Fields&,
std::vector<std::size_t>&) const
Parameters | |
---|---|
t in | Physical time |
pref | |
geoFace in | Face geometry array |
fd in | Face connectivity and boundary conditions object |
esup in | Elements surrounding points |
inpoel in | Element-node connectivity |
coord in | Array of nodal coordinates |
ndofel in | Vector of local number of degrees of freedome |
U in/out | Solution vector at recent time step |
Limit second-order solution
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: CPL(const tk::Fields&,
const tk::Fields&,
const std::vector<std::size_t>&,
const tk:: UnsMesh:: Coords&,
tk::Fields&,
std::size_t) const
Update the conservative variable solution for this PDE system
This function computes the updated dofs for conservative quantities based on the limited solution and is currently not used in transport.
template<class Physics, class Problem>
std::array<std::vector<tk:: real>, 9> inciter:: dg:: Transport<Physics, Problem>:: cellAvgDeformGrad(const tk::Fields&,
std::size_t) const
Return cell-average deformation gradient tensor (no-op for transport)
This function is a no-op in transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: resetAdapSol(const inciter:: FaceData&,
tk::Fields&,
tk::Fields&,
const std::vector<std::size_t>&) const
Reset the high order solution for p-adaptive scheme
This function reset the high order coefficient for p-adaptive solution polynomials and is currently not used in transport.
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: 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>>&,
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
Parameters | |
---|---|
t in | Physical time |
pref in | Indicator for p-adaptive algorithm |
geoFace in | Face geometry array |
geoElem in | Element geometry array |
fd in | Face connectivity and boundary conditions object |
inpoel in | Element-node connectivity |
coord in | Array of nodal coordinates |
U in | Solution vector at recent time step |
P in | Primitive vector at recent time step |
ndofel in | Vector of local number of degrees of freedom |
dt in | Delta time |
R in/out | Right-hand side vector computed |
Compute right hand side
template<class Physics, class Problem>
void inciter:: dg:: Transport<Physics, Problem>:: 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
Parameters | |
---|---|
nunk in | Number of unknowns |
coord in | Array of nodal coordinates |
inpoel in | Element-node connectivity |
fd in | Face connectivity and boundary conditions object |
unk in | Array of unknowns |
prim in | Array of primitive quantities |
indicator in | p-refinement indicator type |
ndof in | Number of degrees of freedom in the solution |
ndofmax in | Max number of degrees of freedom for p-refinement |
tolref in | Tolerance for p-refinement |
ndofel in/out | Vector of local number of degrees of freedome |
Evaluate the adaptive indicator and mark the ndof for each element
template<class Physics, class Problem>
tk:: real inciter:: dg:: Transport<Physics, Problem>:: dt(const std::array<std::vector<tk:: real>, 3>&,
const std::vector<std::size_t>&,
const inciter:: FaceData&,
const tk::Fields&,
const tk::Fields&,
const std::vector<std::size_t>&,
const tk::Fields&,
const tk::Fields&,
const std::size_t) const
Compute the minimum time step size.
Returns | Minimum time step size |
---|
template<class Physics, class Problem>
std::map<std::string, tk:: GetVarFn> inciter:: dg:: 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:: dg:: 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:: dg:: 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:: dg:: Transport<Physics, Problem>:: names() const
Returns | Vector of strings labelling integral variables output |
---|
Return names of integral variables to be output to diagnostics file
template<class Physics, class Problem>
std::vector<tk:: real> inciter:: dg:: Transport<Physics, Problem>:: analyticSolution(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 |
t in | Physical time at which to evaluate the analytic solution |
Returns | Vector of analytic solution at given spatial 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:: dg:: 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 |
t 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>
std::vector<std::vector<tk:: real>> inciter:: dg:: Transport<Physics, Problem>:: histOutput(const std::vector<HistData>& h,
const std::vector<std::size_t>&,
const tk:: UnsMesh:: Coords&,
const tk::Fields&,
const tk::Fields&) const
Parameters | |
---|---|
h in | History point data |
Return time history field output evaluated at time history points
template<class Physics, class Problem>
tk:: real inciter:: dg:: Transport<Physics, Problem>:: sp_totalenergy(std::size_t e,
const tk::Fields& unk) const
Parameters | |
---|---|
e in | Element id for which total energy is required |
unk in | Vector of conserved quantities |
Returns | Cell-averaged total component mass per unit volume for given element. Since transport does not have an associated total energy, return total mass. |
Return cell-averaged total component mass per unit volume for an element