Go to the documentation of this file. 1 #pragma once // Ensure that file is included only once in a single compilation.
29 template <
class TopologyT,
31 class NodeDescriptorT,
33 typename LargeVecT = std::vector<double>,
34 typename dof_index_t =
unsigned int>
53 static constexpr
unsigned int hyEdge_dim = TopologyT::hyEdge_dim();
57 static constexpr
unsigned int n_dofs_per_node = LocalSolverT::n_glob_dofs_per_node();
70 typename LocalSolverT::data_type>
96 Elliptic(
const typename TopologyT::constructor_value_type& construct_topo,
97 const typename GeometryT::constructor_value_type& construct_geom,
98 const typename LocalSolverT::constructor_value_type& construct_loc_sol)
101 static_assert(TopologyT::hyEdge_dim() == GeometryT::hyEdge_dim(),
102 "Hyperedge dimension of topology and geometry must be equal!");
103 static_assert(TopologyT::space_dim() == GeometryT::space_dim(),
104 "Space dimension of topology and geometry must be equal!");
105 static_assert(TopologyT::hyEdge_dim() == LocalSolverT::hyEdge_dim(),
106 "Hyperedge dimension of hypergraph and local solver must be equal!");
117 Elliptic(
const typename TopologyT::constructor_value_type& construct_topo,
118 const typename LocalSolverT::constructor_value_type& construct_loc_sol)
121 static_assert(TopologyT::hyEdge_dim() == GeometryT::hyEdge_dim(),
122 "Hyperedge dimension of topology and geometry must be equal!");
123 static_assert(TopologyT::space_dim() == GeometryT::space_dim(),
124 "Space dimension of topology and geometry must be equal!");
125 static_assert(TopologyT::hyEdge_dim() == LocalSolverT::hyEdge_dim(),
126 "Hyperedge dimension of hypergraph and local solver must be equal!");
136 Elliptic(
const typename TopologyT::constructor_value_type& construct_topo)
139 static_assert(TopologyT::hyEdge_dim() == GeometryT::hyEdge_dim(),
140 "Hyperedge dimension of topology and geometry must be equal!");
141 static_assert(TopologyT::space_dim() == GeometryT::space_dim(),
142 "Space dimension of topology and geometry must be equal!");
143 static_assert(TopologyT::hyEdge_dim() == LocalSolverT::hyEdge_dim(),
144 "Hyperedge dimension of hypergraph and local solver must be equal!");
163 for (
unsigned int i = 0; i < indices.size(); ++i)
167 "All indices of Dirichlet nodes need to be larger than or equal to zero and "
168 <<
"smaller than the total amount of degrees of freedom." << std::endl
169 <<
"In this case, the index is " << indices[i] <<
" and the total amount of "
199 template <
typename hyNode_index_t = dof_index_t>
208 "All indices of Dirichlet nodes need to be larger than or equal to zero and "
209 <<
"smaller than the total amount of degrees of freedom." << std::endl
231 template <
typename hyNode_index_t = dof_index_t>
240 "All indices of Dirichlet nodes need to be larger than or equal to zero and "
241 <<
"smaller than the total amount of degrees of freedom." << std::endl
257 template <
typename hyNode_index_t = dof_index_t>
261 return std::vector<dof_value_t>(result.begin(), result.end());
285 std::string
plot_option(
const std::string& option, std::string value =
"")
void set_refinement(unsigned int level)
Set refinement level.
Definition: elliptic.hxx:309
This file provides the function hy_assert.
const dof_index_t n_global_dofs() const
Returns the total amount of degrees of freedom in the considered hypergraph.
Definition: hdg_hypergraph.hxx:514
unsigned int get_refinement() const
Return the refinement level of the hypergraph.
Definition: hdg_hypergraph.hxx:521
void set_refinement(unsigned int level)
Set the refinement level of the hypergraph.
Definition: hdg_hypergraph.hxx:525
HDGHyperGraph< LocalSolverT::n_glob_dofs_per_node(), TopologyT, GeometryT, NodeDescriptorT, typename LocalSolverT::data_type > hyper_graph_
Instantiation of a hypergraph.
Definition: elliptic.hxx:71
std::string plot_option(const std::string &option, std::string value="")
Set plot option and return old plot option.
Definition: elliptic.hxx:285
#define prototype_errors(fun_name, has_fun_name)
Macro that allows to use an implemented error evaluation.
Definition: prototype.hxx:71
A class storing options for plotting.
Definition: plot.hxx:20
unsigned int get_refinement()
Return refinement level.
Definition: elliptic.hxx:305
The class template uniting topology and geometry of a hypergraph with the topology of the skeleton sp...
Definition: hdg_hypergraph.hxx:51
LargeVecT zero_vector() const
Returns vector of appropriate size for the predefined problem.
Definition: elliptic.hxx:185
Elliptic(const typename TopologyT::constructor_value_type &construct_topo)
Abstract problem constructor.
Definition: elliptic.hxx:136
typename LargeVecT::value_type dof_value_t
Floating type is determined by floating type of large vector's entries.
Definition: elliptic.hxx:62
std::vector< dof_index_t > dirichlet_indices_
Vector containing the indices of Dirichlet type nodes.
Definition: elliptic.hxx:75
LargeVecT trace_to_flux(const LargeVecT &x_vec, const dof_value_t time=0.)
Evaluate condensed matrix-vector product.
Definition: elliptic.hxx:200
Elliptic(const typename TopologyT::constructor_value_type &construct_topo, const typename LocalSolverT::constructor_value_type &construct_loc_sol)
Abstract problem constructor.
Definition: elliptic.hxx:117
const LocalSolverT local_solver_
Instantiation of a local solver.
Definition: elliptic.hxx:79
HAS_MEMBER_FUNCTION(trace_to_flux, has_trace_to_flux)
Prepare struct to check for function to exist (cf. compile_time_tricks.hxx).
dof_index_t size_of_system() const
Determine size of condensed system for the skeletal unknowns.
Definition: elliptic.hxx:274
PlotOptions plot_options
Struct encoding the options for plotting.
Definition: elliptic.hxx:83
void plot(HyperGraphT &hyper_graph, const LocalSolverT &local_solver, const LargeVecT &lambda, PlotOptions &plot_options, const floatT time=0.)
Function plotting the solution of an equation on a hypergraph in vtu format.
Definition: plot.hxx:778
void read_dirichlet_indices(const std::vector< unsigned int > &indices)
Read indices of Dirichlet type hypernodes/faces.
Definition: elliptic.hxx:160
#define hy_assert(Expr, Msg)
The assertion to be used within HyperHDG — deactivate using -DNDEBUG compile flag.
Definition: hy_assert.hxx:38
LargeVecT residual_flux(const LargeVecT &x_vec, const dof_value_t time=0.)
Evaluate condensed matrix-vector product containing data.
Definition: elliptic.hxx:232
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.
Definition: elliptic.hxx:96
static constexpr unsigned int n_dofs_per_node
Some constant variable that might be helpful.
Definition: elliptic.hxx:57
std::string set_plot_option(PlotOptions &plot_options, const std::string &option, std::string value="")
Set a plot option and return the new value of this option as std::string.
Definition: plot.hxx:122
void plot_solution(const LargeVecT &lambda, const dof_value_t time=0.)
Plot solution in vtu format.
Definition: elliptic.hxx:298
#define prototype_mat_vec_multiply(fun_name, has_fun_name)
Macro that allows to use an implemented a matrix–vector multpilication.
Definition: prototype.hxx:18
Combine local solver and global information for elliptic problems.
Definition: elliptic.hxx:35
A namespace for global loops.
Definition: elliptic.hxx:14
static constexpr unsigned int hyEdge_dim
Some constant variable that might be helpful.
Definition: elliptic.hxx:53
std::vector< dof_value_t > errors(const LargeVecT &x_vec, const dof_value_t time=0.)
Calculate L2 error of approximated function.
Definition: elliptic.hxx:258