HyperHDG
diffusion_eigs_ldgh.hxx
Go to the documentation of this file.
1 #pragma once // Ensure that file is included only once in a single compilation.
2 
3 #include <HyperHDG/dense_la.hxx>
4 #include <HyperHDG/hypercube.hxx>
7 
8 #include <algorithm>
9 #include <tuple>
10 
11 namespace LocalSolver
12 {
13 /*!*************************************************************************************************
14  * \brief Default parameters for the diffusion equation, cf. below.
15  *
16  * \authors Guido Kanschat, Heidelberg University, 2019--2020.
17  * \authors Andreas Rupp, Heidelberg University, 2019--2020.
18  **************************************************************************************************/
19 template <unsigned int space_dimT, typename param_float_t = double>
20 struct DiffusionParametersDefault
21 {
22  /*!***********************************************************************************************
23  * \brief Array containing hypernode types corresponding to Dirichlet boundary.
24  ************************************************************************************************/
25  static constexpr std::array<unsigned int, 0U> dirichlet_nodes{};
26  /*!***********************************************************************************************
27  * \brief Array containing hypernode types corresponding to Neumann boundary.
28  ************************************************************************************************/
29  static constexpr std::array<unsigned int, 0U> neumann_nodes{};
30  /*!***********************************************************************************************
31  * \brief Inverse diffusion coefficient in PDE as analytic function.
32  ************************************************************************************************/
34  const param_float_t = 0.)
35  {
36  return 1.;
37  }
38  /*!***********************************************************************************************
39  * \brief Right-hand side in PDE as analytic function.
40  ************************************************************************************************/
42  const param_float_t = 0.)
43  {
44  return 0.;
45  }
46  /*!***********************************************************************************************
47  * \brief Dirichlet values of solution as analytic function.
48  ************************************************************************************************/
50  const param_float_t = 0.)
51  {
52  return 0.;
53  }
54  /*!***********************************************************************************************
55  * \brief Neumann values of solution as analytic function.
56  ************************************************************************************************/
57  static param_float_t neumann_value(const Point<space_dimT, param_float_t>&,
58  const param_float_t = 0.)
59  {
60  return 0.;
61  }
62  /*!***********************************************************************************************
63  * \brief Analytic result of PDE (for convergence tests).
64  ************************************************************************************************/
66  const param_float_t = 0.)
67  {
68  return 0.;
69  }
70 }; // end of struct DiffusionParametersDefault
71 
72 /*!*************************************************************************************************
73  * \brief Local solver for the nonlinear eigenvalue problem induced by the diffusion equation.
74  *
75  * \tparam hyEdge_dimT Dimension of a hyperedge, i.e., 1 is for PDEs defined on graphs, 2 is for
76  * PDEs defined on surfaces, and 3 is for PDEs defined on volumes.
77  * \tparam space_dimT The dimension of the surrounding space.
78  * \tparam poly_deg The polynomial degree of test and trial functions.
79  * \tparam quad_deg The order of the quadrature rule.
80  * \tparam parametersT Struct depending on templates \c space_dimTP and \c lSol_float_TP that
81  * contains static parameter functions.
82  * Defaults to above functions included in \c DiffusionParametersDefault.
83  * \tparam lSol_float_t The floating point type calculations are executed in. Defaults to double.
84  *
85  * \authors Guido Kanschat, Heidelberg University, 2019--2020.
86  * \authors Andreas Rupp, Heidelberg University, 2019--2020.
87  **************************************************************************************************/
88 template <unsigned int hyEdge_dimT,
89  unsigned int poly_deg,
90  unsigned int quad_deg,
91  template <unsigned int, typename> typename parametersT = DiffusionParametersDefault,
92  typename lSol_float_t = double>
94 {
95  public:
96  /*!***********************************************************************************************
97  * \brief Define type of (hyperedge related) data that is stored in HyDataContainer.
98  ************************************************************************************************/
99  struct data_type
100  {
101  };
102  /*!***********************************************************************************************
103  * \brief Define type of node elements, especially with respect to nodal shape functions.
104  ************************************************************************************************/
106  {
107  typedef std::tuple<TPP::ShapeFunction<
110  };
111  /*!***********************************************************************************************
112  * \brief Define how errors are evaluated.
113  ************************************************************************************************/
114  struct error_def
115  {
116  /*!*********************************************************************************************
117  * \brief Define the typename returned by function errors.
118  **********************************************************************************************/
119  typedef std::array<lSol_float_t, 1U> error_t;
120  /*!*********************************************************************************************
121  * \brief Define how initial error is generated.
122  **********************************************************************************************/
124  {
125  std::array<lSol_float_t, 1U> summed_error;
126  summed_error.fill(0.);
127  return summed_error;
128  }
129  /*!*********************************************************************************************
130  * \brief Define how local errors should be accumulated.
131  **********************************************************************************************/
132  static error_t sum_error(error_t& summed_error, const error_t& new_error)
133  {
134  for (unsigned int k = 0; k < summed_error.size(); ++k)
135  summed_error[k] += new_error[k];
136  return summed_error;
137  }
138  /*!*********************************************************************************************
139  * \brief Define how global errors should be postprocessed.
140  **********************************************************************************************/
141  static error_t postprocess_error(error_t& summed_error)
142  {
143  for (unsigned int k = 0; k < summed_error.size(); ++k)
144  summed_error[k] = std::sqrt(summed_error[k]);
145  return summed_error;
146  }
147  };
148 
149  // -----------------------------------------------------------------------------------------------
150  // Public, static constexpr functions
151  // -----------------------------------------------------------------------------------------------
152 
153  /*!***********************************************************************************************
154  * \brief Dimension of hyper edge type that this object solves on.
155  ************************************************************************************************/
156  static constexpr unsigned int hyEdge_dim() { return hyEdge_dimT; }
157  /*!***********************************************************************************************
158  * \brief Evaluate amount of global degrees of freedom per hypernode.
159  *
160  * This number must be equal to HyperNodeFactory::n_dofs_per_node() of the HyperNodeFactory
161  * cooperating with this object.
162  *
163  * \retval n_dofs Number of global degrees of freedom per hypernode.
164  ************************************************************************************************/
165  static constexpr unsigned int n_glob_dofs_per_node()
166  {
167  return Hypercube<hyEdge_dimT - 1>::pow(poly_deg + 1);
168  }
169  /*!***********************************************************************************************
170  * \brief Dimension of of the solution evaluated with respect to a hyperedge.
171  ************************************************************************************************/
172  static constexpr unsigned int system_dimension() { return hyEdge_dimT + 1; }
173  /*!***********************************************************************************************
174  * \brief Dimension of of the solution evaluated with respect to a hypernode.
175  ************************************************************************************************/
176  static constexpr unsigned int node_system_dimension() { return 1; }
177 
178  private:
179  // -----------------------------------------------------------------------------------------------
180  // Private, static constexpr functions
181  // -----------------------------------------------------------------------------------------------
182 
183  /*!***********************************************************************************************
184  * \brief Number of local shape functions (with respect to all spatial dimensions).
185  ************************************************************************************************/
186  static constexpr unsigned int n_shape_fct_ = n_glob_dofs_per_node() * (poly_deg + 1);
187  /*!***********************************************************************************************
188  * \brief Number oflocal shape functions (with respect to a face / hypernode).
189  ************************************************************************************************/
190  static constexpr unsigned int n_shape_bdr_ = n_glob_dofs_per_node();
191  /*!***********************************************************************************************
192  * \brief Number of (local) degrees of freedom per hyperedge.
193  ************************************************************************************************/
194  static constexpr unsigned int n_loc_dofs_ = (hyEdge_dimT + 1) * n_shape_fct_;
195  /*!***********************************************************************************************
196  * \brief Dimension of of the solution evaluated with respect to a hypernode.
197  *
198  * This allows to the use of this quantity as template parameter in member functions.
199  ************************************************************************************************/
200  static constexpr unsigned int system_dim = system_dimension();
201  /*!***********************************************************************************************
202  * \brief Dimension of of the solution evaluated with respect to a hypernode.
203  *
204  * This allows to the use of this quantity as template parameter in member functions.
205  ************************************************************************************************/
206  static constexpr unsigned int node_system_dim = node_system_dimension();
207  /*!***********************************************************************************************
208  * \brief Find out whether a node is of Dirichlet type.
209  ************************************************************************************************/
210  template <typename parameters>
211  static constexpr bool is_dirichlet(const unsigned int node_type)
212  {
213  return std::find(parameters::dirichlet_nodes.begin(), parameters::dirichlet_nodes.end(),
214  node_type) != parameters::dirichlet_nodes.end();
215  }
216 
217  // -----------------------------------------------------------------------------------------------
218  // Private, const members: Parameters and auxiliaries that help assembling matrices, etc.
219  // -----------------------------------------------------------------------------------------------
220 
221  /*!***********************************************************************************************
222  * \brief (Globally constant) penalty parameter for HDG scheme.
223  ************************************************************************************************/
224  const lSol_float_t tau_;
225  /*!***********************************************************************************************
226  * \brief An integrator helps to easily evaluate integrals (e.g. via quadrature).
227  ************************************************************************************************/
231  lSol_float_t>
233 
234  // -----------------------------------------------------------------------------------------------
235  // Private, internal functions for the local solver
236  // -----------------------------------------------------------------------------------------------
237 
238  /*!***********************************************************************************************
239  * \brief Assemble local matrix for the local solver.
240  *
241  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
242  * \param tau Penalty parameter.
243  * \param hyper_edge The geometry of the considered hyperedge (of typename GeomT).
244  * \param eig Eigenvalue for which the matrix is assembled.
245  * \retval loc_mat Matrix of the local solver.
246  ************************************************************************************************/
247  template <typename hyEdgeT>
249  assemble_loc_matrix(const lSol_float_t tau, hyEdgeT& hyper_edge, const lSol_float_t eig) const;
250  /*!***********************************************************************************************
251  * \brief Assemble local right-hand for the local solver (from skeletal).
252  *
253  * The right hand side needs the values of the global degrees of freedom. Note that we basically
254  * follow the lines of
255  *
256  * B. Cockburn, J. Gopalakrishnan, and R. Lazarov.
257  * Unified hybridization of discontinuous Galerkin, mixed, and continuous Galerkin methods for
258  * second order elliptic problems. SIAM Journal on Numerical Analysis, 47(2):1319–1365, 2009
259  *
260  * and discriminate between local solvers with respect to the skeletal variable and with respect
261  * to the global right-hand side. This assembles the local right-hand side with respect to the
262  * skeletal variable.
263  *
264  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
265  * \tparam SmallMatT The data type of the \c lambda_values.
266  * \param lambda_values Global degrees of freedom associated to the hyperedge.
267  * \param hyper_edge The geometry of the considered hyperedge (of typename GeomT).
268  * \retval loc_rhs Local right hand side of the locasl solver.
269  ************************************************************************************************/
270  template <typename hyEdgeT, typename SmallMatT>
272  const SmallMatT& lambda_values,
273  hyEdgeT& hyper_edge) const;
274  /*!***********************************************************************************************
275  * \brief Solve local problem (with right-hand side from skeletal).
276  *
277  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
278  * \tparam SmallMatT The data type of the \c lambda_values.
279  * \param lambda_values Global degrees of freedom associated to the hyperedge.
280  * \param hyper_edge The geometry of the considered hyperedge (of typename GeomT).
281  * \param eig Eigenvalue for which the local problem is solved.
282  * \retval loc_sol Solution of the local problem.
283  ************************************************************************************************/
284  template <typename hyEdgeT, typename SmallMatT>
285  inline std::array<lSol_float_t, n_loc_dofs_> solve_local_problem(const SmallMatT& lambda_values,
286  hyEdgeT& hyper_edge,
287  const lSol_float_t eig) const
288  {
289  try
290  {
291  SmallVec<n_loc_dofs_, lSol_float_t> rhs = assemble_rhs_from_lambda(lambda_values, hyper_edge);
292  return (rhs / assemble_loc_matrix(tau_, hyper_edge, eig)).data();
293  }
294  catch (Wrapper::LAPACKexception& exc)
295  {
296  hy_assert(0 == 1, exc.what() << std::endl
297  << "This can happen if quadrature is too inaccurate!");
298  throw exc;
299  }
300  }
301  /*!***********************************************************************************************
302  * \brief Evaluate primal variable at boundary.
303  *
304  * Function to evaluate primal variable of the solution. This function is needed to calculate
305  * the local numerical fluxes.
306  *
307  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
308  * \param coeffs Coefficients of the local solution.
309  * \param hyper_edge The geometry of the considered hyperedge (of typename GeomT).
310  * \retval bdr_coeffs Coefficients of respective (dim-1) dimensional function at boundaries.
311  ************************************************************************************************/
312  template <typename hyEdgeT>
313  inline std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT> primal_at_boundary(
314  const std::array<lSol_float_t, n_loc_dofs_>& coeffs,
315  hyEdgeT& hyper_edge) const;
316  /*!***********************************************************************************************
317  * \brief Evaluate dual variable at boundary.
318  *
319  * Function to evaluate dual variable of the solution. This function is needed to calculate the
320  * local numerical fluxes.
321  *
322  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
323  * \param coeffs Coefficients of the local solution.
324  * \param hyper_edge The geometry of the considered hyperedge (of typename GeomT).
325  * \retval bdr_coeffs Coefficients of respective (dim-1) dimensional function at boundaries.
326  ************************************************************************************************/
327  template <typename hyEdgeT>
328  inline std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT> dual_at_boundary(
329  const std::array<lSol_float_t, (hyEdge_dimT + 1) * n_shape_fct_>& coeffs,
330  hyEdgeT& hyper_edge) const;
331 
332  public:
333  // -----------------------------------------------------------------------------------------------
334  // Public functions (and one typedef) to be utilized by external functions.
335  // -----------------------------------------------------------------------------------------------
336 
337  /*!***********************************************************************************************
338  * \brief Class is constructed using a single double indicating the penalty parameter.
339  ************************************************************************************************/
340  typedef lSol_float_t constructor_value_type;
341  /*!***********************************************************************************************
342  * \brief Constructor for local solver.
343  *
344  * \param tau Penalty parameter of HDG scheme.
345  ************************************************************************************************/
346  DiffusionEigs(const constructor_value_type& tau = 1.) : tau_(tau) {}
347  /*!***********************************************************************************************
348  * \brief Evaluate local contribution to matrix--vector multiplication.
349  *
350  * This corresponds to an evaluation of the residual in the nonlinear context
351  *
352  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
353  * \tparam SmallMatInT Data type of \c lambda_values_in.
354  * \tparam SmallMatOutT Data type of \c lambda_values_out
355  * \param lambda_values_in Local part of vector x.
356  * \param lambda_values_out Local part that will be added to A * x.
357  * \param hyper_edge The geometry of the considered hyperedge (of typename hyEdgeT).
358  * \param eig Eigenvalue.
359  * \retval vecAx Local part of vector A * x.
360  ************************************************************************************************/
361  template <typename hyEdgeT, typename SmallMatInT, typename SmallMatOutT>
362  SmallMatOutT& trace_to_flux(const SmallMatInT& lambda_values_in,
363  SmallMatOutT& lambda_values_out,
364  hyEdgeT& hyper_edge,
365  const lSol_float_t eig = 0.) const
366  {
367  hy_assert(lambda_values_in.size() == lambda_values_out.size() &&
368  lambda_values_in.size() == 2 * hyEdge_dimT,
369  "Both matrices must be of same size which corresponds to the number of faces!");
370  for (unsigned int i = 0; i < lambda_values_in.size(); ++i)
371  hy_assert(
372  lambda_values_in[i].size() == lambda_values_out[i].size() &&
373  lambda_values_in[i].size() == n_glob_dofs_per_node(),
374  "Both matrices must be of same size which corresponds to the number of dofs per face!");
375 
376  using parameters = parametersT<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>;
377  std::array<lSol_float_t, n_loc_dofs_> coeffs =
378  solve_local_problem(lambda_values_in, hyper_edge, eig);
379 
380  std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT> primals(
381  primal_at_boundary(coeffs, hyper_edge)),
382  duals(dual_at_boundary(coeffs, hyper_edge));
383 
384  for (unsigned int i = 0; i < lambda_values_out.size(); ++i)
385  if (is_dirichlet<parameters>(hyper_edge.node_descriptor[i]))
386  for (unsigned int j = 0; j < lambda_values_out[i].size(); ++j)
387  lambda_values_out[i][j] = 0.;
388  else
389  for (unsigned int j = 0; j < lambda_values_out[i].size(); ++j)
390  lambda_values_out[i][j] =
391  duals[i][j] + tau_ * primals[i][j] -
392  tau_ * lambda_values_in[i][j] * hyper_edge.geometry.face_area(i);
393 
394  return lambda_values_out;
395  }
396  /*!***********************************************************************************************
397  * \brief Fill array with 1 if the node is of Dirichlet type and 0 elsewhen.
398  *
399  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
400  * \param hyper_edge The geometry of the considered hyperedge (of typename hyEdgeT).
401  * \retval result Array encoding edge types.
402  ************************************************************************************************/
403  template <class hyEdgeT>
404  std::array<unsigned int, 2 * hyEdge_dimT> node_types(hyEdgeT& hyper_edge) const
405  {
406  using parameters = parametersT<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>;
407 
408  std::array<unsigned int, 2 * hyEdge_dimT> result;
409  result.fill(0);
410 
411  for (unsigned int i = 0; i < 2 * hyEdge_dimT; ++i)
412  if (is_dirichlet<parameters>(hyper_edge.node_descriptor[i]))
413  result[i] = 1;
414 
415  return result;
416  }
417  /*!***********************************************************************************************
418  * \brief L2 project given analytical functio to skeletal space.
419  *
420  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
421  * \tparam SmallMatT The data tyepe of \c lambda_values.
422  * \param lambda_values Local part of vector x. (Redundant)
423  * \param hyper_edge The geometry of the considered hyperedge (of typename hyEdgeT).
424  * \param time Time. (Redundant)
425  * \retval bdr_values Coefficients of L2 projection.
426  ************************************************************************************************/
427  template <class hyEdgeT, typename SmallMatT>
428  SmallMatT& make_initial(SmallMatT& lambda_values,
429  hyEdgeT& hyper_edge,
430  const lSol_float_t time = 0.) const
431  {
432  using parameters = parametersT<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>;
433 
434  for (unsigned int i = 0; i < lambda_values.size(); ++i)
435  {
436  if (is_dirichlet<parameters>(hyper_edge.node_descriptor[i]))
437  for (unsigned int j = 0; j < lambda_values[i].size(); ++j)
438  lambda_values[i][j] = 0.;
439  else
440  for (unsigned int j = 0; j < lambda_values[i].size(); ++j)
441  lambda_values[i][j] = integrator::template integrate_bdrUni_psifunc<
442  Point<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>,
443  decltype(hyEdgeT::geometry), parameters::initial, Point<hyEdge_dimT, lSol_float_t> >(
444  j, i, hyper_edge.geometry, time);
445  }
446 
447  return lambda_values;
448  }
449  /*!***********************************************************************************************
450  * \brief Evaluate local contribution to matrix--vector multiplication.
451  *
452  * This corresponds to the evaluation of the Jacobian evaluated at \c lambda_vals, \c eig_val in
453  * the direction \c lambda_values, \c eig.
454  *
455  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
456  * \tparam SmallMatInT Data type of \c lambda_values_in.
457  * \tparam SmallMatOutT Data type of \c lambda_values_out
458  * \param lambda_values_in Local part of vector x.
459  * \param lambda_values_out Local part that will be added to A * x.
460  * \param eig Eigenvalue in whose direction Jacobian is evaluated.
461  * \param lambda_vals Lambda at which Jacobian is evaluated.
462  * \param eig_val Eigenvalue at which Jacobian is evaluated.
463  * \param hyper_edge The geometry of the considered hyperedge (of typename hyEdgeT).
464  * \retval vecAx Local part of vector A * x.
465  ************************************************************************************************/
466  template <class hyEdgeT, typename SmallMatInT, typename SmallMatOutT>
467  SmallMatOutT& jacobian_of_trace_to_flux(const SmallMatInT& lambda_values_in,
468  SmallMatOutT& lambda_values_out,
469  const lSol_float_t eig,
470  const SmallMatInT& lambda_vals,
471  const lSol_float_t eig_val,
472  hyEdgeT& hyper_edge) const
473  {
474  hy_assert(lambda_values_in.size() == lambda_values_out.size() &&
475  lambda_values_in.size() == 2 * hyEdge_dimT,
476  "Both matrices must be of same size which corresponds to the number of faces!");
477  for (unsigned int i = 0; i < lambda_values_in.size(); ++i)
478  hy_assert(
479  lambda_values_in[i].size() == lambda_values_out[i].size() &&
480  lambda_values_in[i].size() == n_glob_dofs_per_node(),
481  "Both matrices must be of same size which corresponds to the number of dofs per face!");
482 
483  using parameters = parametersT<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>;
484  std::array<lSol_float_t, n_loc_dofs_> coeffs =
485  solve_local_problem(lambda_values_in, hyper_edge, eig_val); // f_mu(eta,lambda_)
486 
487  std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT> primals(
488  primal_at_boundary(coeffs, hyper_edge)),
489  duals(dual_at_boundary(coeffs, hyper_edge));
490 
491  for (unsigned int i = 0; i < lambda_values_out.size(); ++i)
492  if (is_dirichlet<parameters>(hyper_edge.node_descriptor[i]))
493  for (unsigned int j = 0; j < lambda_values_out[i].size(); ++j)
494  lambda_values_out[i][j] = 0.;
495  else
496  for (unsigned int j = 0; j < lambda_values_out[i].size(); ++j)
497  lambda_values_out[i][j] =
498  duals[i][j] + tau_ * primals[i][j] -
499  tau_ * lambda_values_in[i][j] * hyper_edge.geometry.face_area(i);
500 
501  coeffs = solve_local_problem(lambda_vals, hyper_edge, eig_val);
502 
503  for (unsigned int i = 0; i < hyEdge_dimT * n_shape_fct_; ++i)
504  coeffs[i] = 0.;
505  for (unsigned int i = 0; i < n_shape_fct_; ++i)
506  coeffs[hyEdge_dimT * n_shape_fct_ + i] *= eig * hyper_edge.geometry.area();
507 
508  coeffs = (SmallVec<coeffs.size(), lSol_float_t>(coeffs) /
509  assemble_loc_matrix(tau_, hyper_edge, eig_val))
510  .data();
511 
512  primals = primal_at_boundary(coeffs, hyper_edge);
513  duals = dual_at_boundary(coeffs, hyper_edge);
514 
515  for (unsigned int i = 0; i < lambda_values_out.size(); ++i)
516  if (is_dirichlet<parameters>(hyper_edge.node_descriptor[i]))
517  for (unsigned int j = 0; j < lambda_values_out[i].size(); ++j)
518  lambda_values_out[i][j] += 0.;
519  else
520  for (unsigned int j = 0; j < lambda_values_out[i].size(); ++j)
521  lambda_values_out[i][j] += duals[i][j] + tau_ * primals[i][j];
522 
523  return lambda_values_out;
524  }
525  /*!***********************************************************************************************
526  * \brief Local squared contribution to the L2 error.
527  *
528  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
529  * \param lambda_values The values of the skeletal variable's coefficients.
530  * \param hy_edge The geometry of the considered hyperedge (of typename GeomT).
531  * \param eig Approximated eigenvalue.
532  * \retval vec_b Local part of vector b.
533  ************************************************************************************************/
534  template <class hyEdgeT>
535  std::array<lSol_float_t, 1U> errors(
536  const std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT>& lambda_values,
537  hyEdgeT& hy_edge,
538  const lSol_float_t eig = 0.) const
539  {
540  using parameters = parametersT<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>;
541  std::array<lSol_float_t, n_loc_dofs_> coefficients =
542  solve_local_problem(lambda_values, hy_edge, eig);
543  std::array<lSol_float_t, n_shape_fct_> coeffs;
544  for (unsigned int i = 0; i < coeffs.size(); ++i)
545  coeffs[i] = coefficients[i + hyEdge_dimT * n_shape_fct_];
546  return std::array<lSol_float_t, 1U>({integrator::template integrate_vol_diffsquare_discana<
547  Point<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>, decltype(hyEdgeT::geometry),
548  parameters::analytic_result, Point<hyEdge_dimT, lSol_float_t> >(coeffs, hy_edge.geometry,
549  time)});
550  }
551  /*!***********************************************************************************************
552  * \brief Evaluate local local reconstruction at tensorial products of abscissas.
553  *
554  * \tparam absc_float_t Floating type for the abscissa values.
555  * \tparam abscissas_sizeT Size of the array of array of abscissas.
556  * \tparam input_array_t Type of input array.
557  * \tparam hyEdgeT The geometry type / typename of the considered hyEdge's geometry.
558  * \param abscissas Abscissas of the supporting points.
559  * \param lambda_values The values of the skeletal variable's coefficients.
560  * \param hyper_edge The geometry of the considered hyperedge (of typename GeomT).
561  * \param time Time.
562  * \retval func_values Function values at tensorial points.
563  ************************************************************************************************/
564  template <typename abscissa_float_t,
565  std::size_t abscissas_sizeT,
566  class input_array_t,
567  class hyEdgeT>
568  std::array<std::array<lSol_float_t, Hypercube<hyEdge_dimT>::pow(abscissas_sizeT)>, system_dim>
569  bulk_values(const std::array<abscissa_float_t, abscissas_sizeT>& abscissas,
570  const input_array_t& lambda_values,
571  hyEdgeT& hyper_edge,
572  const lSol_float_t time = 0.) const;
573 }; // end of class DiffusionEigs
574 
575 // -------------------------------------------------------------------------------------------------
577 // -------------------------------------------------------------------------------------------------
578 
579 // -------------------------------------------------------------------------------------------------
580 // -------------------------------------------------------------------------------------------------
581 //
582 // IMPLEMENTATION OF MEMBER FUNCTIONS OF DiffusionEigs
583 //
584 // -------------------------------------------------------------------------------------------------
585 // -------------------------------------------------------------------------------------------------
586 
587 // -------------------------------------------------------------------------------------------------
588 // assemble_loc_matrix
589 // -------------------------------------------------------------------------------------------------
590 
591 template <unsigned int hyEdge_dimT,
592  unsigned int poly_deg,
593  unsigned int quad_deg,
594  template <unsigned int, typename>
595  typename parametersT,
596  typename lSol_float_t>
597 template <typename hyEdgeT>
598 inline SmallSquareMat<
600  lSol_float_t>
602  const lSol_float_t tau,
603  hyEdgeT& hyper_edge,
604  const lSol_float_t eig) const
605 {
606  using parameters = parametersT<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>;
608  lSol_float_t vol_integral, face_integral, helper;
609  SmallVec<hyEdge_dimT, lSol_float_t> grad_int_vec, normal_int_vec;
610 
611  for (unsigned int i = 0; i < n_shape_fct_; ++i)
612  {
613  for (unsigned int j = 0; j < n_shape_fct_; ++j)
614  {
615  // Integral_element phi_i phi_j dx in diagonal blocks
616  vol_integral = integrator::template integrate_vol_phiphifunc<
617  Point<decltype(hyEdgeT::geometry)::space_dim(), lSol_float_t>, decltype(hyEdgeT::geometry),
618  parameters::inverse_diffusion_coeff, Point<hyEdge_dimT, lSol_float_t> >(
619  i, j, hyper_edge.geometry, eig);
620  // Integral_element - nabla phi_i \vec phi_j dx
621  // = Integral_element - div \vec phi_i phi_j dx in right upper and left lower blocks
622  grad_int_vec =
623  integrator::template integrate_vol_nablaphiphi<SmallVec<hyEdge_dimT, lSol_float_t>,
624  decltype(hyEdgeT::geometry)>(
625  i, j, hyper_edge.geometry);
626 
627  face_integral = 0.;
628  normal_int_vec = 0.;
629  for (unsigned int face = 0; face < 2 * hyEdge_dimT; ++face)
630  {
631  helper = integrator::template integrate_bdr_phiphi<decltype(hyEdgeT::geometry)>(
632  i, j, face, hyper_edge.geometry);
633  face_integral += helper;
634  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
635  normal_int_vec[dim] += hyper_edge.geometry.local_normal(face).operator[](dim) * helper;
636  }
637 
638  local_mat(hyEdge_dimT * n_shape_fct_ + i, hyEdge_dimT * n_shape_fct_ + j) +=
639  tau * face_integral;
640  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
641  {
642  local_mat(dim * n_shape_fct_ + i, dim * n_shape_fct_ + j) += vol_integral;
643  local_mat(hyEdge_dimT * n_shape_fct_ + i, dim * n_shape_fct_ + j) -= grad_int_vec[dim];
644  local_mat(dim * n_shape_fct_ + i, hyEdge_dimT * n_shape_fct_ + j) -= grad_int_vec[dim];
645  local_mat(hyEdge_dimT * n_shape_fct_ + i, dim * n_shape_fct_ + j) += normal_int_vec[dim];
646  }
647 
648  local_mat(hyEdge_dimT * n_shape_fct_ + i, hyEdge_dimT * n_shape_fct_ + j) -=
649  eig * integrator::template integrate_vol_phiphi<decltype(hyEdgeT::geometry)>(
650  i, j, hyper_edge.geometry);
651  }
652  }
653 
654  return local_mat;
655 } // end of DiffusionEigs::assemble_loc_matrix
656 
657 // -------------------------------------------------------------------------------------------------
658 // assemble_rhs_from_lambda
659 // -------------------------------------------------------------------------------------------------
660 
661 template <unsigned int hyEdge_dimT,
662  unsigned int poly_deg,
663  unsigned int quad_deg,
664  template <unsigned int, typename>
665  typename parametersT,
666  typename lSol_float_t>
667 template <typename hyEdgeT, typename SmallMatT>
668 inline SmallVec<
670  lSol_float_t>
672  const SmallMatT& lambda_values,
673  hyEdgeT& hyper_edge) const
674 {
675  hy_assert(lambda_values.size() == 2 * hyEdge_dimT,
676  "The size of the lambda values should be twice the dimension of a hyperedge.");
677  for (unsigned int i = 0; i < 2 * hyEdge_dimT; ++i)
678  hy_assert(lambda_values[i].size() == n_shape_bdr_,
679  "The size of lambda should be the amount of ansatz functions at boundary.");
680 
681  SmallVec<n_loc_dofs_, lSol_float_t> right_hand_side;
682  lSol_float_t integral;
683 
684  for (unsigned int i = 0; i < n_shape_fct_; ++i)
685  for (unsigned int j = 0; j < n_shape_bdr_; ++j)
686  for (unsigned int face = 0; face < 2 * hyEdge_dimT; ++face)
687  {
688  integral = integrator::template integrate_bdr_phipsi<decltype(hyEdgeT::geometry)>(
689  i, j, face, hyper_edge.geometry);
690  right_hand_side[hyEdge_dimT * n_shape_fct_ + i] += tau_ * lambda_values[face][j] * integral;
691  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
692  right_hand_side[dim * n_shape_fct_ + i] -=
693  hyper_edge.geometry.local_normal(face).operator[](dim) * lambda_values[face][j] *
694  integral;
695  }
696 
697  return right_hand_side;
698 } // end of DiffusionEigs::assemble_rhs_from_lambda
699 
700 // -------------------------------------------------------------------------------------------------
701 // primal_at_boundary
702 // -------------------------------------------------------------------------------------------------
703 
704 template <unsigned int hyEdge_dimT,
705  unsigned int poly_deg,
706  unsigned int quad_deg,
707  template <unsigned int, typename>
708  typename parametersT,
709  typename lSol_float_t>
710 template <typename hyEdgeT>
711 inline std::array<
712  std::array<
713  lSol_float_t,
715  2 * hyEdge_dimT>
717  const std::array<lSol_float_t, n_loc_dofs_>& coeffs,
718  hyEdgeT& hyper_edge) const
719 {
720  std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT> bdr_values;
721 
722  for (unsigned int dim_n = 0; dim_n < 2 * hyEdge_dimT; ++dim_n)
723  bdr_values[dim_n].fill(0.);
724 
725  for (unsigned int i = 0; i < n_shape_fct_; ++i)
726  for (unsigned int j = 0; j < n_shape_bdr_; ++j)
727  for (unsigned int face = 0; face < 2 * hyEdge_dimT; ++face)
728  bdr_values[face][j] +=
729  coeffs[hyEdge_dimT * n_shape_fct_ + i] *
730  integrator::template integrate_bdr_phipsi<decltype(hyEdgeT::geometry)>(
731  i, j, face, hyper_edge.geometry);
732 
733  return bdr_values;
734 } // end of DiffusionEigs::primal_at_boundary
735 
736 // -------------------------------------------------------------------------------------------------
737 // dual_at_boundary
738 // -------------------------------------------------------------------------------------------------
739 
740 template <unsigned int hyEdge_dimT,
741  unsigned int poly_deg,
742  unsigned int quad_deg,
743  template <unsigned int, typename>
744  typename parametersT,
745  typename lSol_float_t>
746 template <typename hyEdgeT>
747 inline std::array<
748  std::array<
749  lSol_float_t,
751  2 * hyEdge_dimT>
753  const std::array<lSol_float_t, (hyEdge_dimT + 1) * n_shape_fct_>& coeffs,
754  hyEdgeT& hyper_edge) const
755 {
756  std::array<std::array<lSol_float_t, n_shape_bdr_>, 2 * hyEdge_dimT> bdr_values;
757  lSol_float_t integral;
758 
759  for (unsigned int dim_n = 0; dim_n < 2 * hyEdge_dimT; ++dim_n)
760  bdr_values[dim_n].fill(0.);
761 
762  for (unsigned int i = 0; i < n_shape_fct_; ++i)
763  for (unsigned int j = 0; j < n_shape_bdr_; ++j)
764  for (unsigned int face = 0; face < 2 * hyEdge_dimT; ++face)
765  {
766  integral = integrator::template integrate_bdr_phipsi<decltype(hyEdgeT::geometry)>(
767  i, j, face, hyper_edge.geometry);
768  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
769  bdr_values[face][j] += hyper_edge.geometry.local_normal(face).operator[](dim) * integral *
770  coeffs[dim * n_shape_fct_ + i];
771  }
772 
773  return bdr_values;
774 } // end of DiffusionEigs::dual_at_boundary
775 
776 // -------------------------------------------------------------------------------------------------
777 // bulk_values
778 // -------------------------------------------------------------------------------------------------
779 
780 template <unsigned int hyEdge_dimT,
781  unsigned int poly_deg,
782  unsigned int quad_deg,
783  template <unsigned int, typename>
784  typename parametersT,
785  typename lSol_float_t>
786 template <typename abscissa_float_t,
787  std::size_t abscissas_sizeT,
788  class input_array_t,
789  typename hyEdgeT>
790 std::array<std::array<lSol_float_t, Hypercube<hyEdge_dimT>::pow(abscissas_sizeT)>,
793  const std::array<abscissa_float_t, abscissas_sizeT>& abscissas,
794  const input_array_t& lambda_values,
795  hyEdgeT& hyper_edge,
796  const lSol_float_t time) const
797 {
799  solve_local_problem(lambda_values, hyper_edge, time);
801  SmallVec<static_cast<unsigned int>(abscissas_sizeT), abscissa_float_t> helper(abscissas);
802 
803  std::array<std::array<lSol_float_t, Hypercube<hyEdge_dimT>::pow(abscissas_sizeT)>,
805  point_vals;
806 
807  for (unsigned int d = 0; d < system_dim; ++d)
808  {
809  for (unsigned int i = 0; i < coeffs.size(); ++i)
810  coeffs[i] = coefficients[d * n_shape_fct_ + i];
811  for (unsigned int pt = 0; pt < Hypercube<hyEdge_dimT>::pow(abscissas_sizeT); ++pt)
812  point_vals[d][pt] = integrator::shape_fun_t::template lin_comb_fct_val<float>(
813  coeffs, Hypercube<hyEdge_dimT>::template tensorial_pt<Point<hyEdge_dimT> >(pt, helper));
814  }
815 
816  return point_vals;
817 }
818 // end of DiffusionEigs::bulk_values
819 
820 // -------------------------------------------------------------------------------------------------
822 // -------------------------------------------------------------------------------------------------
823 
824 } // namespace LocalSolver
LocalSolver::DiffusionEigs::constructor_value_type
lSol_float_t constructor_value_type
Class is constructed using a single double indicating the penalty parameter.
Definition: diffusion_eigs_ldgh.hxx:340
LocalSolver::DiffusionEigs::node_system_dim
static constexpr unsigned int node_system_dim
Dimension of of the solution evaluated with respect to a hypernode.
Definition: diffusion_eigs_ldgh.hxx:206
shape_function.hxx
LocalSolver::DiffusionEigs::DiffusionEigs
DiffusionEigs(const constructor_value_type &tau=1.)
Constructor for local solver.
Definition: diffusion_eigs_ldgh.hxx:346
LocalSolver::DiffusionEigs::primal_at_boundary
std::array< std::array< lSol_float_t, n_shape_bdr_ >, 2 *hyEdge_dimT > primal_at_boundary(const std::array< lSol_float_t, n_loc_dofs_ > &coeffs, hyEdgeT &hyper_edge) const
Evaluate primal variable at boundary.
LocalSolver::DiffusionEigs::n_glob_dofs_per_node
static constexpr unsigned int n_glob_dofs_per_node()
Evaluate amount of global degrees of freedom per hypernode.
Definition: diffusion_eigs_ldgh.hxx:165
LocalSolver::DiffusionEigs
Local solver for the nonlinear eigenvalue problem induced by the diffusion equation.
Definition: diffusion_eigs_ldgh.hxx:93
Wrapper::LAPACKexception::what
const char * what() const
Definition: lapack.hxx:27
LocalSolver
A namespace for local solvers.
Definition: advection_parab_ldgh.hxx:11
tensorial.hxx
diffusion_uniform.geometry
geometry
Definition: diffusion_uniform.py:19
LocalSolver::DiffusionEigs::errors
std::array< lSol_float_t, 1U > errors(const std::array< std::array< lSol_float_t, n_shape_bdr_ >, 2 *hyEdge_dimT > &lambda_values, hyEdgeT &hy_edge, const lSol_float_t eig=0.) const
Local squared contribution to the L2 error.
Definition: diffusion_eigs_ldgh.hxx:535
LocalSolver::DiffusionEigs::is_dirichlet
static constexpr bool is_dirichlet(const unsigned int node_type)
Find out whether a node is of Dirichlet type.
Definition: diffusion_eigs_ldgh.hxx:211
LocalSolver::DiffusionEigs::assemble_rhs_from_lambda
SmallVec< n_loc_dofs_, lSol_float_t > assemble_rhs_from_lambda(const SmallMatT &lambda_values, hyEdgeT &hyper_edge) const
Assemble local right-hand for the local solver (from skeletal).
LocalSolver::DiffusionEigs::assemble_loc_matrix
SmallSquareMat< n_loc_dofs_, lSol_float_t > assemble_loc_matrix(const lSol_float_t tau, hyEdgeT &hyper_edge, const lSol_float_t eig) const
Assemble local matrix for the local solver.
LocalSolver::DiffusionParametersDefault::dirichlet_value
static param_float_t dirichlet_value(const Point< space_dimT, param_float_t > &, const param_float_t=0.)
Dirichlet values of solution as analytic function.
Definition: diffusion_eigs_ldgh.hxx:49
LocalSolver::DiffusionEigs::system_dimension
static constexpr unsigned int system_dimension()
Dimension of of the solution evaluated with respect to a hyperedge.
Definition: diffusion_eigs_ldgh.hxx:172
LocalSolver::DiffusionParametersDefault::neumann_value
static param_float_t neumann_value(const Point< space_dimT, param_float_t > &, const param_float_t=0.)
Neumann values of solution as analytic function.
Definition: diffusion_eigs_ldgh.hxx:57
LocalSolver::DiffusionEigs::bulk_values
std::array< std::array< lSol_float_t, Hypercube< hyEdge_dimT >::pow(abscissas_sizeT)>, system_dim > bulk_values(const std::array< abscissa_float_t, abscissas_sizeT > &abscissas, const input_array_t &lambda_values, hyEdgeT &hyper_edge, const lSol_float_t time=0.) const
Evaluate local local reconstruction at tensorial products of abscissas.
LocalSolver::DiffusionEigs::make_initial
SmallMatT & make_initial(SmallMatT &lambda_values, hyEdgeT &hyper_edge, const lSol_float_t time=0.) const
L2 project given analytical functio to skeletal space.
Definition: diffusion_eigs_ldgh.hxx:428
LocalSolver::DiffusionEigs::solve_local_problem
std::array< lSol_float_t, n_loc_dofs_ > solve_local_problem(const SmallMatT &lambda_values, hyEdgeT &hyper_edge, const lSol_float_t eig) const
Solve local problem (with right-hand side from skeletal).
Definition: diffusion_eigs_ldgh.hxx:285
LocalSolver::DiffusionEigs::integrator
TPP::Quadrature::Tensorial< TPP::Quadrature::GaussLegendre< quad_deg >, TPP::ShapeFunction< TPP::ShapeType::Tensorial< TPP::ShapeType::Legendre< poly_deg >, hyEdge_dimT > >, lSol_float_t > integrator
An integrator helps to easily evaluate integrals (e.g. via quadrature).
Definition: diffusion_eigs_ldgh.hxx:232
TPP::Quadrature::GaussLegendre
Gauss–Legendre quadrature points and weights in one spatial dimension.
Definition: one_dimensional.hxx:19
LocalSolver::DiffusionEigs::n_shape_fct_
static constexpr unsigned int n_shape_fct_
Number of local shape functions (with respect to all spatial dimensions).
Definition: diffusion_eigs_ldgh.hxx:186
LocalSolver::DiffusionEigs::n_shape_bdr_
static constexpr unsigned int n_shape_bdr_
Number oflocal shape functions (with respect to a face / hypernode).
Definition: diffusion_eigs_ldgh.hxx:190
SmallMat::size
static constexpr unsigned int size()
Return size a SmallMat.
Definition: dense_la.hxx:54
LocalSolver::DiffusionEigs::error_def::postprocess_error
static error_t postprocess_error(error_t &summed_error)
Define how global errors should be postprocessed.
Definition: diffusion_eigs_ldgh.hxx:141
TPP::ShapeType::Tensorial
Struct that handles the evaluation of tensorial shape functions.
Definition: tensorial.hxx:22
LocalSolver::DiffusionEigs::system_dim
static constexpr unsigned int system_dim
Dimension of of the solution evaluated with respect to a hypernode.
Definition: diffusion_eigs_ldgh.hxx:200
LocalSolver::DiffusionEigs::data_type
Define type of (hyperedge related) data that is stored in HyDataContainer.
Definition: diffusion_eigs_ldgh.hxx:99
LocalSolver::DiffusionEigs::dual_at_boundary
std::array< std::array< lSol_float_t, n_shape_bdr_ >, 2 *hyEdge_dimT > dual_at_boundary(const std::array< lSol_float_t,(hyEdge_dimT+1) *n_shape_fct_ > &coeffs, hyEdgeT &hyper_edge) const
Evaluate dual variable at boundary.
TPP::ShapeFunction
Struct that handles different types of evaluation of shape functions.
Definition: shape_function.hxx:15
LocalSolver::DiffusionParametersDefault::analytic_result
static param_float_t analytic_result(const Point< space_dimT, param_float_t > &, const param_float_t=0.)
Analytic result of PDE (for convergence tests).
Definition: diffusion_eigs_ldgh.hxx:65
TPP::Quadrature::Tensorial
General integrator class on tensorial hypergraphs.
Definition: tensorial.hxx:24
LocalSolver::DiffusionEigs::trace_to_flux
SmallMatOutT & trace_to_flux(const SmallMatInT &lambda_values_in, SmallMatOutT &lambda_values_out, hyEdgeT &hyper_edge, const lSol_float_t eig=0.) const
Evaluate local contribution to matrix–vector multiplication.
Definition: diffusion_eigs_ldgh.hxx:362
LocalSolver::DiffusionEigs::error_def::sum_error
static error_t sum_error(error_t &summed_error, const error_t &new_error)
Define how local errors should be accumulated.
Definition: diffusion_eigs_ldgh.hxx:132
LocalSolver::DiffusionParametersDefault::right_hand_side
static param_float_t right_hand_side(const Point< space_dimT, param_float_t > &, const param_float_t=0.)
Right-hand side in PDE as analytic function.
Definition: diffusion_eigs_ldgh.hxx:41
LocalSolver::DiffusionEigs::jacobian_of_trace_to_flux
SmallMatOutT & jacobian_of_trace_to_flux(const SmallMatInT &lambda_values_in, SmallMatOutT &lambda_values_out, const lSol_float_t eig, const SmallMatInT &lambda_vals, const lSol_float_t eig_val, hyEdgeT &hyper_edge) const
Evaluate local contribution to matrix–vector multiplication.
Definition: diffusion_eigs_ldgh.hxx:467
LocalSolver::DiffusionParametersDefault::neumann_nodes
static constexpr std::array< unsigned int, 0U > neumann_nodes
Array containing hypernode types corresponding to Neumann boundary.
Definition: advection_parab_ldgh.hxx:29
LocalSolver::DiffusionEigs::n_loc_dofs_
static constexpr unsigned int n_loc_dofs_
Number of (local) degrees of freedom per hyperedge.
Definition: diffusion_eigs_ldgh.hxx:194
hypercube.hxx
LocalSolver::DiffusionEigs::node_system_dimension
static constexpr unsigned int node_system_dimension()
Dimension of of the solution evaluated with respect to a hypernode.
Definition: diffusion_eigs_ldgh.hxx:176
Wrapper::LAPACKexception
Exception to be thrown if LAPACK's solve fails.
Definition: lapack.hxx:25
LocalSolver::DiffusionEigs::node_element::functions
std::tuple< TPP::ShapeFunction< TPP::ShapeType::Tensorial< TPP::ShapeType::Legendre< poly_deg >, hyEdge_dimT - 1 > > > functions
Definition: diffusion_eigs_ldgh.hxx:109
LocalSolver::DiffusionParametersDefault::dirichlet_nodes
static constexpr std::array< unsigned int, 0U > dirichlet_nodes
Array containing hypernode types corresponding to Dirichlet boundary.
Definition: advection_parab_ldgh.hxx:25
LocalSolver::DiffusionEigs::node_element
Define type of node elements, especially with respect to nodal shape functions.
Definition: diffusion_eigs_ldgh.hxx:105
Hypercube::pow
static constexpr unsigned int pow(unsigned int base)
Return n to the power dim.
Definition: hypercube.hxx:25
LocalSolver::DiffusionEigs::hyEdge_dim
static constexpr unsigned int hyEdge_dim()
Dimension of hyper edge type that this object solves on.
Definition: diffusion_eigs_ldgh.hxx:156
parameters
the intent is to exercise the right to control the distribution of derivative or collective works based on the Library In mere aggregation of another work not based on the Library with the you must alter all the notices that refer to this so that they refer to the ordinary GNU General Public instead of to this it is irreversible for that so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy This option is useful when you wish to copy part of the code of the Library into a program that is not a library You may copy and distribute the which must be distributed under the terms of Sections and above on a medium customarily used for software interchange If distribution of object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source even though third parties are not compelled to copy the source along with the object code A program that contains no derivative of any portion of the but is designed to work with the Library by being compiled or linked with is called a work that uses the Library Such a in is not a derivative work of the and therefore falls outside the scope of this License linking a work that uses the Library with the Library creates an executable that is a derivative of the rather than a work that uses the library The executable is therefore covered by this License Section states terms for distribution of such executables When a work that uses the Library uses material from a header file that is part of the the object code for the work may be a derivative work of the Library even though the source code is not Whether this is true is especially significant if the work can be linked without the or if the work is itself a library The threshold for this to be true is not precisely defined by law If such an object file uses only numerical parameters
Definition: License.txt:259
hy_assert
#define hy_assert(Expr, Msg)
The assertion to be used within HyperHDG — deactivate using -DNDEBUG compile flag.
Definition: hy_assert.hxx:38
LocalSolver::DiffusionEigs::tau_
const lSol_float_t tau_
(Globally constant) penalty parameter for HDG scheme.
Definition: diffusion_eigs_ldgh.hxx:224
dense_la.hxx
LocalSolver::DiffusionParametersDefault::inverse_diffusion_coeff
static param_float_t inverse_diffusion_coeff(const Point< space_dimT, param_float_t > &, const param_float_t=0.)
Inverse diffusion coefficient in PDE as analytic function.
Definition: diffusion_eigs_ldgh.hxx:33
LocalSolver::DiffusionEigs::error_def::error_t
std::array< lSol_float_t, 1U > error_t
Define the typename returned by function errors.
Definition: diffusion_eigs_ldgh.hxx:119
LocalSolver::DiffusionEigs::error_def
Define how errors are evaluated.
Definition: diffusion_eigs_ldgh.hxx:114
LocalSolver::DiffusionEigs::error_def::initial_error
static error_t initial_error()
Define how initial error is generated.
Definition: diffusion_eigs_ldgh.hxx:123
LocalSolver::DiffusionEigs::node_types
std::array< unsigned int, 2 *hyEdge_dimT > node_types(hyEdgeT &hyper_edge) const
Fill array with 1 if the node is of Dirichlet type and 0 elsewhen.
Definition: diffusion_eigs_ldgh.hxx:404
SmallMat
This class implements a small/dense matrix.
Definition: dense_la.hxx:34
Hypercube
Helper class containing numbers and functions related to hypercubes.
Definition: hypercube.hxx:12