deal2lkit: A ToolKit library for Deal.II
parsed_quadrature.cc
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 //
3 // Copyright (C) 2015 by the deal2lkit authors
4 //
5 // This file is part of the deal2lkit library.
6 //
7 // The deal2lkit library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal2lkit distribution.
13 //
14 //-----------------------------------------------------------
15 
18 
19 D2K_NAMESPACE_OPEN
20 
21 template <int dim>
23 ParsedQuadrature(const std::string &name,
24  const std::string &quadrature_type,
25  const unsigned int order,
26  const unsigned int repetitions)
27  :
28  ParameterAcceptor(name),
29  quadrature_type(quadrature_type),
30  repetitions(repetitions),
31  order(order)
32 {}
33 
34 template <int dim>
35 void
38 {
39  std::string doc_quadrature_type = QuadratureSelector<dim>::get_quadrature_names();
40 
42  "Quadrature to generate", quadrature_type,
44  "Quadrature rule:"+
45  doc_quadrature_type
46  );
47 
48  add_parameter(prm, &order,
49  "Quadrature order", std::to_string(order),
51  "The number of quadrature points in each coordinate direction. (Avaible only for gauss otherwise it should be 0)");
52 
54  "Number of repetitions", std::to_string(repetitions),
56  "In one space dimension, the given base formula is copied and scaled onto a given number of subintervals of length 1/repetitions. In more than one space dimension, the resulting quadrature formula is constructed in the usual way by building the tensor product of the respective iterated quadrature formula in one space dimension.");
57 }
58 
59 template <int dim>
60 void
63 {
65 }
66 
67 D2K_NAMESPACE_CLOSE
68 
69 template class deal2lkit::ParsedQuadrature<1>;
70 template class deal2lkit::ParsedQuadrature<2>;
71 template class deal2lkit::ParsedQuadrature<3>;
unsigned int repetitions
In one space dimension, the given base formula is copied and scaled onto a given number of subinterva...
A parameter acceptor base class.
unsigned int order
Number of quadrature points in each coordinate direction.
static ParameterHandler prm
Static parameter.
static std::string get_quadrature_names()
std::string quadrature_type
Name of the quadrature of the quadrature rule: "gauss", "midpoint", "milne", "simpson", "trapez", or "weddle".
ParsedQuadrature(const std::string &name="", const std::string &quadrature_type="gauss", const unsigned int order=3, const unsigned int repetitions=1)
Constructor: takes an optional name for the section.
virtual void declare_parameters(ParameterHandler &prm)
Declare quadrature type and quadrature options.
virtual void parse_parameters_call_back()
Fill information about blocks after parsing the parameters.
void add_parameter(ParameterHandler &prm, T *parameter, const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())
Add a parameter the given parameter list.