Since 2.9 release
This function is deprecated. Use
dune.fem.integrate instead. The ufl
expression to integrate is now the first argument. If possible the grid
view and order will be determined from the ufl expression if possible but
can be passed in as extra arguments similar to the old function:
To construct different versions of grid function use
dune.fem.function.gridFunction. The signature of the new function is
def gridFunction(expr=None,gridView=None,*,name=None,order=None, fctName=None, view=None, **kwargs).
None) then the function acts like the decorator from 2.9 version. Note that the old
viewparameter is also deprecated and replaced by
@gridFunction(gv,"name",5)will not work anymore since name and order need to be named arguments. So this will lead to an error instead of a deprecation warning and needs to be replaced by
expris a ufl expression then this functions acts like the
uflFunctionfrom 2.9 with the old
uflargument being replaced by
expr. In addition
ordercan be omitted in case where the grid view can be determined from the ufl expression (e.g. the expression contains a grid function). The order will be determined heuristically from the expression if omitted.
expris a string then the function acts as like the old
fctNameis not provided the
nameargument is assumed to also be the name of the cpp function to export.
Use the extended version of
Use the new method
linear on the schemes or operators. Note that the
new method has no
ubar argument (use the
jacobian method to
assemble around a non zero value). The method has a new bool argument
True by default. Passing in
assemble=False returns an
empty linear operator which can be passed into
jacobian to be filled.
This has been renamed to
dune.fem.space.compositeSpace and will be
DirichletIndices method to operators and schemes
This method returns the indices of dofs on the Dirichlet boundary. By default all indices are returned but a boundary id can be provided to only return a subset of indices.
Extension of the
jacobian method on schemes and operators
In addition to the existing
jacobian method taking a linear operator
object a new overload is available taking a further rhs argument which
returns the functional part of the operator as though it was on the right
hand side. So if the ufl form is
a(u,v)=l(v) then this method assembles
both the system matrix
A and the right hand side functional (
needs to be a discrete function over the range space of the operator).
Set non default quadratures in quadrature rules
At the moment only
available that sets a quadrature that can be used for lower order Lagrange
elements to use lumped mass matrices. More general cases will be added
dune.fem.assemble takes a ufl form and returns their assembled versions.
If the first argument has arity zero (i.e. has no trial or test function) then the intral will be computed, e.g.,
ufl.SpatialCoordinate. Note that the grid view needs to be provided since it can not be determined from the ufl form. It can be omitted if the form contains for example a grid function, e.g.,
dune.fem.assemble(inner(grad(u_h),grad(u_h))*dx). Note that forms are always scalar valued. For vector valued integration use
If the first function has arity one (i.e. contains a test function) then the functional we be assembled returning a discrete function:
dune.fem.assemble(f*v*dx). Again if possible the grid view will be extracted from the form.
If the first argument has arity two (i.e. contains both test and trial function) then the function assembles the system matrix and (if the form contains a arity one part) the right hand side functional:
dune.fem.assemble(u*v*dx - f*v*dx)returns the linear operator for
u*v*dxand the discrete function for
f*v*dx. If the form does not contain an arity one part, e.g.,
dune.fem.assemble(u*v*dx)returns only the linear operator.
Improved Pickling support
Discrete functions can now be directly pickled and will
be reconstructed with the grid on load.
The required JIT modules will also be
generated on load if they do not exist on the system.
For this to work one needs to use the
module as discussed in the Section on
A paraview reader is added to the
dune.fem package which can directly work
with the pickled files. UFL transformations
can be applied after loading the discrete functions in paraview.
For paraview to find the reader a environment variable needs to be set.
The correct command can be found running
python -m dune.fem reader or
the correct env variable can be set by running
export PV_PLUGIN_PATH=`python -m dune.fem readerpath`
Sampler along Boundary
In addition to a
module now also provides a
boundarySample(gridFunction, boundaryId=None, boundaryDomain=None, order=-1)
See the help text of dune.fem.utility.boundarySample for details.
Point sampler returning (entity,local coordinate) for given global coordinate
Improved Dirichlet Boundary Indexing in UFL Forms
To restrict a domain integral to a part of the boundary given by a boundary id
one can now use
ufl.ds(id) or multiply the integral with
(see the section on
Mixing different types of boundary conditions.
Note: we have also unified the
default boundary ids
when using a
dune.grid.cartesianDomain to always be the same as when using
This was not the case with some grid implementations.
Eisenstatwalker in Newton method
Storage setup in scheme
Methods on space to return local mapper and for evaluating basis functions
New methods have been added to the space to return the basis functions evaluated at some given point. Also a new method has been added to return the global indices of the dofs attached to a given element.