The function adjoint_solve!(φ_to_u::RepeatingAffineFEStateMap,du::AbstractVector) expects an array of arrays for du (or something similar for the map) but is being passed as vector/pvector by j_pullback. This appears to be happening because in ChainRules.jl line 178 we take assemble_vector!(∂j∂u_vec,assem_U,∂j∂u_vecdata). This is assembling over the multi-field space U but using assem_U for U0 and V0.
One way to fix this is create a new constructor for StateParamIntegrandWithMeasure:
function StateParamIntegrandWithMeasure(F::IntegrandWithMeasure,φ_to_u::RepeatingAffineFEStateMap)
U,V,V_φ,U_reg = φ_to_u.spaces
assem_deriv = get_deriv_assembler(φ_to_u)
assem_U = SparseMatrixAssembler(U,V,...)
StateParamIntegrandWithMeasure(F,U,V_φ,U_reg,assem_U,assem_deriv)
end
However, this would then hard code the assembler assem_U and we would also need to get parameters in place of ....
@JordiManyer I've created this to remind us that this is currently bugged.
The function
adjoint_solve!(φ_to_u::RepeatingAffineFEStateMap,du::AbstractVector)
expects an array of arrays fordu
(or something similar for themap
) but is being passed as vector/pvector byj_pullback
. This appears to be happening because in ChainRules.jl line 178 we takeassemble_vector!(∂j∂u_vec,assem_U,∂j∂u_vecdata)
. This is assembling over the multi-field spaceU
but usingassem_U
forU0
andV0
.One way to fix this is create a new constructor for
StateParamIntegrandWithMeasure
:However, this would then hard code the assembler
assem_U
and we would also need to get parameters in place of...
.@JordiManyer I've created this to remind us that this is currently bugged.