assemble_design_gradient Subroutine
public pure subroutine assemble_design_gradient(patches, connections, nconnection, offsets, valid, local_dXc, local_dlogWc, dXc, dlogWc, err, map)
Assemble a scalar objective gradient in independent control positions and log weights. Local partials use patch storage order. A nested trace couples fine positions to coarse weights, so supply its coordinate partial even when requesting only the weight gradient. Positive map entries identify direct copies. Blended fine controls and inactive controls without an active representative have ID zero.
Arguments
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(*), | intent(in), | optional | :: | patches(:) | ||
| type(multipatch_connection), | intent(in), | optional | :: | connections(:) | ||
| integer, | intent(in) | :: | nconnection | |||
| integer, | intent(in) | :: | offsets(:) | |||
| logical, | intent(in) | :: | valid | |||
| real(kind=rk), | intent(in), | optional | :: | local_dXc(:,:) | ||
| real(kind=rk), | intent(in), | optional | :: | local_dlogWc(:) | ||
| real(kind=rk), | intent(out), | optional, | allocatable | :: | dXc(:,:) | |
| real(kind=rk), | intent(out), | optional, | allocatable | :: | dlogWc(:) | |
| type(debug), | intent(out), | optional | :: | err | ||
| integer, | intent(out), | optional, | allocatable | :: | map(:) |