HyperHDG
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t > Class Template Reference

Combine local solver and global information for parabolic problems. More...

#include <parabolic.hxx>

Collaboration diagram for GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >:
Collaboration graph
[legend]

Public Member Functions

 Parabolic (const typename TopologyT::constructor_value_type &construct_topo, const typename GeometryT::constructor_value_type &construct_geom, const typename LocalSolverT::constructor_value_type &construct_loc_sol)
 Abstract problem constructor. More...
 
 Parabolic (const typename TopologyT::constructor_value_type &construct_topo, const typename LocalSolverT::constructor_value_type &construct_loc_sol)
 Abstract problem constructor. More...
 
 Parabolic (const typename TopologyT::constructor_value_type &construct_topo)
 Abstract problem constructor. More...
 
LargeVecT zero_vector () const
 Returns vector of appropriate size for the predefined problem. More...
 
template<typename hyNode_index_t = dof_index_t>
LargeVecT trace_to_flux (const LargeVecT &x_vec, const dof_value_t time=0.)
 Evaluate condensed matrix-vector product. More...
 
template<typename hyNode_index_t = dof_index_t>
std::vector< dof_value_tresidual_flux (const std::vector< dof_value_t > &x_vec, const dof_value_t time=0.)
 Evaluate condensed matrix-vector product. More...
 
template<typename hyNode_index_t = dof_index_t>
void set_data (const LargeVecT &x_vec, const dof_value_t time=0.)
 Set data using the result of the old time step. More...
 
template<typename hyNode_index_t = dof_index_t>
LargeVecT make_initial (const LargeVecT &x_vec, const dof_index_t time=0.)
 Evaluate the initial flux of the problem. More...
 
template<typename hyNode_index_t = dof_index_t>
std::vector< dof_value_terrors (const LargeVecT &x_vec, const dof_value_t time=0.)
 Calculate L2 error. More...
 
dof_index_t size_of_system () const
 Determine size of condensed system for the skeletal unknowns. More...
 
std::string plot_option (const std::string &option, std::string value="")
 Set plot option and return old plot option. More...
 
void plot_solution (const std::vector< dof_value_t > &lambda, const dof_value_t time=0.)
 Plot solution in vtu format. More...
 
unsigned int get_refinement ()
 Return refinement level. More...
 
void set_refinement (unsigned int level)
 Set refinement level. More...
 

Private Types

using dof_value_t = typename LargeVecT::value_type
 Floating type is determined by floating type of large vector's entries. More...
 

Private Member Functions

 HAS_MEMBER_FUNCTION (trace_to_flux, has_trace_to_flux)
 Prepare struct to check for function to exist (cf. compile_time_tricks.hxx). More...
 
 HAS_MEMBER_FUNCTION (residual_flux, has_residual_flux)
 Prepare struct to check for function to exist (cf. compile_time_tricks.hxx). More...
 
 HAS_MEMBER_FUNCTION (make_initial, has_make_initial)
 Prepare struct to check for function to exist (cf. compile_time_tricks.hxx). More...
 
 HAS_MEMBER_FUNCTION (errors, has_errors)
 Prepare struct to check for function to exist (cf. compile_time_tricks.hxx). More...
 
 HAS_MEMBER_FUNCTION (set_data, has_set_data)
 Prepare struct to check for function to exist (cf. compile_time_tricks.hxx). More...
 

Private Attributes

HDGHyperGraph< LocalSolverT::n_glob_dofs_per_node(), TopologyT, GeometryT, NodeDescriptorT, typename LocalSolverT::data_type > hyper_graph_
 Instantiation of a hypergraph. More...
 
const LocalSolverT local_solver_
 Instantiation of a local solver. More...
 
PlotOptions plot_options
 Struct encoding the options for plotting. More...
 

Static Private Attributes

static constexpr unsigned int hyEdge_dim = TopologyT::hyEdge_dim()
 Some constant variable that might be helpful. More...
 
static constexpr unsigned int n_dofs_per_node = LocalSolverT::n_glob_dofs_per_node()
 Some constant variable that might be helpful. More...
 

Detailed Description

template<class TopologyT, class GeometryT, class NodeDescriptorT, class LocalSolverT, typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
class GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >

Combine local solver and global information for parabolic problems.


Template Parameters
TopologyTClass type containing topological information.
GeometryTClass type containing geometrical information.
NodeDescriptorTClass type containing the information of nodes of hyperedges.
LocalSolverTClass type of the local solver.
LargeVecTClas type of large, global vector.
dof_index_tIndex type of hyperedges. Default is unsigned int.
Authors
Guido Kanschat, Heidelberg University, 2019–2020.
Andreas Rupp, Heidelberg University, 2019–2020.

Member Typedef Documentation

◆ dof_value_t

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
using GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::dof_value_t = typename LargeVecT::value_type
private

Floating type is determined by floating type of large vector's entries.


Constructor & Destructor Documentation

◆ Parabolic() [1/3]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::Parabolic ( const typename TopologyT::constructor_value_type &  construct_topo,
const typename GeometryT::constructor_value_type &  construct_geom,
const typename LocalSolverT::constructor_value_type &  construct_loc_sol 
)
inline

Abstract problem constructor.


Constructor for class containing a HyperGraph and a local solver that solve a PDE on a hyperedge.

Parameters
construct_topoInformation to construct a topology.
construct_geomInformation to construct a geometry.
construct_loc_solInformation to construct a local solver.

◆ Parabolic() [2/3]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::Parabolic ( const typename TopologyT::constructor_value_type &  construct_topo,
const typename LocalSolverT::constructor_value_type &  construct_loc_sol 
)
inline

Abstract problem constructor.


Constructor for class containing a HyperGraph and a local solver that solve a PDE on a hyperedge.

Parameters
construct_topoInformation to construct a topology.
construct_loc_solInformation to construct a local solver.

◆ Parabolic() [3/3]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::Parabolic ( const typename TopologyT::constructor_value_type &  construct_topo)
inline

Abstract problem constructor.


Constructor for class containing a HyperGraph and a local solver that solve a PDE on a hyperedge.

Parameters
construct_topoInformation to construct a topology.

Member Function Documentation

◆ errors()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
template<typename hyNode_index_t = dof_index_t>
std::vector<dof_value_t> GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::errors ( const LargeVecT &  x_vec,
const dof_value_t  time = 0. 
)
inline

Calculate L2 error.


Parameters
x_vecA vector containing the input vector \(x\).
timeTime at which error is evaluated.
Return values
errorL2 error.

◆ get_refinement()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
unsigned int GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::get_refinement ( )
inline

Return refinement level.


◆ HAS_MEMBER_FUNCTION() [1/5]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::HAS_MEMBER_FUNCTION ( errors  ,
has_errors   
)
private

Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).


◆ HAS_MEMBER_FUNCTION() [2/5]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::HAS_MEMBER_FUNCTION ( make_initial  ,
has_make_initial   
)
private

Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).


◆ HAS_MEMBER_FUNCTION() [3/5]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::HAS_MEMBER_FUNCTION ( residual_flux  ,
has_residual_flux   
)
private

Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).


◆ HAS_MEMBER_FUNCTION() [4/5]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::HAS_MEMBER_FUNCTION ( set_data  ,
has_set_data   
)
private

Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).


◆ HAS_MEMBER_FUNCTION() [5/5]

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::HAS_MEMBER_FUNCTION ( trace_to_flux  ,
has_trace_to_flux   
)
private

Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).


◆ make_initial()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
template<typename hyNode_index_t = dof_index_t>
LargeVecT GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::make_initial ( const LargeVecT &  x_vec,
const dof_index_t  time = 0. 
)
inline

Evaluate the initial flux of the problem.


Parameters
x_vecA vector containing the input vector \(x\).
timeTime for initial data.
Return values
y_vecA vector containing the initial fluxes.
Here is the call graph for this function:

◆ plot_option()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
std::string GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::plot_option ( const std::string &  option,
std::string  value = "" 
)
inline

Set plot option and return old plot option.


Function to set and / or read the current plot option.

Parameters
optionA std::string containing the plot option to be considered.
valueA std::string containing the new value of the considered option. If empty, the old value is kept.
Return values
opt_valueA std::string containing the value of the plot option.
Here is the call graph for this function:

◆ plot_solution()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
void GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::plot_solution ( const std::vector< dof_value_t > &  lambda,
const dof_value_t  time = 0. 
)
inline

Plot solution in vtu format.


Function that plots the solution of the problem to a predefined file.

Parameters
lambdaA vector of unknowns containing the data vector.
timeTime at which analytic functions are evaluated.
Return values
fileA file in the output directory.
Here is the call graph for this function:

◆ residual_flux()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
template<typename hyNode_index_t = dof_index_t>
std::vector<dof_value_t> GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::residual_flux ( const std::vector< dof_value_t > &  x_vec,
const dof_value_t  time = 0. 
)
inline

Evaluate condensed matrix-vector product.


Function that evaluates the condensed, matrix-free version of the matrix-vector product \(A x = y\), where \(A\) is the condensed matrix of the LDG-H method that needs to be inverted to do a time step, \(x\) is the vector of parameters to define the skeletal variable \(\lambda\), and \(y\) is the resulting vector, which has the same size as the input vector \(x\).

Parameters
x_vecA vector containing the input vector \(x\).
timeTime at which the time step ends.
Return values
y_vecA vector containing the product \(y = Ax\).
Here is the call graph for this function:

◆ set_data()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
template<typename hyNode_index_t = dof_index_t>
void GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::set_data ( const LargeVecT &  x_vec,
const dof_value_t  time = 0. 
)
inline

Set data using the result of the old time step.


Parameters
x_vecA std::vector containing the input vector \(x\).
timeTime at which the old time step ended.

◆ set_refinement()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
void GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::set_refinement ( unsigned int  level)
inline

Set refinement level.


◆ size_of_system()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
dof_index_t GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::size_of_system ( ) const
inline

Determine size of condensed system for the skeletal unknowns.


Function that returns the size \(n\) of the \(n \times n\) linear, sparse system \(Ax = b\) that is solved by the program in a matrix-free fashion.

This function is needed to define a LinearOperator from Python's scipy.sparse.linalg package which can be used to define iterative solvers for sparse systems.

Return values
nSize of condensed system of equations.

◆ trace_to_flux()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
template<typename hyNode_index_t = dof_index_t>
LargeVecT GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::trace_to_flux ( const LargeVecT &  x_vec,
const dof_value_t  time = 0. 
)
inline

Evaluate condensed matrix-vector product.


Function that evaluates the condensed, matrix-free version of the matrix-vector product \(A x = y\), where \(A\) is the condensed matrix of the LDG-H method that needs to be inverted for a time step, \(x\) is the vector of parameters to define the skeletal variable \(\lambda\), and \(y\) is the resulting vector, which has the same size as the input vector \(x\).

Parameters
x_vecA vector containing the input vector \(x\).
timeTime at which the new time step will end.
Return values
y_vecA vector containing the product \(y = Ax\).
Here is the call graph for this function:

◆ zero_vector()

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
LargeVecT GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::zero_vector ( ) const
inline

Returns vector of appropriate size for the predefined problem.


Returns a vector containing only the value zero, but of the size \(n\) which is also the number which is returned if size_of_system() is evaluated.

Return values
zeroA vector of the correct size for the unknowns of the given problem.
Here is the call graph for this function:

Member Data Documentation

◆ hyEdge_dim

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
constexpr unsigned int GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::hyEdge_dim = TopologyT::hyEdge_dim()
staticconstexprprivate

Some constant variable that might be helpful.


◆ hyper_graph_

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
HDGHyperGraph<LocalSolverT::n_glob_dofs_per_node(), TopologyT, GeometryT, NodeDescriptorT, typename LocalSolverT::data_type> GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::hyper_graph_
private

Instantiation of a hypergraph.


◆ local_solver_

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
const LocalSolverT GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::local_solver_
private

Instantiation of a local solver.


◆ n_dofs_per_node

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
constexpr unsigned int GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::n_dofs_per_node = LocalSolverT::n_glob_dofs_per_node()
staticconstexprprivate

Some constant variable that might be helpful.


◆ plot_options

template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
PlotOptions GlobalLoop::Parabolic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::plot_options
private

Struct encoding the options for plotting.



The documentation for this class was generated from the following file: