cmlibs / zinc

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

Gradient of apply field at node doesn't work #222

Closed rchristie closed 2 years ago

rchristie commented 2 years ago

To calculate material coordinate derivatives in embedding need to evaluate gradient of the apply field at nodes which uses assignment in cache only to do a finite difference calculation. This currently fails on several levels:

  1. Computed_field_get_defining_FE_field_list() includes fields from the external region which may prevent a field of the same name in this region being found. Must prevent FE_fields from other regions from being found.
  2. Current logic calculates dx/dX only if X is the destination field. For the embedding case, the source field is not a function of the destination, but another coordinate field, which can be used instead.
  3. Apply / bind source field logic does not force recalculation for perturbed X so gradient is always zero, even with 2 above.