Combine local solver and global information for elliptic problems.
More...
#include <elliptic.hxx>
|
| Elliptic (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...
|
|
| Elliptic (const typename TopologyT::constructor_value_type &construct_topo, const typename LocalSolverT::constructor_value_type &construct_loc_sol) |
| Abstract problem constructor. More...
|
|
| Elliptic (const typename TopologyT::constructor_value_type &construct_topo) |
| Abstract problem constructor. More...
|
|
void | read_dirichlet_indices (const std::vector< unsigned int > &indices) |
| Read indices of Dirichlet type hypernodes/faces. 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> |
LargeVecT | residual_flux (const LargeVecT &x_vec, const dof_value_t time=0.) |
| Evaluate condensed matrix-vector product containing data. More...
|
|
template<typename hyNode_index_t = dof_index_t> |
std::vector< dof_value_t > | errors (const LargeVecT &x_vec, const dof_value_t time=0.) |
| Calculate L2 error of approximated function. 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 LargeVecT &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...
|
|
|
using | dof_value_t = typename LargeVecT::value_type |
| Floating type is determined by floating type of large vector's entries. More...
|
|
|
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...
|
|
template<class TopologyT, class GeometryT, class NodeDescriptorT, class LocalSolverT, typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
class GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >
Combine local solver and global information for elliptic problems.
- Template Parameters
-
TopologyT | Class type containing topological information. |
GeometryT | Class type containing geometrical information. |
NodeDescriptorT | Class type containing the information of nodes of hyperedges. |
LocalSolverT | Class type of the local solver. |
LargeVecT | Clas type of large, global vector. |
dof_index_t | Index type of hyperedges. Default is unsigned int . |
- Authors
- Guido Kanschat, Heidelberg University, 2019–2020.
-
Andreas Rupp, Heidelberg University, 2019–2020.
◆ dof_value_t
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
Floating type is determined by floating type of large vector's entries.
◆ Elliptic() [1/3]
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::Elliptic |
( |
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_topo | Information to construct a topology. |
construct_geom | Information to construct a geometry. |
construct_loc_sol | Information to construct a local solver. |
◆ Elliptic() [2/3]
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::Elliptic |
( |
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_topo | Information to construct a topology. |
construct_loc_sol | Information to construct a local solver. |
◆ Elliptic() [3/3]
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::Elliptic |
( |
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_topo | Information to construct a topology. |
◆ 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>
Calculate L2 error of approximated function.
- Template Parameters
-
hyNode_index_t | Typename of the hypernode index. Defaults to unsigned int . |
- Parameters
-
x_vec | A vector containing the input vector \(x\). |
time | Time at which analytical functions will be evaluated. |
- Return values
-
error | A vector containing the errors. |
◆ 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::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::get_refinement |
( |
| ) |
|
|
inline |
◆ HAS_MEMBER_FUNCTION() [1/3]
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
GlobalLoop::Elliptic< 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/3]
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).
◆ HAS_MEMBER_FUNCTION() [3/3]
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).
◆ 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::Elliptic< 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
-
option | A std::string containing the plot option to be considered. |
value | A std::string containing the new value of the considered option. If empty, the old value is kept. |
- Return values
-
opt_value | A std::string containing the value of the plot option. |
◆ plot_solution()
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
void GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::plot_solution |
( |
const LargeVecT & |
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
-
lambda | A vector of unknowns containing the data vector. |
time | Time at which analytical functions are evaluated. |
- Return values
-
file | A file in the output directory. |
◆ read_dirichlet_indices()
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
void GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::read_dirichlet_indices |
( |
const std::vector< unsigned int > & |
indices | ) |
|
|
inline |
Read indices of Dirichlet type hypernodes/faces.
Read the indices ot the hypernodes/faces that are of Dirichlet type and therefore do not contain degrees of freedom that are allowed to change within iterations of the iterative solver and other processes. In contrast, these degrees of freedom are set by the user.
The user creates a vector that contains the coefficients of the corresponding degrees of freedom (read by this function) and defines the Dirichlet values by this choice. The remaining elements of the global vector of unknowns (which is not the vector indices
are supposed to be zero).
- Parameters
-
indices | A vector containing the (global) indices of Dirichlet type hypernodes. |
◆ 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>
LargeVecT GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::residual_flux |
( |
const LargeVecT & |
x_vec, |
|
|
const dof_value_t |
time = 0. |
|
) |
| |
|
inline |
Evaluate condensed matrix-vector product containing data.
Function that evaluates the condensed, matrix-free version of the matrix-vector product \(A x - f = y\), where \(A\) is the condensed matrix of the LDG-H method, \(x\) is the vector of parameters to define the skeletal variable \(\lambda\), \(f\) is the right-hand side of the problem and \(y\) is the resulting vector, which has the same size as the input vector \(x\).
- Template Parameters
-
hyNode_index_t | Typename of the hypernode index. Defaults to unsigned int . |
- Parameters
-
x_vec | A vector containing the input vector \(x\). |
time | Time at which analytical functions will be evaluated. |
- Return values
-
y_vec | A vector containing the product \(y = Ax\). |
◆ set_refinement()
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
void GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::set_refinement |
( |
unsigned int |
level | ) |
|
|
inline |
◆ 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::Elliptic< 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
-
n | Size of the condensed (square) 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::Elliptic< 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, \(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\).
- Template Parameters
-
hyNode_index_t | Typename of the hypernode index. Defaults to unsigned int . |
- Parameters
-
x_vec | A vector containing the input vector \(x\). |
time | Time at which given analyitic functions will be evaluated. |
- Return values
-
y_vec | A vector containing the product \(y = Ax\). |
◆ zero_vector()
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
LargeVecT GlobalLoop::Elliptic< 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
-
zero | A vector of the correct size for the unknowns of the given problem. |
◆ dirichlet_indices_
template<class TopologyT , class GeometryT , class NodeDescriptorT , class LocalSolverT , typename LargeVecT = std::vector<double>, typename dof_index_t = unsigned int>
std::vector<dof_index_t> GlobalLoop::Elliptic< TopologyT, GeometryT, NodeDescriptorT, LocalSolverT, LargeVecT, dof_index_t >::dirichlet_indices_ |
|
private |
Vector containing the indices of Dirichlet type nodes.
◆ 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::Elliptic< 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::Elliptic< 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::Elliptic< 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::Elliptic< 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>
Struct encoding the options for plotting.
The documentation for this class was generated from the following file:
- /home/runner/work/HyperHDG/HyperHDG/include/HyperHDG/global_loop/elliptic.hxx