![]() |
KASKADE 7 development version
|
Miscellaneous support routines and classes. More...
Topics | |
| Combinatorics | |
| Functions for counting and enumerating combinatorial structures. | |
| Multithreading | |
| Support routines and data structures for multithreaded execution. | |
| Exceptions | |
| A hierarchy of exception classes providing more or less detailed information. | |
Classes | |
| struct | Kaskade::Creator< Product > |
| Abstract base class of creators that can be registered at the pluggable factory. More... | |
| class | Kaskade::Factory< K, P > |
| A pluggable factory. More... | |
| class | Kaskade::Deprecated |
| Convenience class for marking deprecated functions. A static object of this class can be created inside deprecated functions. It will output a warning message to stderr if the deprecated function is called, but only once. More... | |
| struct | Kaskade::ConvertTo< T, Real > |
| Reports the converted type. More... | |
| class | Kaskade::Timings |
| Supports gathering and reporting execution times information for nested program parts. More... | |
| class | Kaskade::ScopedTimingSection |
| A scope guard object that automatically closes a timing section on destruction. More... | |
| class | Kaskade::TaskTiming |
| A class that gathers data on task timing and provides gnuplot visualization. More... | |
Functions | |
| template<class LocalCoordinate> | |
| LocalCoordinate::field_type | checkInside (Dune::GeometryType const >, LocalCoordinate const &x) |
| Checks whether a point is inside or outside the reference element, and how much. | |
| template<class Cell> | |
| std::pair< Dune::FieldVector< double, Cell::dimension >, Dune::FieldVector< double, Cell::dimension > > | boundingBox (Cell const &cell) |
| Computes the bounding box of a cell. | |
| template<int d, class Real> | |
| Real | Kaskade::bezier (int p, int i, Dune::FieldVector< Real, d > const &x) |
| Computes the i-th Bezier function of order p at the given point in the unit simplex. | |
| constexpr int | Kaskade::binomial (int n, int k) |
| Computes the binomial coefficient \( \binom{n}{k} \). | |
| template<size_t m> | |
| size_t | Kaskade::multinomial (std::array< size_t, m > const &ks) |
| Computes the multinomial coefficient \( \binom{n}{k_1,\dots,k_m}\), where \( n = \sum_{i=1}^m k_i \). | |
| std::vector< double > | Kaskade::lobattoNodes (int n) |
| Computes the n Lobatto nodes on [-1,1] including the interval end points. | |
| std::vector< double > | Kaskade::radauNodes (int n) |
| Computes the n Radau nodes on [-1,1] including the right end point. | |
| std::vector< double > | Kaskade::gaussNodes (int n) |
| Computes the n Gauß nodes on [-1,1] excluding the interval end points. | |
| bool | Kaskade::getKaskadeOptions (int argc, char **argv, Options const &options) |
| Supports the extraction of program option values from command line arguments. | |
| template<class A> | |
| auto | Kaskade::moveUnique (A &&a) |
| Creates a dynamically allocated object from an r-value reference. | |
| template<class A> | |
| A | Kaskade::duplicate (A const &a) |
| Creates a copy of a given object. | |
| template<class R> | |
| constexpr R | Kaskade::power (R base, int exp) |
| Computes integral powers of values in a multiplicative half-group. | |
| template<class R> | |
| constexpr R | Kaskade::square (R x) |
| returns the square of its argument. | |
| template<class R> | |
| constexpr R | Kaskade::faculty (int n) |
| Computes faculties. Is this somewhere in the standard? no. | |
| constexpr int | Kaskade::sqrti (int n) |
| Computes floor(sqrt(n)) for integers n at compile time. | |
| template<class T> | |
| T & | Kaskade::removeConst (T const &t) |
| A convenience template for removing the const qualifier from references and pointers. | |
Miscellaneous support routines and classes.
| Real Kaskade::bezier | ( | int | p, |
| int | i, | ||
| Dune::FieldVector< Real, d > const & | x ) |
Computes the i-th Bezier function of order p at the given point in the unit simplex.
The Bezier functions are the summands in
\[ 1 = 1^p = \left(\sum_{j=0}^d \lambda_j\right)^p, \]
where \( \lambda_j \) are the barycentric coordinates.
| p | the order of Bezier functions |
| i | the number of the Bezier function of order p. 0 <= i < numberOfMultiindices(d,p) has to hold. |
| x | the simplex coordinates, i.e. \( \lambda = (x,1-\|x\|_1) \). |
|
constexpr |
Computes the binomial coefficient \( \binom{n}{k} \).
Precondition: n >= k >= 0
Definition at line 29 of file combinatorics.hh.
Referenced by bezier(), Kaskade::HierarchicExtensionSimplexShapeFunctionSet< ctype, dimension, Scalar >::HierarchicExtensionSimplexShapeFunctionSet(), and Kaskade::HierarchicSimplexShapeFunctionSet< typename GridView::Grid::ctype, GridView::Grid::dimension, Scalar >::HierarchicSimplexShapeFunctionSet().
| std::pair< Dune::FieldVector< double, Cell::dimension >, Dune::FieldVector< double, Cell::dimension > > boundingBox | ( | Cell const & | cell | ) |
Computes the bounding box of a cell.
| Cell | the type of cell considered. Usually a typename GridView::template Codim<0>::Entity. |
Definition at line 720 of file fixdune.hh.
| LocalCoordinate::field_type checkInside | ( | Dune::GeometryType const & | gt, |
| LocalCoordinate const & | x ) |
Checks whether a point is inside or outside the reference element, and how much.
Computational geometry predicates are notoriously difficult to get right. In Dune, it may happen that a point inside a cell is reported not to be contained in any of its children. Often this is due to rounding errors. This function returns not just a binary decision subject to rounding errors, but a floating point value that gives the magnitude of being inside or outside, such that the result can be tested by arbitrary tolerances or sorted according to magnitude.
| LocalCoordinate | the type of local coordinate vectors. Usually a Dune::FieldVector<ctype,dim>. |
Definition at line 692 of file fixdune.hh.
Referenced by Kaskade::findCell(), and Kaskade::findCellOnLevel().
| A Kaskade::duplicate | ( | A const & | a | ) |
Creates a copy of a given object.
Use this if you need a temporary copy that can be moved from.
| A | needs to be copy constructible and (preferably) moveable. |
Definition at line 48 of file memory.hh.
Referenced by Kaskade::MultiplicativeMultiGrid< Entry, Index, Smoother, Prolongation >::makeJacobiMultiGrid().
|
constexpr |
| std::vector< double > Kaskade::gaussNodes | ( | int | n | ) |
Computes the n Gauß nodes on [-1,1] excluding the interval end points.
| bool Kaskade::getKaskadeOptions | ( | int | argc, |
| char ** | argv, | ||
| Options const & | options ) |
Supports the extraction of program option values from command line arguments.
Based on boost::program_options, command line arguments (or their default values) can be stored in variables as follows:
If an argument "--help" is given, the list of allowed options is printed.
| std::vector< double > Kaskade::lobattoNodes | ( | int | n | ) |
Computes the n Lobatto nodes on [-1,1] including the interval end points.
| auto Kaskade::moveUnique | ( | A && | a | ) |
Creates a dynamically allocated object from an r-value reference.
Use this if you get an object of a runtime-polymorphic class hierarchy only as an r-value, e.g. from a makeSomething() function, and you don't care for its actual type:
| A | needs to be move (preferably) or copy constructible. |
Definition at line 33 of file memory.hh.
Referenced by Kaskade::MultiplicativeMultiGrid< Entry, Index, Smoother, Prolongation >::makeBlockJacobiPMultiGrid(), Kaskade::MultiplicativeMultiGrid< Entry, Index, Smoother, Prolongation >::makeJacobiMultiGrid(), makeMultigrid(), Kaskade::MultiplicativeMultiGrid< Entry, Index, Smoother, Prolongation >::makeMultiplicativePMultiGrid(), and makePMultiGridStack().
| size_t Kaskade::multinomial | ( | std::array< size_t, m > const & | ks | ) |
Computes the multinomial coefficient \( \binom{n}{k_1,\dots,k_m}\), where \( n = \sum_{i=1}^m k_i \).
| m | the number of multinomials |
| ks | an array of nonegative integers |
The multinomial coefficient is
\[ \binom{n}{k_1,\dots,k_m} = \frac{n!}{k_1! \cdots k_m!}. \]
Definition at line 61 of file combinatorics.hh.
Referenced by bezier().
|
constexpr |
Computes integral powers of values in a multiplicative half-group.
Definition at line 31 of file power.hh.
Referenced by bezier(), coarsening(), Kaskade::Elastomechanics::MaterialLaws::MooneyRivlin< dimension >::d2(), Kaskade::HomogeneousRadiativeFluxDensity::operator()(), Kaskade::HomogeneousRadiativeFluxDensity::operator()(), Kaskade::RadiativeFluxDensity< Emissivity >::operator()(), Kaskade::RadiativeFluxDensity< Emissivity >::operator()(), and power().
| std::vector< double > Kaskade::radauNodes | ( | int | n | ) |
Computes the n Radau nodes on [-1,1] including the right end point.
| T & Kaskade::removeConst | ( | T const & | t | ) |
A convenience template for removing the const qualifier from references and pointers.
Use this instead of
in polymorphic lambda functions where the type T is not named (just inferred from auto) and hence more involved to obtain, e.g. using decltype.
Definition at line 30 of file typeTraits.hh.
|
constexpr |
Computes floor(sqrt(n)) for integers n at compile time.
Definition at line 96 of file power.hh.
Referenced by Kaskade::Elastomechanics::yieldStrength().
|
constexpr |
returns the square of its argument.
Definition at line 51 of file power.hh.
Referenced by Kaskade::Elastomechanics::MaterialLaws::MooneyRivlin< dimension >::d1(), Kaskade::EmbeddedErrorEstimator< VariableSetDescription, Scaling >::estimate(), and Kaskade::CoarseningDetail::GetLocalTransferProjection< Cell >::operator()().