Open bmxam opened 9 months ago
The following expression works with v0.1.3 (and with size=1
for U
):
v -> ∫(2 * ∇(v) ⋅ SA[1, 0])dΩ
Currently, it is not recommended (and not well supported!) to combine operations on a test function v
before taking its gradient because there is a specific processing with MapOver on ∇(v)
. For CellFunction
, the gradient of combined operations is supported and there should be no problem.
For example:
u = FEFunction(U)
a = assemble_linear(v -> ∫(∇(v) ⋅ ∇(2 * u))dΩ, V)
b = assemble_linear(v -> ∫(∇(v) ⋅ ∇(u))dΩ, V)
@assert all(a .≈ 2 .* b) # true
Is this ok for you?
The following expression works with v0.1.3 (and with
size=1
forU
):v -> ∫(2 * ∇(v) ⋅ SA[1, 0])dΩ
Currently, it is not recommended (and not well supported!) to combine operations on a test function
v
before taking its gradient because there is a specific processing with MapOver on∇(v)
. ForCellFunction
, the gradient of combined operations is supported and there should be no problem. For example:u = FEFunction(U) a = assemble_linear(v -> ∫(∇(v) ⋅ ∇(2 * u))dΩ, V) b = assemble_linear(v -> ∫(∇(v) ⋅ ∇(u))dΩ, V) @assert all(a .≈ 2 .* b) # true
Is this ok for you?
Yes it's ok for now. Maybe we could keep this issue opened with the "enhancement" label?
The following example fails, I don't know if it's hard to fix...