Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
Dune-Fufem

Features

Dune-fufem is a discretization module for the dune framework [1] [2] [3] [4] that strongly relies on the dune-functions [7] [8] module. The latter provides interfaces and implementations of global finite element bases and grid functions. Dune-fufem tries to follow the design principles of dune-functions as closely as possible, adding what is needed to implement finite element discretizations. In particular this includes

  • utilities for defining local assemblers of variational problems,
  • utilities for handling constraints such as essential boundary or hanging node constraints,
  • and the BoundaryPatch class for handling of grid boundaries.

While dune-fufem used to provide its own global assembler infrastructure, it now relies on the dune-assembler module for this. Notice that, for historical reasons, dune-fufem still contains some arcane code that does not follow our current design principles. As a rule of thumb, this applies to most code outside of the namespace Dune::Fufem.

Local assembler form language

Inspired by the Fenics project and its UFL language, dune-fufem provides a language for defining linear and bilinear forms to be assembled. This language does not rely on code generation and all expressions are pure C++. It is designed to integrate well with the global basis and grid function interfaces of the dune-functions module. For example, a Taylor-Hood discretization of the Stokes problem can be written as:

using namespace Dune::Indices;
using namespace Dune::Fufem::Forms;
// Create Taylor-Hood basis and give names to its velocity and pressure components
auto basis = makeBasis(gridView, composite(power<dim>(lagrange<2>()), lagrange<1>()));
auto velocityBasis = subspaceBasis(basis, _0);
auto pressureBasis = subspaceBasis(basis, _1);
// Define trial and test functions
auto u = trialFunction(velocityBasis);
auto p = trialFunction(pressureBasis);
auto v = testFunction(velocityBasis);
auto q = testFunction(pressureBasis);
// Define bilinear form of the Stokes problem
auto a = integrate( dot(grad(u), grad(v)) - div(u)*q - div(v)*p );
field_type dot(const type &newv) const
Definition baseclass.hh:22

For more details refer to the Form language (user interface) section.

Constraints handling

Affine constraints are used to restrict discretizations to affine subspaces of finite element spaces. This is, e.g., needed to define essential boundary conditions like Dirichlet constraints. It can also be used to implement hanging node constraints that construct H^1-conforming subspace on a non-conforming grid. As a deliberate design decision, such constraints are not part of the global basis interface in dune-functions but have to be handled separately. To this end dune-fufem provides the Dune::Fufem::AffineConstraints class and utility functions for setting up the constraints. For example, given a global basis on a nonconforming grid with hanging nodes, a BoundaryPatch describing the Dirichlet boundary, and a function providing the Dirichlet values, the corresponding constraints can be computed using:

using namespace Dune::Fufem;
// Create constraints object
auto constraints = makeAffineConstraints(basis);
// Compute hanging node constraints
computeContinuityConstraints(constraints, basis);
// Compute Dirichlet constraints
computeBoundaryConstraints(constraints, basis, dirichletValues, dirichletPatch);
Definition dunefunctionsboundaryfunctionalassembler.hh:29

Boundary patches

The BoundaryPatch class allows to store a subset of the domain boundary. The class essentially behaves like a container or range of boundary intersections of a grid view and provides some extra functions, e.g., for computing a normal field on these intersections. A BoundaryPatch can be created by various methods. The simplest ones create an empty patch, one containing the whole boundary, or a subset satisfying a given property:

// Create an empty BoundaryPatch
auto patch1 = BoundaryPatch(gridView);
// Create a BoundaryPatch containing the whole boundary
auto patch2 = BoundaryPatch(gridView, true);
// Create a BoundaryPatch containing all intersections marked by an indicator function
auto indicator = [](auto x) { return x[0]<=0; };
auto patch3 = BoundaryPatch(gridView, true);
patch3.insertFacesByProperty([&](auto&& intersection) { return indicator(intersection.geometry().center()); });
Encapsulate a part of a grid boundary.
Definition boundarypatch.hh:218

Dependencies

Dune-fufem depends on the dune core modules

and the extension modules

  • dune-uggrid as an implementation of an unstructured grid in 2d and 3d,
  • dune-typetree providing utilities for multi-type structures,
  • dune-functions providing global bases and function interfaces,
  • dune-assembler providing infrastructure for global assemblers,
  • dune-vtk providing extended support for writing in the Paraview format.

All of them are available using git under the above given links.

The versioning of dune-fufem follows the scheme used in the core modules. That is, version x.y of dune-fufem will depend on version x.y of its dependency modules. Analogously, the master branch will depend on the master branch of these modules. There is a limited support for using the master of dune-fufem with the most recent release of its dependencies. E.g. the development version 2.11-git provided by the master branch of dune-fufem can be used with version 2.10 of the core modules (and other dependencies). However, some features will be disabled in this setting.

Unless explicitly stated otherwise for a specific version, dune-fufem requires the same build tools (compilers, cmake) as the corresponding version of the core modules.

Building dune-fufem

Dune-fufem integrates into the cmake-based dune build system. Hence it can be build (like any other module) using the dunecontrol script provided by the core modules. For details on how to use this build system and how to specify build options have a look at the general documentation on the Dune website.

Documentation

The present Doxygen documentation contains a class documentation and commented step-by-step Examples. For a structured overview of the components of dune-fufem you can have a look at the Topics page. This documentation can be generated locally using make doc, once the module has been configured and is afterwards located in [build-directory]/doc/doxygen/html/.

The Examples are not built automatically. Instead they can be built using make build_examples once the module has been built. Besides this, some features are also documented in a work-in-progress manual which is created by calling make doc.