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_aeold
— Functionget_aeold(itembuffer::AbstractItemBuffer)
Get the degrees of freedom pertinent to the values object (e.g. cellvalues) in the itembuffer.
Note: Filled by NaN
s unless aold
is passed to work!
FerriteAssembly.get_old_state
— Functionget_old_state(itembuffer::AbstractCellBuffer)
Get the old state variables for the cell. Currently only available for cells and not for facets.
FerriteAssembly.get_time_increment
— Functionget_time_increment(itembuffer::AbstractItemBuffer)
Get the time increment to get to the current step. Set by set_time_increment!
.
Ferrite.dof_range
— MethodFerrite.dof_range(::AbstractItemBuffer, ::Symbol)
Get the dof_range
for a specific field, same as Ferrite.dof_range(::SubDofHandler, ::Symbol)
, but fully type-stable.
Ferrite.getcoordinates
— MethodFerrite.getcoordinates(::AbstractItemBuffer)
Get the cell coordinates for the current item.
Ferrite.celldofs
— MethodFerrite.celldofs(::AbstractItemBuffer)
Get the degree of freedom indices for the current cell referred to by the current item.
Ferrite.cellid
— MethodFerrite.cellid(::AbstractItemBuffer)
Get the cell nr for the current item.
FerriteAssembly.get_user_data
— Functionget_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.
FerriteAssembly.get_user_cache
— Functionget_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.
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_cache
— MethodFerriteAssembly.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.
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_cache
— FunctionFerriteAssembly.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.