Skip to content

Add support for preprocess() method in local bulk operator and functional assemblers

Carsten Gräser requested to merge feature/localassembler-preprocess into master

This adds optional support for a preprocess(localViews...) method on local operators. If such a method exists, it is called once, before assembling on any element. The method passes exactly those local view(s) that are later passed when calling the assembler on elements. Notice that the local views will in general not be bound at this point. This extension is backward compatible, because assemblers no providing this methods work as before.

This allows to register the local view or its associated tree nodes in persistent data of the local assembler. This is e.g. helpful when using a hierarchic shape functions cache, that needs to know the ansatz tree. Without such a method, the nodes of the tree would have to be extracted on each local assembler call.

To guarantee that this is exactly the local view used during assembly, preprocess() has to be called separately for each copy of the local assembler in different threads after creating those copies. Otherwise the registered local view would be the same in each copy of the assembler although each thread uses its own local view.

See #26 (closed) for a motivation of this change.

Merge request reports

Loading