Add constraints support for dune-functions basis
This adds a class AffineConstraints
for storing contraints
for general dune-functions bases and a method
makeContinuityConstraints()
for computing the
constraints for the H^1-conforming subspace
for classical FE spaces on grid with hanging nodes.
This is experimental and the interface may change. Also some features are still missing:
- The code is generic and should work with nested bases and subspace bases. But this has not been tested so far.
-
One may want to generalizeUpdate: There is now alsomakeContinuityConstraints()
such that one can extend an existing constraints object. This way one could add constraints for different branches in the tree one after the other.computeContinuityConstraints()
to add the constraints to an existing constraints object. - Currently constraints are stored in a simple
std::unordered_map<std::map<Index,Coeff>>
data structure. Maybe this could be more efficient in a vector-based data structure or a sparse matrix. I had a compress method in mind that transforms into a more efficient storage once the contraints are fully build. But in my tests copying into a vector-bases data structure did not improve significantly, probably because the number of entries is relatively small. -
The constraints class is calledUpdate: This now also includesAffineConstraints
because it is intended to also hold Dirichlet constraints. This feature is currently missing.computeBoundaryConstraints()
for computing constraints for Dirichlet BCs.
Update: Using the functions compute*Constraints()
that modify a constraints object
it is possible to combine different constraints, e.g. for hanging nodes and Dirichlet
values:
// Create empty constraints object
auto constraints = makeAffineConstraints(basis);
// Insert constraints for hanging node
computeContinuityConstraints(constraints, basis);
// Insert constraints for Dirichlet-values on a BoundaryPatch
computeBoundaryConstraints(constraints, basis, dirichletValueFunction, boundaryPatch);
This also adds an adaptive Poisson example demonstrating the use.
Merge request reports
Activity
While there are still some rough edges and things that would need to be improved, it already provides the same feature set that we had for the old dune-fufem bases. Hence I propose to remove the latter now.
Edited by Carsten Gräseradded 1 commit
- 28ab3939 - Fix contraint computation for hierarchical bases
added 1 commit
- af162659 - [examples] Use a hierarchical estimator in adaptive example
added 12 commits
- 372c43c1...f20ff90d - 2 earlier commits
- bb58d223 - [constraints] Fix contraint computation for hierarchical bases
- 6e6e16e2 - [constraints] Use makeContainer to deduce bit-vector type if possible.
- dbfcfc37 - [examples] Add support for directly passing contraints to assembler
- f6557b76 - [examples] Use a hierarchical estimator in adaptive example
- 432a70c4 - [examples] Don't use dune-vtk with 2.9
- 36bf1861 - Make matrix/vector traversal termination work with proxy types
- 99746d50 - [constraints] Add support for constant part to AffineConstraints
- a187827b - [constraints] Update hanging node constraints
- cc7470b8 - [constraints] Add utitily function for computing Dirichlet constraints
- 8e426dc7 - [example] Handle hanging-node and Dirichlet constraints uniformly
Toggle commit listadded 4 commits
Toggle commit listadded 1 commit
- 231e843a - [examples] Use P2 elements in adaptive example
added 1 commit
- c6dd9f32 - [examples] Add skeleton for nested iteration to adaptive example
added 1 commit
- 66faabf3 - [examples] Add skeleton for nested iteration to adaptive example
enabled an automatic merge when all merge checks for 66faabf3 pass
aborted the automatic merge because the source branch was updated. Learn more.
added 1 commit
- d1a538e4 - [examples] Disable poisson-adaptive for dune-funcions < 2.11
added 1 commit
- b6776acd - [examples] Disable poisson-adaptive for dune-funcions < 2.11
added 1 commit
- 4f10689e - [examples] Track and print EOC in adaptive example
mentioned in commit 3129dabf