solver.gradient(misfit, fields=[f]) returns the dual on a field the residual reads. A field that enters only through an essential datum, u|Γ = f (a prescribed velocity field on a wall, an observed temperature used as a boundary value), is not seen: the field route scans the residual, not the boundary data, so the dual comes back zero and nothing says so. The scalar-parameter case was #762; this is its field counterpart.
The term is the same reaction, [(Kᵀμ)_Γ + (∂J/∂u)_Γ] restricted to the constrained rows and mapped onto the field's own nodes (a projection when the spaces differ). Until it is built, a field found in an essential datum should refuse rather than return zero.
Branch feature/discrete-adjoint, PR #744.
solver.gradient(misfit, fields=[f])returns the dual on a field the residual reads. A field that enters only through an essential datum,u|Γ = f(a prescribed velocity field on a wall, an observed temperature used as a boundary value), is not seen: the field route scans the residual, not the boundary data, so the dual comes back zero and nothing says so. The scalar-parameter case was #762; this is its field counterpart.The term is the same reaction,
[(Kᵀμ)_Γ + (∂J/∂u)_Γ]restricted to the constrained rows and mapped onto the field's own nodes (a projection when the spaces differ). Until it is built, a field found in an essential datum should refuse rather than return zero.Branch
feature/discrete-adjoint, PR #744.