Ferrite changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v1.1.0 - 2025-05-01
Added
- New vector interpolations for H(div) and H(curl) spaces (
Nedelec,RaviartThomas,BrezziDouglasMarini). (#1045,#1162) - New boundary condition type,
ProjectedDirichlet, for H(div) and H(curl) interpolations. (#1151) It can be added to a constraint handler the same way as for a regularDirichlet. - Support for exporting discontinuous fields to VTK. (#867) This happens automatically when a DofHandler with a discontinuous field is used to construct the
VTKGridFile, but can be requested with thewrite_discontinuouskeyword argument.
Fixes
addboundaryfacetsethas been fixed for mixed grids. (#1176)evaluate_at_grid_nodesnow respects the precision of the input dof vector. (#1044)
Removed
- The deprecated third type parameter for interpolations has been removed. (#1083) Old code which tries to use three parameters will now throw the somewhat cryptic error:
julia> Lagrange{2, RefCube, 1}() ERROR: too many parameters for type
Documentation updates
- A comparison between different assembly strategies have been added to the docs. (#1063)
- The affine constraints docs have been extended. (#1146)
Other
v1.0.0 - 2024-09-30
Ferrite version 1.0 is a relatively large release, with a lot of new features, improvements, deprecations and some removals. These changes are made to make the code base more consistent and more suitable for future improvements. With this 1.0 release we are aiming for long time stability, and there is no breaking release 2.0 on the horizon.
Unfortunately this means that code written for Ferrite version 0.3 will have to be updated. All changes, with upgrade paths, are listed in the sections below. Since these sections include a lot of other information as well (new features, internal changes, ...) there is also a dedicated section about upgrading code from Ferrite 0.3 to 1.0 (see below) which include the most common changes that are required. In addition, in all cases where possible, you will be presented with a descriptive error message telling you what needs to change.
Deprecations for 1.0 will be removed during the 1.x release series. When upgrading old code it is therefore recommended to use Ferrite 1.0 as a first stepping stone since this release contain descriptive deprecation error messages that might not exist in e.g. Ferrite version 1.2.
Upgrading code from Ferrite 0.3 to 1.0
This section give a short overview of the most common required changes. More details and motivation are included in the following sections (with links to issues/pull request for more discussion).
Interpolations: remove the first parameter (the reference dimension) and use new reference shapes.
Examples:
# Linear Lagrange interpolation for a line - Lagrange{1, RefCube, 1}() + Lagrange{RefLine, 1}() # Linear Lagrange interpolation for a quadrilateral - Lagrange{2, RefCube, 1}() + Lagrange{RefQuadrilateral, 1}() # Quadratic Lagrange interpolation for a triangle - Lagrange{2, RefTetrahedron, 2}() + Lagrange{RefTriangle, 2}()For vector valued problems it is now required to explicitly vectorize the interpolation using the new
VectorizedInterpolation. This is required when passing the interpolation toCellValuesand when adding fields to theDofHandlerusingadd!. In both of these places the interpolation was implicitly vectorized in Ferrite 0.3.Examples:
# Linear Lagrange interpolation for a vector problem on the triangle (vector dimension # same as the reference dimension) ip_scalar = Lagrange{RefTriangle, 1}() ip_vector = ip_scalar ^ 2 # or VectorizedInterpolation{2}(ip_scalar)Quadrature: remove the first parameter (the reference dimension) and use new reference shapes.
Examples:
# Quadrature for a line - QuadratureRule{1, RefCube}(quadrature_order) + QuadratureRule{RefLine}(quadrature_order) # Quadrature for a quadrilateral - QuadratureRule{2, RefCube}(quadrature_order) + QuadratureRule{RefQuadrilateral}(quadrature_order) # Quadrature for a tetrahedron - QuadratureRule{3, RefTetrahedron}(quadrature_order) + QuadratureRule{RefTetrahedron}(quadrature_order)Quadrature for face integration (FacetValues): replace
QuadratureRule{dim-1, reference_shape}(quadrature_order)withFacetQuadratureRule{reference_shape}(quadrature_order).Examples:
# Quadrature for the facets of a quadrilateral - QuadratureRule{1, RefCube}(quadrature_order) + FacetQuadratureRule{RefQuadrilateral}(quadrature_order) # Quadrature for the facets of a triangle - QuadratureRule{1, RefTetrahedron}(quadrature_order) + FacetQuadratureRule{RefTriangle}(quadrature_order) # Quadrature for the facets of a hexhedron - QuadratureRule{2, RefCube}(quadrature_order) + FacetQuadratureRule{RefHexahedron}(quadrature_order)CellValues: replace usage of
CellScalarValuesandCellVectorValueswithCellValues. For vector valued problems the interpolation passed toCellValuesshould be vectorized to aVectorizedInterpolation(see above).Examples:
# CellValues for a scalar problem with triangle elements - qr = QuadratureRule{2, RefTetrahedron}(quadrature_order) - ip = Lagrange{2, RefTetrahedron, 1}() - cv = CellScalarValues(qr, ip) + qr = QuadratureRule{RefTriangle}(quadrature_order) + ip = Lagrange{RefTriangle, 1}() + cv = CellValues(qr, ip) # CellValues for a vector problem with hexahedronal elements - qr = QuadratureRule{3, RefCube}(quadrature_order) - ip = Lagrange{3, RefCube, 1}() - cv = CellVectorValues(qr, ip) + qr = QuadratureRule{RefHexahedron}(quadrature_order) + ip = Lagrange{RefHexahedron, 1}() ^ 3 + cv = CellValues(qr, ip)If you use
CellScalarValuesorCellVectorValuesin method signature you must replace them withCellValues. Note that the type parameters are different.Examples:
- function do_something(cvs::CellScalarValues, cvv::CellVectorValues) + function do_something(cvs::CellValues, cvv::CellValues)The default geometric interpolation have changed from the function interpolation to always use linear Lagrange interpolation. If you use linear elements in the grid, and a higher order interpolation for the function you can now rely on the new default:
qr = QuadratureRule(...) - ip_function = Lagrange{2, RefTetrahedron, 2}() - ip_geometry = Lagrange{2, RefTetrahedron, 1}() - cv = CellScalarValues(qr, ip_function, ip_geometry) + ip_function = Lagrange{RefTriangle, 2}() + cv = CellValues(qr, ip_function)and if you have quadratic (or higher order) elements in the grid you must now pass the corresponding interpolation to the constructor:
qr = QuadratureRule(...) - ip_function = Lagrange{2, RefTetrahedron, 2}() - cv = CellScalarValues(qr, ip_function) + ip_function = Lagrange{RefTriangle, 2}() + ip_geometry = Lagrange{RefTriangle, 1}() + cv = CellValues(qr, ip_function, ip_geometry)FacetValues: replace usage of
FaceScalarValuesandFaceVectorValueswithFacetValues. For vector valued problems the interpolation passed toFacetValuesshould be vectorized to aVectorizedInterpolation(see above). The input quadrature rule should be aFacetQuadratureRuleinstead of aQuadratureRule.Examples:
# FacetValues for a scalar problem with triangle elements - qr = QuadratureRule{1, RefTetrahedron}(quadrature_order) - ip = Lagrange{2, RefTetrahedron, 1}() - cv = FaceScalarValues(qr, ip) + qr = FacetQuadratureRule{RefTriangle}(quadrature_order) + ip = Lagrange{RefTriangle, 1}() + cv = FacetValues(qr, ip) # FaceValues for a vector problem with hexahedronal elements - qr = QuadratureRule{2, RefCube}(quadrature_order) - ip = Lagrange{3, RefCube, 1}() - cv = FaceVectorValues(qr, ip) + qr = FacetQuadratureRule{RefHexahedron}(quadrature_order) + ip = Lagrange{RefHexahedron, 1}() ^ 3 + cv = FacetValues(qr, ip)DofHandler construction: it is now required to pass the interpolation explicitly when adding new fields using
add!(previously it was optional, defaulting to the default interpolation of the elements in the grid). For vector-valued fields the interpolation should be vectorized, instead of passing the number of components toadd!as an integer.Examples:
dh = DofHandler(grid) # grid with triangles # Vector field :u - add!(dh, :u, 2) + add!(dh, :u, Lagrange{RefTriangle, 1}()^2) # Scalar field :p - add!(dh, :u, 1) + add!(dh, :u, Lagrange{RefTriangle, 1}())Boundary conditions: The entity enclosing a cell was previously called
face, but is now denoted afacet. When applying boundary conditions, renamegetfacesettogetfacetsetandaddfaceset!is nowaddfacetset!. These sets are now described byFacetIndexinstead ofFaceIndex. When looping over thefacetsof a cell, changenfacestonfacets.Examples:
# Dirichlet boundary conditions - addfaceset!(grid, "dbc", x -> x[1] ≈ 1.0) + addfacetset!(grid, "dbc", x -> x[1] ≈ 1.0) - dbc = Dirichlet(:u, getfaceset(grid, "dbc"), Returns(0.0)) + dbc = Dirichlet(:u, getfacetset(grid, "dbc"), Returns(0.0)) # Neumann boundary conditions - for facet in 1:nfaces(cell) - if (cellid(cell), facet) ∈ getfaceset(grid, "Neumann Boundary") + for facet in 1:nfacets(cell) + if (cellid(cell), facet) ∈ getfacetset(grid, "Neumann Boundary") # ...VTK Export: The VTK export has been changed #692.
- vtk_grid(name, dh) do vtk - vtk_point_data(vtk, dh, a) - vtk_point_data(vtk, nodal_data, "my node data") - vtk_point_data(vtk, proj, projected_data, "my projected data") - vtk_cell_data(vtk, proj, projected_data, "my projected data") + VTKGridFile(name, dh) do vtk + write_solution(vtk, dh, a) + write_node_data(vtk, nodal_data, "my node data") + write_projection(vtk, proj, projected_data, "my projected data") + write_cell_data(vtk, cell_data, "my projected data") endWhen using a
paraview_collectioncollection for e.g. multiple timesteps theVTKGridFileobject can be used instead of the previous type returned fromvtk_grid.Sparsity pattern and global matrix construction: since there is now explicit support for working with the sparsity pattern before instantiating a matrix the function
create_sparsity_patternhas been removed. To recover the old functionality that return a sparse matrix from the DofHandler directly useallocate_matrixinstead.Examples:
# Create sparse matrix from DofHandler - K = create_sparsity_pattern(dh) + K = allocate_matrix(dh) # Create condensed sparse matrix from DofHandler + ConstraintHandler - K = create_sparsity_pattern(dh, ch) + K = allocate_matrix(dh, ch)
Added
InterfaceValuesfor computing jumps and averages over interfaces. (#743)InterfaceIteratorandInterfaceCachefor iterating over interfaces. (#747)FacetQuadratureRuleimplementation forRefPrismandRefPyramid. (#779)The
DofHandlernow support selectively adding fields on sub-domains (rather than the full domain). This new functionality is included with the newSubDofHandlerstruct, which, as the name suggest, is aDofHandlerfor a subdomain. (#624, #667, #735)New reference shape structs
RefLine,RefTriangle,RefQuadrilateral,RefTetrahedron,RefHexahedron, andRefPrismhave been added. These encode the reference dimension, and will thus replace the old reference shapes for which it was necessary to always pair with an explicit dimension (i.e.RefLinereplaces(RefCube, 1),RefTrianglereplaces(RefTetrahedron, 2), etc.). For writing "dimension independent code" it is possible to useFerrite.RefHypercube{dim}andFerrite.RefSimplex{dim}. (#679)New methods for adding entitysets that are located on the boundary of the grid:
addboundaryfacetset!andaddboundaryvertexset!. These work similar toaddfacetset!andaddvertexset!, but filters out all instances not on the boundary (this can be used to avoid accidental inclusion of internal entities in sets used for boundary conditions, for example). (#606)New interpolation
VectorizedInterpolationwhich vectorizes scalar interpolations for vector-valued problems. AVectorizedInterpolationis created from a (scalar) interpolationipusing eitherip ^ dimorVectorizedInterpolation{dim}(ip). For convenience, the methodVectorizedInterpolation(ip)vectorizes the interpolation to the reference dimension of the interpolation. (#694, #736)New (scalar) interpolation
Lagrange{RefQuadrilateral, 3}(), i.e. third order Lagrange interpolation for 2D quadrilaterals. (#701, #731)CellValuesnow support embedded elements. Specifically you can now embed elements with reference dimension 1 into spatial dimension 2 or 3, and elements with reference dimension 2 in to spatial dimension 3. (#651)CellValuesnow support (vector) interpolations with dimension different from the spatial dimension. (#651)FacetQuadratureRulehave been added and should be used forFacetValues. AFacetQuadratureRulefor integration of the facets of e.g. a triangle can be constructed byFacetQuadratureRule{RefTriangle}(order)(similar to howQuadratureRuleis constructed). (#716)New functions
Ferrite.reference_shape_value(::Interpolation, ξ::Vec, i::Int)andFerrite.reference_shape_gradient(::Interpolation, ξ::Vec, i::Int)for evaluating the value/gradient of theith shape function of an interpolation in local reference coordinateξ. These methods are public but not exported. (Note that these methods return the value/gradient wrt. the reference coordinateξ, whereas the corresponding methods forCellValuesetc return the value/gradient wrt the spatial coordinatex.) (#721)FacetIteratorandFacetCachehave been added. These work similarly toCellIteratorandCellCachebut are used to iterate over (boundary) face sets instead. These simplify boundary integrals in general, and in particular Neumann boundary conditions are more convenient to implement now that you can loop directly over the face set instead of checking all faces of a cell inside the element routine. (#495)The
ConstraintHandlernow support adding Dirichlet boundary conditions on discontinuous interpolations. (#729)collect_periodic_facesnow have a keyword argumenttolthat can be used to relax the default tolerance when necessary. (#749)VTK export now work with
QuadraticHexahedronelements. (#714)The function
bounding_box(::AbstractGrid)has been added. It computes the bounding box for a given grid (based on its node coordinates), and returns the minimum and maximum vertices of the bounding box. (#880)Support for working with sparsity patterns has been added. This means that Ferrite exposes the intermediate "state" between the DofHandler and the instantiated matrix as the new struct
SparsityPattern. This make it possible to insert custom equations or couplings in the pattern before instantiating the matrix. The functioncreate_sparsity_patternhave been removed. The new functionallocate_matrixis instead used to instantiate the matrix. Refer to the documentation for more details. (#888)To upgrade: if you want to recover the old functionality and don't need to work with the pattern, replace any usage of
create_sparsity_patternwithallocate_matrix.A new function,
geometric_interpolation, is exported, which gives the geometric interpolation for each cell type. This is equivalent to the deprecatedFerrite.default_interpolationfunction. (#953)CellValues and FacetValues can now store and map second order gradients (Hessians). The number of gradients computed in CellValues/FacetValues is specified using the keyword arguments
update_gradients::Bool(default true) andupdate_hessians::Bool(default false) in the constructors, i.e.CellValues(...; update_hessians=true). (#953)L2Projectorsupports projecting on grids with mixed celltypes. (#949)
Changed
It is now possible to create sparsity patterns with interface couplings, see the new function
add_interface_entries!and the rework of sparsity pattern construction. (#710)The
AbstractCellinterface has been reworked. This change should not affect user code, but may in some cases be relevant for code parsing external mesh files. In particular, the genericCellstruct have been removed in favor of concrete cell implementations (Line,Triangle, ...). (#679, #712)To upgrade replace any usage of
Cell{...}(...)with calls to the concrete implementations.The default geometric mapping in
CellValuesandFacetValueshave changed. The new default is to always useLagrange{refshape, 1}(), i.e. linear Lagrange polynomials, for the geometric interpolation. Previously, the function interpolation was (re) used also for the geometry interpolation. (#695)To upgrade, if you relied on the previous default, simply pass the function interpolation also as the third argument (the geometric interpolation).
All interpolations are now categorized as either scalar or vector interpolations. All (previously) existing interpolations are scalar. (Scalar) interpolations must now be explicitly vectorized, using the new
VectorizedInterpolation, when used for vector problems. (Previously implicit vectorization happened in theCellValuesconstructor, and when adding fields to theDofHandler). (#694)It is now required to explicitly pass the interpolation to the
DofHandlerwhen adding a new field usingadd!. For vector fields the interpolation should be vectorized, instead of passing number of components as an integer. (#694)To upgrade don't pass the dimension as an integer, and pass the interpolation explicitly. See more details in Upgrading code from Ferrite 0.3 to 1.0.
Interpolations should now be constructed using the new reference shapes. Since the new reference shapes encode the reference dimension the first type parameter of interpolations have been removed. (#711) To upgrade replace e.g.Lagrange{1, RefCube, 1}()withLagrange{RefLine, 1}(), andLagrange{2, RefTetrahedron, 1}()withLagrange{RefTriangle, 1}(), etc.QuadratureRules should now be constructed using the new reference shapes. Since the new reference shapes encode the reference dimension the first type parameter ofQuadratureRulehave been removed. (#711, #716) To upgrade replace e.g.QuadratureRule{1, RefCube}(order)withQuadratureRule{RefLine}(order), andQuadratureRule{2, RefTetrahedron}(1)withLagrange{RefTriangle}(order), etc.CellScalarValuesandCellVectorValueshave been merged intoCellValues,FaceScalarValuesandFaceVectorValueshave been merged intoFacetValues, andPointScalarValuesandPointVectorValueshave been merged intoPointValues. The differentiation between scalar and vector have thus been moved to the interpolation (see above). Note that previouslyCellValues,FaceValues, andPointValueswhere abstract types, but they are now concrete implementations with different type parameters, exceptFaceValueswhich is nowFacetValues(#708) To upgrade, for scalar problems, it is enough to replaceCellScalarValueswithCellValues,FaceScalarValueswithFacetValuesandPointScalarValueswithPointValues, respectively. For vector problems, make sure to vectorize the interpolation (see above) and then replaceCellVectorValueswithCellValues,FaceVectorValueswithFacetValues, andPointVectorValueswithPointValues.The quadrature rule passed to
FacetValuesshould now be of typeFacetQuadratureRulerather than of typeQuadratureRule. (#716) To upgrade replace the quadrature rule passed toFacetValueswith aFacetQuadratureRule.Checking if a face
(ele_id, local_face_id) ∈ facesethas been previously implemented by type piracy. In order to be invariant to the underlyingSetdatatype as well as omitting type piracy, (#835) implementedisequalandhashforBoundaryIndexdatatypes.VTK export: Ferrite no longer extends
WriteVTK.vtk_gridand associated functions, instead the new typeVTKGridFileshould be used instead. New methods exists for writing to aVTKGridFile, e.g.write_solution,write_cell_data,write_node_data, andwrite_projection. See #692.Definitions: Previously,
faceandedgereferred to codimension 1 relative reference shape. In Ferrite v1,volume,face,edge, andvertexrefer to 3, 2, 1, and 0 dimensional entities, andfacetreplaces the old definition offace. No direct replacement foredgesexits. See #914 and #914. The main implications of this change areFaceIndex->FacetIndex(FaceIndexstill exists, but has a different meaning)FaceValues->FacetValuesnfaces->nfacets(nfacesis now an internal method with different meaning)addfaceset!->addfacetsetgetfaceset->getfacetset
Furthermore, subtypes of
Interpolationshould now definevertexdof_indices,edgedof_indices,facedof_indices,volumedof_indices(and similar) according to these definitions.Ferrite.getdimhas been changed intoFerrite.getrefdimfor getting the dimension of the reference shape andFerrite.getspatialdimto get the spatial dimension (of the grid). (#943)Ferrite.getfielddim(::AbstractDofHandler, args...)has been renamed toFerrite.n_components. (#943)The constructor for
ExclusiveTopologyonly accept anAbstractGridas input, removing the alternative of providing aVector{<:AbstractCell}, as knowing the spatial dimension is required for correct code paths. Furthermore, it uses a new internal data structure,ArrayOfVectorViews, to store the neighborhood information more efficiently The datatype for the neighborhood has thus changed to a view of a vector, instead of the now removedEntityNeighborhoodcontainer. This also applies tovertex_star_stencils. (#974).project(::L2Projector, data, qr_rhs)now expects data to be indexed by the cellid, as opposed to the index in the vector of cellids passed to theL2Projector. The data may be passed as anAbstractDict{Int, <:AbstractVector}, as an alternative toAbstractArray{<:AbstractVector}. (#949)
Deprecated
The rarely (if ever) used methods of
function_value,function_gradient,function_divergence, andfunction_curltaking vectorized dof values as in put have been deprecated. (#698)The function
reshape_to_nodeshave been deprecated in favor ofevaluate_at_grid_nodes. (#703)start_assemble([n::Int])has been deprecated in favor of callingFerrite.COOAssembler()directly (#916, #1058).start_assemble(f, K)have been deprecated in favor of the "canonical"start_assemble(K, f). (#707)assemble!(assembler, dofs, fe, Ke)have been deprecated in favor of the "canonical"assemble!(assembler, dofs, Ke, fe). (#1059)end_assemblehave been deprecated in favor offinish_assemble. (#754)get_point_valueshave been deprecated in favor ofevaluate_at_points. (#754)transform!have been deprecated in favor oftransform_coordinates!. (#754)Ferrite.default_interpolationhas been deprecated in favor ofgeometric_interpolation. (#953)
Removed
MixedDofHandler+FieldHandlerhave been removed in favor ofDofHandler+SubDofHandler. Note that the syntax has changed, and note thatSubDofHandleris much more capable compared toFieldHandler. Previously it was often required to pass both theMixedDofHandlerand theFieldHandlerto e.g. the assembly routine, but now it is enough to pass theSubDofHandlersince it can be used for e.g. DoF queries etc. (#624, #667, #735)Some old methods to construct the
L2Projectorhave been removed after being deprecated for several releases. (#697)The option
project_to_nodeshave been removed fromproject(::L2Projector, ...). The returned values are now always ordered according to the projectors internalDofHandler. (#699)The function
compute_vertex_valueshave been removed. (#700)The names
getweights,getpoints,getcellsets,getnodesets,getfacesets,getedgesets, andgetvertexsetshave been removed from the list of exported names. (For now you can still use them by prefixingFerrite., e.g.Ferrite.getweights.) (#754)The
onboundaryfunction (and the associatedboundary_matrixproperty of theGriddatastructure) have been removed (#924). Instead of first checkingonboundaryand then check whether a facet belong to a specific facetset, check the facetset directly. For example:- if onboundary(cell, local_face_id) && (cell_id, local_face_id) in getfacesets(grid, "traction_boundary") + if (cell_id, local_face_id) in getfacesets(grid, "traction_boundary") # integrate the "traction_boundary" boundary end
Fixed
Topology construction have been generalized to, in particular, fix construction for 1D and for wedge elements. (#641, #670, #684)
Other improvements
Documentation:
- The documentation is now structured according to the Diataxis framework. There is now also clear separation between tutorials (for teaching) and code gallery (for showing off). (#737, #756)
- New section in the developer documentation that describes the (new) reference shapes and their numbering scheme. (#688)
Performance:
Ferrite.transform!(grid, f)(for transforming the node coordinates in thegridaccording to a functionf) is now faster and allocates less. (#675)- Slight performance improvement in construction of
PointEvalHandler(faster reverse coordinate lookup). (#719) - Various performance improvements to topology construction. (#753, #759)
Internal improvements:
- The dof distribution interface have been updated to support higher order elements (future work). (#627, #732, #733)
- The
AbstractGridandAbstractDofHandlerinterfaces are now used more consistently internally. This will help with the implementation of distributed grids and DofHandlers. (#655) - VTK export now uses the (geometric) interpolation directly when evaluating the finite element field instead of trying to work backwards how DoFs map to nodes. (#703)
- Improved bounds checking in
assemble!. (#706) - Internal methods
Ferrite.valueandFerrite.derivativefor computing the value/gradient of all shape functions have been removed. (#720) Ferrite.create_incidence_matrixnow work with anyAbstractGrid(not justGrid). (#726)
v0.3.14 - 2023-04-03
Added
- Support reordering dofs of a
MixedDofHandlerby the built-in orderingsFieldWiseandComponentWise. This includes support for reordering dofs of fields on subdomains. (#645) - Support specifying the coupling between fields in a
MixedDofHandlerwhen creating the sparsity pattern. (#650) - Support Metis dof reordering with coupling information for
MixedDofHandler. (#650) - Pretty printing for
MixedDofHandlerandL2Projector. (#465)
Other improvements
- The
MixedDofHandlerhave gone through a performance review (see #629) and now performs the same asDofHandler. This was part of the push to merge the two DoF handlers. SinceMixedDofHandleris strictly more flexible, and now equally performant, it will replaceDofHandlerin the next breaking release. (#637, #639, #642, #643, #656, #660)
Internal changes
Changes listed here should not affect regular usage, but listed here in case you have been poking into Ferrite internals:
Ferrite.ndim(dh, fieldname)has been removed, useFerrite.getfielddim(dh, fieldname)instead. (#658)Ferrite.nfields(dh)has been removed, uselength(Ferrite.getfieldnames(dh))instead. (#444, #653)getfielddims(::FieldHandler)andgetfieldinterpolations(::FieldHandler)have been removed (#647, #659)
v0.3.13 - 2023-03-23
Added
- Support for classical trilinear and triquadratic wedge elements. (#581)
- Symmetric quadrature rules up to order 10 for prismatic elements. (#581)
- Finer granulation of dof distribution, allowing to distribute different amounts of dofs per entity. (#581)
Fixed
- Dof distribution for embedded elements. (#581)
- Improve numerical accuracy in shape function evaluation for the
Lagrange{2,Tetrahedron,(3|4|5)}interpolations. (#582, #633)
Other improvements
- Documentation:
- Performance:
Internal changes
- To clarify the dof management
vertices(ip),edges(ip)andfaces(ip)has been deprecated in favor ofvertexdof_indices(ip),edgedof_indices(ip)andfacedof_indices(ip). (#581) - Duplicate grid representation has been removed from the
MixedDofHandler. (#577)
v0.3.12 - 2023-02-28
Added
- Added a basic
showmethod for assemblers. (#598)
Fixed
- Fix an issue in constraint application of
Symmetric-wrapped sparse matrices (i.e. obtained fromcreate_symmatric_sparsity_pattern). In particular,apply!(K::Symmetric, f, ch)would incorrectly modifyfif any of the constraints were inhomogeneous. (#592) - Properly disable the Metis extension on Julia 1.9 instead of causing precompilation errors. (#588)
- Fix adding Dirichlet boundary conditions on nodes when using MixedDofHandler. (#593, #594)
- Fix accidentally slow implementation of
showforGrids. (#599) - Fixes to topology functionality. (#453, #518, #455)
- Fix grid coloring for cell sets with 0 or 1 cells. (#600)
Other improvements
- Documentation improvements:
v0.3.11 - 2023-01-17
Added
- Metis.jl extension for fill-reducing DoF permutation. This uses Julias new package extension mechanism (requires Julia 1.10) to support a new DoF renumbering order
DofOrder.Ext{Metis}()that can be passed torenumber!to renumber DoFs using the Metis.jl library. (#393, #549) - BlockArrays.jl extension for creating a globally blocked system matrix.
create_sparsity_pattern(BlockMatrix, dh, ch; kwargs...)return a matrix that is blocked by field (requires DoFs to be (re)numbered by field, i.e.renumber!(dh, DofOrder.FieldWise())). For custom blocking it is possible to pass an uninitializedBlockMatrixwith the correct block sizes (seeBlockArrays.jldocs). This functionality is useful for e.g. special solvers where individual blocks need to be extracted. Requires Julia version 1.9 or above. (#567) - New function
apply_analytical!for setting the values of the degrees of freedom for a specific field according to a spatial functionf(x). (#532) - New cache struct
CellCacheto be used when iterating over the cells in a grid or DoF handler.CellCachecaches nodes, coordinates, and DoFs, for the cell. The cachecccan be re-initialized for a new cell indexciby callingreinit!(cc, ci). This can be used as an alternative toCellIteratorwhen more control over which element to loop over is needed. See documentation forCellCachefor more information. (#546) - It is now possible to create the sparsity pattern without constrained entries (they will be zeroed out later anyway) by passing
keep_constrained=falsetocreate_sparsity_pattern. This naturally only works together with local condensation of constraints since there won't be space allocated in the global matrix for the full (i.e. "non-condensed") element matrix. Creating the matrix without constrained entries reduces the memory footprint, but unless a significant amount of DoFs are constrained (e.g. high mesh resolution at a boundary) the savings are negligible. (#539)
Changed
ConstraintHandler:update!is now called implicitly inclose!. This was easy to miss, and somewhat of a strange requirement when solving problems without time stepping. (#459)- The function for computing the inhomogeneity in a
Dirichletconstraint can now be specified as eitherf(x)orf(x, t), wherexis the spatial coordinate andtthe time. (#459) - The elements of a
CellIteratorare nowCellCacheinstead of the iterator itself, which was confusing in some cases. This change does not affect typical user code. (#546)
Deprecated
- Adding fields to a DoF handler with
push!(dh, ...)has been deprecated in favor ofadd!(dh, ...). This is to make it consistent with how constraints are added to a constraint handler. (#578)
Fixed
- Fix
shape_valuefor the linear, discontinuous Lagrange interpolation. (#553) - Fix
reference_coordinatedispatch for discontinuous Lagrange interpolations. (#559) - Fix
show(::Grid)for custom cell types. (#570) - Fix
apply_zero!(Δa, ch)when using inhomogeneous affine constraints (#575)
Other improvements
- Internal changes defining a new global matrix/vector "interface". These changes make it easy to enable more array types (e.g.
BlockMatrixsupport added in this release) and solvers in the future. (#562, #571) - Performance improvements:
- Reduced time and memory allocations for global sparse matrix creation (Julia >= 1.10). (#563)
- Documentation improvements:
v0.3.10 - 2022-12-11
Added
- New functions
apply_local!andapply_assemble!for applying constraints locally on the element level before assembling to the global system. (#528) - New functionality to renumber DoFs by fields or by components. This is useful when you need the global matrix to be blocked. (#378, #545)
- Functionality to renumber DoFs in DofHandler and ConstraintHandler simultaneously:
renumber!(dh::DofHandler, ch::ConstraintHandler, order). Previously renumbering had to be done before creating the ConstraintHandler since otherwise DoF numbers would be inconsistent. However, this was inconvenient in cases where the constraints impact the new DoF order permutation. (#542) - The coupling between fields can now be specified when creating the global matrix with
create_sparsity_patternby passing aMatrix{Bool}. For example, in a problem with unknowns(u, p)and corresponding test functions(v, q), if there is no coupling betweenpandqit is unnecessary to allocate entries in the global matrix corresponding to these DoFs. This can now be communicated tocreate_sparsity_patternby passing the coupling matrix[true true; true false]in the keyword argumentcoupling. (#544)
Changed
- Runtime and allocations for application of boundary conditions in
apply!andapply_zero!have been improved. As a result, thestrategykeyword argument is obsolete and thus ignored. (#489) - The internal representation of
Dirichletboundary conditions andAffineConstraints in theConstraintHandlerhave been unified. As a result, conflicting constraints on DoFs are handled more consistently: the constraint added last to theConstraintHandlernow always override any previous constraints. Conflicting constraints could previously cause problems when a DoF where prescribed by bothDirichletandAffineConstraint. (#529) - Entries in local matrix/vector are now ignored in the assembly procedure. This allows, for example, using a dense local matrix
[a b; c d]even if no entries exist in the global matrix for thedblock, i.e. in[A B; C D]theDblock is zero, and these global entries might not exist in the sparse matrix. (Such sparsity patterns can now be created bycreate_sparsity_pattern, see #544.) (#543)
Fixed
- Fix affine constraints with prescribed DoFs in the right-hand-side. In particular, DoFs that are prescribed by just an inhomogeneity are now handled correctly, and nested affine constraints now give an error instead of silently giving the wrong result. (#530, #535)
- Fixed internal inconsistency in edge ordering for 2nd order RefTetrahedron and RefCube. (#520, #523)
Other improvements
- Performance improvements:
- Documentation improvements:
- Unification of
create_sparsity_patternmethods to remove code duplication betweenDofHandlerandMixedDofHandler. (#538, #540)
v0.3.9 - 2022-10-19
Added
- New higher order function interpolations for triangles (
Lagrange{2,RefTetrahedron,3},Lagrange{2,RefTetrahedron,4}, andLagrange{2,RefTetrahedron,5}). (#482, #512) - New Gaussian quadrature formula for triangles up to order 15. (#514)
- Add debug mode for working with Ferrite internals. (#524)
Changed
- The default components to constrain in
DirichletandPeriodicDirichlethave changed from component 1 to all components of the field. For scalar problems this has no effect. (#506, #509)
v0.3.8 - 2022-10-05
Added
- Ferrite.jl now has a logo! (#464)
- New keyword argument
search_nneighbors::IntinPointEvalHandlerfor specifying how many neighboring elements to consider in the kNN search. The default is still 3 (usually sufficient). (#466) - The IJV-assembler now support assembling non-square matrices. (#471)
- Periodic boundary conditions have been reworked and generalized. It now supports arbitrary relations between the mirror and image boundaries (e.g. not only translations in x/y/z direction). (#478, #481, #496, #501)
Fixed
- Fix
PointEvalHandlerwhen the first point is missing. (#466) - Fix the ordering of nodes on the face for
(Quadratic)Tetrahedroncells. (#475)
Other improvements
- Many improvements to the documentation. (#467, #473, #487, #494, #500)
- Improved error messages in
reinit!when number of geometric base functions and number of element coordinates mismatch. (#469) - Remove some unnecessary function parametrizations. (#503)
- Remove some unnecessary allocations in grid coloring. (#505)
- More efficient way of creating the sparsity pattern when using
AffineConstraintsand/orPeriodicDirichlet. (#436)
v0.3.7 - 2022-07-05
Fixed
- Fix tests for newer version of WriteVTK (no functional change). (#462)
Other improvements
- Various improvements to the heat equation example and the hyperelasticity example in the documentation. (#460, #461)
v0.3.6 - 2022-06-30
Fixed
- Fix a bug with
L2Projectionof mixed grid. (#456)
Other improvements
- Expanded manual section of Dirichlet BCs. (#458)
v0.3.5 - 2022-05-30
Added
- Functionality for querying information about the grid topology (e.g. neighboring cells, boundaries, ...). (#363)
Fixed
- Fix application of boundary conditions when combining RHSData and affine constraints. (#431)
v0.3.4 - 2022-02-25
Added
- Affine (linear) constraints between degrees-of-freedom. (#401)
- Periodic Dirichlet boundary conditions. (#418)
- Evaluation of arbitrary quantities in FE space. (#425)
Changed
- Interpolation(s) and the quadrature rule are now stored as part of the
CellValuesstructs (cv.func_interp,cv.geo_interp, andcv.qr). (#428)
v0.3.3 - 2022-02-04
Changed
v0.3.2 - 2022-01-18
Added
- Support for new interpolation types:
DiscontinuousLagrange,BubbleEnrichedLagrange, andCrouzeixRaviart. (#352, #392)
Changed
- Julia version 1.0 is no longer supported for Ferrite versions >= 0.3.2. Use Julia version >= 1.6. (#385)
- Quadrature data for L2 projection can now be given as a matrix of size "number of elements" x "number of quadrature points per element". (#386)
- Projected values from L2 projection can now be exported directly to VTK. (#390)
- Grid coloring can now act on a subset of cells. (#402)
- Various functions related to cell values now use traits to make it easier to extend and reuse functionality in external code. (#404)
Fixed
- Exporting tensors to VTK now use correct names for the components. (#406)