diff --git a/previews/PR1096/.documenter-siteinfo.json b/previews/PR1096/.documenter-siteinfo.json index 86e15d84e9..97844642bf 100644 --- a/previews/PR1096/.documenter-siteinfo.json +++ b/previews/PR1096/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-29T12:10:20","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-31T12:08:54","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/previews/PR1096/changelog/index.html b/previews/PR1096/changelog/index.html index cf3b9bd1ee..73ad1cb1fc 100644 --- a/previews/PR1096/changelog/index.html +++ b/previews/PR1096/changelog/index.html @@ -111,4 +111,4 @@ + K = allocate_matrix(dh, ch)
InterfaceValues
for computing jumps and averages over interfaces. (#743)
InterfaceIterator
and InterfaceCache
for iterating over interfaces. (#747)
FacetQuadratureRule
implementation for RefPrism
and RefPyramid
. (#779)
The DofHandler
now support selectively adding fields on sub-domains (rather than the full domain). This new functionality is included with the new SubDofHandler
struct, which, as the name suggest, is a DofHandler
for a subdomain. (#624, #667, #735)
New reference shape structs RefLine
, RefTriangle
, RefQuadrilateral
, RefTetrahedron
, RefHexahedron
, and RefPrism
have 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. RefLine
replaces (RefCube, 1)
, RefTriangle
replaces (RefTetrahedron, 2)
, etc.). For writing "dimension independent code" it is possible to use Ferrite.RefHypercube{dim}
and Ferrite.RefSimplex{dim}
. (#679)
New methods for adding entitysets that are located on the boundary of the grid: addboundaryfacetset!
and addboundaryvertexset!
. These work similar to addfacetset!
and addvertexset!
, 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 VectorizedInterpolation
which vectorizes scalar interpolations for vector-valued problems. A VectorizedInterpolation
is created from a (scalar) interpolation ip
using either ip ^ dim
or VectorizedInterpolation{dim}(ip)
. For convenience, the method VectorizedInterpolation(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)
CellValues
now 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)
CellValues
now support (vector) interpolations with dimension different from the spatial dimension. (#651)
FacetQuadratureRule
have been added and should be used for FacetValues
. A FacetQuadratureRule
for integration of the facets of e.g. a triangle can be constructed by FacetQuadratureRule{RefTriangle}(order)
(similar to how QuadratureRule
is constructed). (#716)
New functions Ferrite.reference_shape_value(::Interpolation, ξ::Vec, i::Int)
and Ferrite.reference_shape_gradient(::Interpolation, ξ::Vec, i::Int)
for evaluating the value/gradient of the i
th 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 for CellValues
etc return the value/gradient wrt the spatial coordinate x
.) (#721)
FacetIterator
and FacetCache
have been added. These work similarly to CellIterator
and CellCache
but 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 ConstraintHandler
now support adding Dirichlet boundary conditions on discontinuous interpolations. (#729)
collect_periodic_faces
now have a keyword argument tol
that can be used to relax the default tolerance when necessary. (#749)
VTK export now work with QuadraticHexahedron
elements. (#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 function create_sparsity_pattern
have been removed. The new function allocate_matrix
is 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_pattern
with allocate_matrix
.
A new function, geometric_interpolation
, is exported, which gives the geometric interpolation for each cell type. This is equivalent to the deprecated Ferrite.default_interpolation
function. (#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) and update_hessians::Bool
(default false) in the constructors, i.e. CellValues(...; update_hessians=true)
. (#953)
L2Projector
supports projecting on grids with mixed celltypes. (#949)
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 AbstractCell
interface 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 generic Cell
struct 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 CellValues
and FacetValues
have changed. The new default is to always use Lagrange{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 the CellValues
constructor, and when adding fields to the DofHandler
). (#694)
It is now required to explicitly pass the interpolation to the DofHandler
when adding a new field using add!
. 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.
Interpolation
s 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}()
with Lagrange{RefLine, 1}()
, and Lagrange{2, RefTetrahedron, 1}()
with Lagrange{RefTriangle, 1}()
, etc.
QuadratureRule
s should now be constructed using the new reference shapes. Since the new reference shapes encode the reference dimension the first type parameter of QuadratureRule
have been removed. (#711, #716) To upgrade replace e.g. QuadratureRule{1, RefCube}(order)
with QuadratureRule{RefLine}(order)
, and QuadratureRule{2, RefTetrahedron}(1)
with Lagrange{RefTriangle}(order)
, etc.
CellScalarValues
and CellVectorValues
have been merged into CellValues
, FaceScalarValues
and FaceVectorValues
have been merged into FacetValues
, and PointScalarValues
and PointVectorValues
have been merged into PointValues
. The differentiation between scalar and vector have thus been moved to the interpolation (see above). Note that previously CellValues
, FaceValues
, and PointValues
where abstract types, but they are now concrete implementations with different type parameters, except FaceValues
which is now FacetValues
(#708) To upgrade, for scalar problems, it is enough to replace CellScalarValues
with CellValues
, FaceScalarValues
with FacetValues
and PointScalarValues
with PointValues
, respectively. For vector problems, make sure to vectorize the interpolation (see above) and then replace CellVectorValues
with CellValues
, FaceVectorValues
with FacetValues
, and PointVectorValues
with PointValues
.
The quadrature rule passed to FacetValues
should now be of type FacetQuadratureRule
rather than of type QuadratureRule
. (#716) To upgrade replace the quadrature rule passed to FacetValues
with a FacetQuadratureRule
.
Checking if a face (ele_id, local_face_id) ∈ faceset
has been previously implemented by type piracy. In order to be invariant to the underlying Set
datatype as well as omitting type piracy, (#835) implemented isequal
and hash
for BoundaryIndex
datatypes.
VTK export: Ferrite no longer extends WriteVTK.vtk_grid
and associated functions, instead the new type VTKGridFile
should be used instead. New methods exists for writing to a VTKGridFile
, e.g. write_solution
, write_cell_data
, write_node_data
, and write_projection
. See #692.
Definitions: Previously, face
and edge
referred to codimension 1 relative reference shape. In Ferrite v1, volume
, face
, edge
, and vertex
refer to 3, 2, 1, and 0 dimensional entities, and facet
replaces the old definition of face
. No direct replacement for edges
exits. See #914 and #914. The main implications of this change are
FaceIndex
-> FacetIndex
(FaceIndex
still exists, but has a different meaning)FaceValues
-> FacetValues
nfaces
-> nfacets
(nfaces
is now an internal method with different meaning)addfaceset!
-> addfacetset
getfaceset
-> getfacetset
Furthermore, subtypes of Interpolation
should now define vertexdof_indices
, edgedof_indices
, facedof_indices
, volumedof_indices
(and similar) according to these definitions.
Ferrite.getdim
has been changed into Ferrite.getrefdim
for getting the dimension of the reference shape and Ferrite.getspatialdim
to get the spatial dimension (of the grid). (#943)
Ferrite.getfielddim(::AbstractDofHandler, args...)
has been renamed to Ferrite.n_components
. (#943)
The constructor for ExclusiveTopology
only accept an AbstractGrid
as input, removing the alternative of providing a Vector{<: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 removed EntityNeighborhood
container. This also applies to vertex_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 the L2Projector
. The data may be passed as an AbstractDict{Int, <:AbstractVector}
, as an alternative to AbstractArray{<:AbstractVector}
. (#949)
The rarely (if ever) used methods of function_value
, function_gradient
, function_divergence
, and function_curl
taking vectorized dof values as in put have been deprecated. (#698)
The function reshape_to_nodes
have been deprecated in favor of evaluate_at_grid_nodes
. (#703)
start_assemble([n::Int])
has been deprecated in favor of calling Ferrite.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_assemble
have been deprecated in favor of finish_assemble
. (#754)
get_point_values
have been deprecated in favor of evaluate_at_points
. (#754)
transform!
have been deprecated in favor of transform_coordinates!
. (#754)
Ferrite.default_interpolation
has been deprecated in favor of geometric_interpolation
. (#953)
MixedDofHandler
+ FieldHandler
have been removed in favor of DofHandler
+ SubDofHandler
. Note that the syntax has changed, and note that SubDofHandler
is much more capable compared to FieldHandler
. Previously it was often required to pass both the MixedDofHandler
and the FieldHandler
to e.g. the assembly routine, but now it is enough to pass the SubDofHandler
since it can be used for e.g. DoF queries etc. (#624, #667, #735)
Some old methods to construct the L2Projector
have been removed after being deprecated for several releases. (#697)
The option project_to_nodes
have been removed from project(::L2Projector, ...)
. The returned values are now always ordered according to the projectors internal DofHandler
. (#699)
The function compute_vertex_values
have been removed. (#700)
The names getweights
, getpoints
, getcellsets
, getnodesets
, getfacesets
, getedgesets
, and getvertexsets
have been removed from the list of exported names. (For now you can still use them by prefixing Ferrite.
, e.g. Ferrite.getweights
.) (#754)
The onboundary
function (and the associated boundary_matrix
property of the Grid
datastructure) have been removed (#924). Instead of first checking onboundary
and 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
Topology construction have been generalized to, in particular, fix construction for 1D and for wedge elements. (#641, #670, #684)
Documentation:
Performance:
Ferrite.transform!(grid, f)
(for transforming the node coordinates in the grid
according to a function f
) is now faster and allocates less. (#675)PointEvalHandler
(faster reverse coordinate lookup). (#719)Internal improvements:
AbstractGrid
and AbstractDofHandler
interfaces are now used more consistently internally. This will help with the implementation of distributed grids and DofHandlers. (#655)assemble!
. (#706)Ferrite.value
and Ferrite.derivative
for computing the value/gradient of all shape functions have been removed. (#720)Ferrite.create_incidence_matrix
now work with any AbstractGrid
(not just Grid
). (#726)MixedDofHandler
by the built-in orderings FieldWise
and ComponentWise
. This includes support for reordering dofs of fields on subdomains. (#645)MixedDofHandler
when creating the sparsity pattern. (#650)MixedDofHandler
. (#650)MixedDofHandler
and L2Projector
. (#465)MixedDofHandler
have gone through a performance review (see #629) and now performs the same as DofHandler
. This was part of the push to merge the two DoF handlers. Since MixedDofHandler
is strictly more flexible, and now equally performant, it will replace DofHandler
in the next breaking release. (#637, #639, #642, #643, #656, #660)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, use Ferrite.getfielddim(dh, fieldname)
instead. (#658)Ferrite.nfields(dh)
has been removed, use length(Ferrite.getfieldnames(dh))
instead. (#444, #653)getfielddims(::FieldHandler)
and getfieldinterpolations(::FieldHandler)
have been removed (#647, #659)Lagrange{2,Tetrahedron,(3|4|5)}
interpolations. (#582, #633)vertices(ip)
, edges(ip)
and faces(ip)
has been deprecated in favor of vertexdof_indices(ip)
, edgedof_indices(ip)
and facedof_indices(ip)
. (#581)MixedDofHandler
. (#577)show
method for assemblers. (#598)Symmetric
-wrapped sparse matrices (i.e. obtained from create_symmatric_sparsity_pattern
). In particular, apply!(K::Symmetric, f, ch)
would incorrectly modify f
if any of the constraints were inhomogeneous. (#592)show
for Grid
s. (#599)DofOrder.Ext{Metis}()
that can be passed to renumber!
to renumber DoFs using the Metis.jl library. (#393, #549)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 uninitialized BlockMatrix
with the correct block sizes (see BlockArrays.jl
docs). This functionality is useful for e.g. special solvers where individual blocks need to be extracted. Requires Julia version 1.9 or above. (#567)apply_analytical!
for setting the values of the degrees of freedom for a specific field according to a spatial function f(x)
. (#532)CellCache
to be used when iterating over the cells in a grid or DoF handler. CellCache
caches nodes, coordinates, and DoFs, for the cell. The cache cc
can be re-initialized for a new cell index ci
by calling reinit!(cc, ci)
. This can be used as an alternative to CellIterator
when more control over which element to loop over is needed. See documentation for CellCache
for more information. (#546)keep_constrained=false
to create_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)ConstraintHandler
: update!
is now called implicitly in close!
. This was easy to miss, and somewhat of a strange requirement when solving problems without time stepping. (#459)Dirichlet
constraint can now be specified as either f(x)
or f(x, t)
, where x
is the spatial coordinate and t
the time. (#459)CellIterator
are now CellCache
instead of the iterator itself, which was confusing in some cases. This change does not affect typical user code. (#546)push!(dh, ...)
has been deprecated in favor of add!(dh, ...)
. This is to make it consistent with how constraints are added to a constraint handler. (#578)shape_value
for the linear, discontinuous Lagrange interpolation. (#553)reference_coordinate
dispatch for discontinuous Lagrange interpolations. (#559)show(::Grid)
for custom cell types. (#570)apply_zero!(Δa, ch)
when using inhomogeneous affine constraints (#575)BlockMatrix
support added in this release) and solvers in the future. (#562, #571)apply_local!
and apply_assemble!
for applying constraints locally on the element level before assembling to the global system. (#528)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)create_sparsity_pattern
by passing a Matrix{Bool}
. For example, in a problem with unknowns (u, p)
and corresponding test functions (v, q)
, if there is no coupling between p
and q
it is unnecessary to allocate entries in the global matrix corresponding to these DoFs. This can now be communicated to create_sparsity_pattern
by passing the coupling matrix [true true; true false]
in the keyword argument coupling
. (#544)apply!
and apply_zero!
have been improved. As a result, the strategy
keyword argument is obsolete and thus ignored. (#489)Dirichlet
boundary conditions and AffineConstraint
s in the ConstraintHandler
have been unified. As a result, conflicting constraints on DoFs are handled more consistently: the constraint added last to the ConstraintHandler
now always override any previous constraints. Conflicting constraints could previously cause problems when a DoF where prescribed by both Dirichlet
and AffineConstraint
. (#529)[a b; c d]
even if no entries exist in the global matrix for the d
block, i.e. in [A B; C D]
the D
block is zero, and these global entries might not exist in the sparse matrix. (Such sparsity patterns can now be created by create_sparsity_pattern
, see #544.) (#543)create_sparsity_pattern
methods to remove code duplication between DofHandler
and MixedDofHandler
. (#538, #540)Lagrange{2,RefTetrahedron,3}
, Lagrange{2,RefTetrahedron,4}
, and Lagrange{2,RefTetrahedron,5}
). (#482, #512)Dirichlet
and PeriodicDirichlet
have changed from component 1 to all components of the field. For scalar problems this has no effect. (#506, #509)search_nneighbors::Int
in PointEvalHandler
for specifying how many neighboring elements to consider in the kNN search. The default is still 3 (usually sufficient). (#466)PointEvalHandler
when the first point is missing. (#466)(Quadratic)Tetrahedron
cells. (#475)reinit!
when number of geometric base functions and number of element coordinates mismatch. (#469)AffineConstraints
and/or PeriodicDirichlet
. (#436)L2Projection
of mixed grid. (#456)CellValues
structs (cv.func_interp
, cv.geo_interp
, and cv.qr
). (#428)DiscontinuousLagrange
, BubbleEnrichedLagrange
, and CrouzeixRaviart
. (#352, #392)Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 29 October 2024. Using Julia version 1.11.1.