Skip to content

WIP: Fix problems with forms depending on additional Coefficients

René Heß requested to merge bugfix/operator-splitting-lfs into master

This fixes some problems I encountered with operator splitting.

Operator splitting in DG setting

The handling of the gfs, coefficient vector, lfs and lfs_cache for forms with interior facets and additonal coefficients was not right. Now we do the following:

  • Have only one pointer to the gfs
  • Have only one pointer to the coefficient vector
  • Have two LFSs (one for self and one for neighbor)
  • Have two LFSCaches (one for self and one for neighbor)

We will always generate two LFSs/LFSCaches even if the form doesn't need it. This way it we can generate the setCoefficient method without analyzing the complete form.

Dereferencing the lfs

There were some troubles with dereferencing the lfs of additional coefficients. For additional coefficients we store the lfs as a shared_ptr. Before using it we need to dereference it. Due to caching it could happen that the lfs is used without dereferecing it first. Instead of working around this issue on the code generation side I did:

  • Add a C++ function that dereferences if it gets a shared_ptr and returns the object itself otherwise.
  • Always call this function first if we use a lfs.

One downside is that the generated code might look confusing for local operators without splitting. In this case it is not clear why the function dereference is called.

Edited by René Heß

Merge request reports