cmlibs / zinc

Source code repository for OpenCMISS-Zinc
Mozilla Public License 2.0
15 stars 18 forks source link

Surface integral xi and parameter derivatives #242

Closed rchristie closed 1 year ago

rchristie commented 1 year ago

Optimisation/fitting relies on calculating derivatives w.r.t. parameters, but these are only possible (at acceptable levels of performance) on top-level elements. Need to support objective functions which integrate over face or line groups e.g. to apply flattening or edge discontinuity penalties during fitting. The core limitation is that finite element fields can currently only evaluate derivatives w.r.t. parameters on top-level elements, and xi derivatives w.r.t. to the same element/face/line given in the field location.

Proposal:

  1. Assume the parameters of a face or line are the parameters of the first top-level element they inherit the field from.
  2. Generalise finite element field derivative evaluation by evaluating on the first top-level field element to pick up parameter derivatives and also to allow xi derivatives w.r.t. top-level xi. Also transform xi derivatives onto face or line as needed. Performance note: use top-level finite element field evaluation directly, rather than mapping to face or line in such cases.
  3. Remove Newton optimisation method limitation that all objective fields vary over top-level-mesh; query type to determine whether integral is over element, face or line mesh.