dune-functions merge requestshttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests2023-02-27T10:07:59Zhttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/415[bugfix] A fix interpolate and evaluateJacobian in ReducedCubicHermite^^^2023-02-27T10:07:59ZCarsten Gräsergraeser@math.fau.de[bugfix] A fix interpolate and evaluateJacobian in ReducedCubicHermite^^^https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/414[draft]Add support for Hermite elements to the global interpolate() method2023-03-02T18:18:27ZCarsten Gräsergraeser@math.fau.de[draft]Add support for Hermite elements to the global interpolate() methodCurrently this contains two cases (activated via a macro):
* (A) Local interpolation of `fLocal` assumes that `derivative(fLocal)`
is really the derivative of `fLocal`.
* (B) Local interpolation of `fLocal` assumes that `derivative(fL...Currently this contains two cases (activated via a macro):
* (A) Local interpolation of `fLocal` assumes that `derivative(fLocal)`
is really the derivative of `fLocal`.
* (B) Local interpolation of `fLocal` assumes that `derivative(fLocal)`
is the localized version of the global derivative.
See https://gitlab.dune-project.org/staging/dune-functions/-/issues/76
for a discussion of the two variants.
This also included support for local functions `lf` where `derivative(lf)`
hands out a reference to a cached derivative. This potentially allows
to avoid the creation and copy of those local derivatives on each element
which can be relatively costly as e.g. in case of `DiscreteGlobalBasisFunction`.
However, the latter does not implement such caching so far but could easily
be patched to provide it.
To test this, this furthermore adds the following:
* A general `checkInterpolateConsistency()` utility for testing
if global `interpolate()` and `DiscreteGlobalBasisFunction`
are consistent.
* An implementation of a 1d and 2d cubic Hermite basis for testing.
* A new test that applies `checkInterpolateConsistency()`
to the `CubicHermitePreBasis` to test the updated `interpolate()`
method.
The `CubicHermitePreBasis` implementation is currently only
used for testing and thus contained in the test directory.
However it is fully functional in 1d and 2d and also brings all
the boiler-plate code needed for general dimension. Hence
we could also add it as real implementation. Internally
it uses a new `LeafPreBasisMapperMixIn` class, that allows
to simplify the `Prebasis` significantly, if index computations
can be done using a `MultipleCodimMultipleGeometryMapper`.
~~Notice that this incorporates the changes from !413.~~https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/413Allow to specify coeffient container type for Polynomial class2023-04-20T20:40:57ZCarsten Gräsergraeser@math.fau.deAllow to specify coeffient container type for Polynomial classThis adds a second template parameter to the `Polynomial` class,
which allows to explicitly specify the used coefficient container.
Supported containers are `std::vector`, `std::array`, `std::tuple`,
and `std::integer_sequence`. Static i...This adds a second template parameter to the `Polynomial` class,
which allows to explicitly specify the used coefficient container.
Supported containers are `std::vector`, `std::array`, `std::tuple`,
and `std::integer_sequence`. Static information is correctly preserved
when computing derivatives.
To simplify creation, a helper function `makePolynomial()` is also
provided. This allows to specify the argument type but let the
compiler deduce the coefficient type.
E.g. in the following example, the derivative `dp` will have
the coeffients `std::tuple(_2, _6, _0, 20)`:
```cpp
using namespace Dune::Indices;
auto p = makePolynomial<double>(std::tuple(_1, _2, _3, _0, 5));
auto dp = derivative(p);
```
The change is backward compatible, because the default coefficient
container is `std::vector`.
Notice that this also provides some cleanup by dropping copy and move
constructors and assignments, because the default does the job. Also
the construction from coefficient container is simplified (single
constructor with copy+move instead of two constructors from l- and
r-value reference).https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/400Deprecate DefaultNodeToRangeMap2023-02-05T00:21:57ZCarsten Gräsergraeser@math.fau.deDeprecate DefaultNodeToRangeMapThis has been replaced as default by `HierarchicNodeToRangeMap`
long time ago.
This MR
* deprecated the class `DefaultNodeToRangeMap` and the corresponding header,
* replaces `DefaultNodeToRangeMap` by `HierarchicNodeToRangeMap` in the ...This has been replaced as default by `HierarchicNodeToRangeMap`
long time ago.
This MR
* deprecated the class `DefaultNodeToRangeMap` and the corresponding header,
* replaces `DefaultNodeToRangeMap` by `HierarchicNodeToRangeMap` in the Python bindings.
This fixes #74.https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/397Draft: Feature/reduced cubic hermite basis2023-03-02T17:04:14ZKlaus BöhnleinDraft: Feature/reduced cubic hermite basisAdd a new basis for reduced cubic hermite Triangles.Add a new basis for reduced cubic hermite Triangles.Klaus BöhnleinKlaus Böhnleinhttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/390Draft: Make maxNodeSize a static information if possible2022-12-20T18:17:57ZSimon PraetoriusDraft: Make maxNodeSize a static information if possibleIt might be helpful to have the `maxNodeSize` as static information, e.g., to choose corresponding static data structures. This is not always possible and thus not a requirement, but if possible the function should be `static constexpr`.It might be helpful to have the `maxNodeSize` as static information, e.g., to choose corresponding static data structures. This is not always possible and thus not a requirement, but if possible the function should be `static constexpr`.https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/378Draft: Introduce c++20 concepts2022-10-21T16:48:49ZSimon PraetoriusDraft: Introduce c++20 concepts(This MR is for experimenting with C++20 concepts and far from ready to be merged)
### Summary
Replace the C++17 concept-workarounds `Dune::Concept::models<...>` by proper c++20 concepts and replace all `enable_if` SFINAE statements by ...(This MR is for experimenting with C++20 concepts and far from ready to be merged)
### Summary
Replace the C++17 concept-workarounds `Dune::Concept::models<...>` by proper c++20 concepts and replace all `enable_if` SFINAE statements by `requires` clauses.
### Discussion
- Tested locally with clang-16. We need a proper toolchain for more recent compilers supporting concepts.
- I don't see any improvement of compile-times by this change in code
- The definition of a basis-tree in terms of concepts is difficult, since we need recursion that is not allowed in concept definitions. Any ideas?https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/351WIP: Experimental replacement of typetree2022-02-18T09:27:08ZSimon PraetoriusWIP: Experimental replacement of typetree## Summary
This is an experiment to replace the old structures in dune-typetree with a new type-tree implementation more similar to the TreeContainer, i.e., a composition of `std::array`, `std::tuple` and `std::vector`.
See also https:/...## Summary
This is an experiment to replace the old structures in dune-typetree with a new type-tree implementation more similar to the TreeContainer, i.e., a composition of `std::array`, `std::tuple` and `std::vector`.
See also https://gitlab.dune-project.org/staging/dune-typetree/-/merge_requests/111https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/350Add IndexTree datastructures to represent hierarchic structure of the basis2023-06-05T17:04:58ZSimon PraetoriusAdd IndexTree datastructures to represent hierarchic structure of the basis### Summary
This MR implements an idea discussed in a dune-functions developer meeting: Represent the hierarchic structure accessible by multi-indices in an `IndexTree`. This tree contains information about uniform and non-uniform sub-st...### Summary
This MR implements an idea discussed in a dune-functions developer meeting: Represent the hierarchic structure accessible by multi-indices in an `IndexTree`. This tree contains information about uniform and non-uniform sub-structures and about the sizes of this structure. It is implemented for `PowerPreBasis` and `CompositePreBasis` and all leaf prebases with a dimension get a default flat `IndexTree`.
### IndexTrees
There are various tree nodes implemented representing all situations I could think of:
- leaf nodes (representing flat containers), with static and dynamic size (`StaticFlatIndexTree`, `DynamicFlatIndexTree`)
- uniform trees with all sub-trees of the same type and shape, with static and dynamic degree (`[Static]UniformIndexTree`)
- non-uniform tree with all sub-trees of either different types or the same types with different shape again with static and dynamic size (`TypeUniformIndexTree`, `StaticTypeUniformIndexTree`, `NonUniformIndexTree` (not implemented), `StaticNonUniformIndexTree`)
Inner index-tree nodes follow the interface
```c++
struct IndexTree
{
static constexpr bool isUniform = [true|false]; // Whether all children are identical
static constexpr bool isTypeUniform = [true|false]; // Whether all children have the same type
template<class Index>
SubTree operator[](Index i) const; // return the i-th sub-tree
[static constexpr] std::size_t size() [const]; // return the number of sub-nodes
};
```
### TODO
- [x] Decide whether to name the structure ~~`SizeTree`~~ or `IndexTree`
- [x] Add changelog entry
- [x] Squash commits
- [x] requires !389 to be merged and then a rebase to include these commits.
- [x] Update concepts definitionCarsten Gräsergraeser@math.fau.deCarsten Gräsergraeser@math.fau.dehttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/342WIP: Add a parallel global GridView wrapper2021-11-11T09:00:45ZSimon PraetoriusWIP: Add a parallel global GridView wrapperNote, the files `entityowner.hh`, `globalindexset.hh`, `uniqueborderpartition.hh` and `subpartitiontype.hh` should be removed, or extracted into the dune-grid module. See also a corresponding MR: core/dune-grid!544Note, the files `entityowner.hh`, `globalindexset.hh`, `uniqueborderpartition.hh` and `subpartitiontype.hh` should be removed, or extracted into the dune-grid module. See also a corresponding MR: core/dune-grid!544https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/334Add mixin class for flat-index pre-bases2023-04-26T09:56:58ZSimon PraetoriusAdd mixin class for flat-index pre-bases### Summary
We made some adaptions to the pre-bases that influences several implementations. This MR adds a simple CRTP base class for leaf pre-bases to inherit common functionality and thus simplifies the implementation of new bases.### Summary
We made some adaptions to the pre-bases that influences several implementations. This MR adds a simple CRTP base class for leaf pre-bases to inherit common functionality and thus simplifies the implementation of new bases.https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/325Feature/raviart thomas pyramid and prism2022-05-16T15:52:54ZHenrik StolzmannFeature/raviart thomas pyramid and prismFollow up MR for [this MR](https://gitlab.dune-project.org/core/dune-localfunctions/-/merge_requests/206) in dune-localfunctions.
The test will fail. There are some issues with the size of the MultiIndexSet (its smaller than the number ...Follow up MR for [this MR](https://gitlab.dune-project.org/core/dune-localfunctions/-/merge_requests/206) in dune-localfunctions.
The test will fail. There are some issues with the size of the MultiIndexSet (its smaller than the number of faces) and the continuity between pyramids and simplex elements in mixed grids in 3D (for me it does not look like a simple scaling issue).
If someone has some experience with this kind of errors please drop a hint and I'll investigate further.https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/314WIP: Add gridfunction representing all basis functions2021-08-15T14:47:13ZSimon PraetoriusWIP: Add gridfunction representing all basis functions### Summary
The `GlobalBasisFunctions` grid function is a utility to evaluate and visualize all individual basis functions. Currently this is restricted to scalar basis functions.### Summary
The `GlobalBasisFunctions` grid function is a utility to evaluate and visualize all individual basis functions. Currently this is restricted to scalar basis functions.https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/309Draft: Lobatto shape functions2023-06-04T20:42:24ZSimon PraetoriusDraft: Lobatto shape functions### Summary
An (adaptive) Lobatto basis is a set of basis functions of local Lobatto shape functions
that allows to have different polynomial orders on each element. It even allows to have
different orders on sub-entities and thus opens ...### Summary
An (adaptive) Lobatto basis is a set of basis functions of local Lobatto shape functions
that allows to have different polynomial orders on each element. It even allows to have
different orders on sub-entities and thus opens the possibility for conforming bases with
p-adaptivity.
Note, for a stable discretization you need to fulfill a minimum-rule that essentially means that
the polynomial degree on sub-entities shared by some entities is a most the minimum of the
polynomial degrees of the entities.
The implementation is based on the local `Lobatto[Cube]LocalFiniteElement` implementing the
functions from
"Higher-Order Finite Element Methods", P. Soling, K, Segeth, I. Dolezel, 2004, Chapman & Hall/CRChttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/297WIP: Add Python binding for Nedelec basis2021-06-03T09:58:32ZPatrick JaapWIP: Add Python binding for Nedelec basishttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/285Add dynamic power basis2023-06-06T09:48:03ZSimon PraetoriusAdd dynamic power basis### Summary
This MR introduces a dynamic power node with runtime size. It is based on the dune-typetree `DynamicPowerNode` and can be constructed by
```c++
power(<child>, k)
power(<child>, k, <index-merging-strategy>)
```
Thus, the "expo...### Summary
This MR introduces a dynamic power node with runtime size. It is based on the dune-typetree `DynamicPowerNode` and can be constructed by
```c++
power(<child>, k)
power(<child>, k, <index-merging-strategy>)
```
Thus, the "exponent" is given after the child type, like in the `std::pow` function.
The main assumption for power nodes is that all childs have the same shape/size. This allows to compute the size of the power node itself as `k * size-of-child`. This property is important to mention, since dynamic-power-nodes would allow trees with different number of children. This is not supported by a (dynamic) power basis! However, one could implement another type of power-like basis, mabye better called vector-basis, where each child has the same type, but is allowed to have a different size, e.g. different lagrange leaf bases, or different dynamic power nodes, or ...
### Requires
- https://gitlab.dune-project.org/staging/dune-typetree/-/merge_requests/90
- https://gitlab.dune-project.org/staging/dune-typetree/-/merge_requests/91https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/248Move implementation of LocalFiniteElement Cache to dune-localfunctions2023-06-04T20:33:10ZSimon PraetoriusMove implementation of LocalFiniteElement Cache to dune-localfunctions### Summary
This moves some internal details of a dynamic local-finite-element cache to dune-localfunctions and additionally adds a FixedGeometryType cache.
### Merge requirements
core/dune-localfunctions!248### Summary
This moves some internal details of a dynamic local-finite-element cache to dune-localfunctions and additionally adds a FixedGeometryType cache.
### Merge requirements
core/dune-localfunctions!248https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/237WIP: adaption to typetree from dune-common2020-02-25T15:36:43ZSimon PraetoriusWIP: adaption to typetree from dune-commonThe MR is used in combination with https://gitlab.dune-project.org/core/dune-common/merge_requests/771 to test the new typetree implementation in dune-commonThe MR is used in combination with https://gitlab.dune-project.org/core/dune-common/merge_requests/771 to test the new typetree implementation in dune-commonhttps://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/227[WIP] Use UGGrid instead of YaspGrid if available2019-12-18T22:22:58ZCarsten Gräsergraeser@math.fau.de[WIP] Use UGGrid instead of YaspGrid if availableSwitch from `YaspGrid` to `UGGrid` to improve compile times.Switch from `YaspGrid` to `UGGrid` to improve compile times.https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/216WIP: add converting constructors to preBases2019-09-08T17:47:52ZSimon PraetoriusWIP: add converting constructors to preBases### Summary
Add converting-copy/move constructurs to `DefaultGlobalBasis`, `CompositePreBasis` and `PowerPreBasis` to create copies with possibly different IndexMergingStrategy or MultiIndex type.
### Details
Currently it is difficu...### Summary
Add converting-copy/move constructurs to `DefaultGlobalBasis`, `CompositePreBasis` and `PowerPreBasis` to create copies with possibly different IndexMergingStrategy or MultiIndex type.
### Details
Currently it is difficult to create a flat basis from a blocked basis or vice versa without manually using the basis factory (Maybe except for the approach in !125). One step in this direction could be to allow copies of PreBases with different template parameters, especially those for IndexMergingStrategy and MultiIndex. Then, a simple type transformation, replacing IMS and MultiIndex recursively, would allow to perform the task.
### Discussion
The complicated part when changing the IndexMergingStrategy is the choice of the MultiIndex type. A completely flat basis might have the MultiIndex type `FlatMultiIndex<size_t>` or `ReservedVector<size_t,1>`. This can not hold more than 1 index and is thus not applicable in blocked bases. While this can be handled manually by correctly specifying the target preBasis type, it is not done automatically like in the factories. Maybe its necessary to provide a generic tool for that or provide a compile-time check that the MultiIndex type can hold the indices of the chosen index-merging strategy (But this is currently also not checked in the existing constructor).