AbstractItemBuffer

Depending on the domain that is worked over, different item buffers are available, e.g. CellBuffer and FacetBuffer. These are set up during call to setup_domainbuffer.

For each item (cell or facet), the values in the buffer are updated to the current item, and can be accessed with the following functions:

FerriteAssembly.get_aeoldFunction
get_aeold(itembuffer::AbstractItemBuffer)

Get the degrees of freedom pertinent to the values object (e.g. cellvalues) in the itembuffer.

Note: Filled by NaNs unless aold is passed to work!

source
FerriteAssembly.get_old_stateFunction
get_old_state(itembuffer::AbstractCellBuffer)

Get the old state variables for the cell. Currently only available for cells and not for facets.

source
Ferrite.dof_rangeMethod
Ferrite.dof_range(::AbstractItemBuffer, ::Symbol)

Get the dof_range for a specific field, same as Ferrite.dof_range(::SubDofHandler, ::Symbol), but fully type-stable.

source
Ferrite.celldofsMethod
Ferrite.celldofs(::AbstractItemBuffer)

Get the degree of freedom indices for the current cell referred to by the current item.

source
Ferrite.cellidMethod
Ferrite.cellid(::AbstractItemBuffer)

Get the cell nr for the current item.

source
FerriteAssembly.get_user_dataFunction
get_user_data(itembuffer::AbstractItemBuffer)

Get the user_data passed to the DomainSpec when setting up the domain. This is not modified and always passed around as reference.

source
FerriteAssembly.get_user_cacheFunction
get_user_cache(itembuffer::AbstractItemBuffer)

Get the user_cache created by allocate_cell_cache. For multithreaded applications, this cache is copied between for each tasks, and can be modified without risking race conditions.

source

AbstractCellBuffer

Two types of cell buffers are provided, the regular CellBuffer and a wrapper AutoDiffCellBuffer that speeds up the automatic differentiation. By using the above access functions, these behave identical.

To allocate the user cache, overload allocate_cell_cache:

FerriteAssembly.allocate_cell_cacheMethod
FerriteAssembly.allocate_cell_cache(material, cellvalues)

This function can be overloaded for the specific material to allocate a cache that is stored in the AbstractCellBuffer. This cache can be used to reduce allocations. Returns nothing by default.

source

FacetBuffer

The FacetBuffer is similar to the CellBuffer, except that it has FacetValues instead of CellValues and that state variables are not supported. To allocate user cache, overload allocate_facet_cache:

FerriteAssembly.allocate_facet_cacheFunction
FerriteAssembly.allocate_facet_cache(material, cellvalues)

This function can be overloaded for the specific material to allocate a cache that is stored in the FacetBuffer and can be used to reduce allocations. Returns nothing by default.

source