Skip to content
Snippets Groups Projects

Resolve issue 48

Merged Marcus Mohr requested to merge 48-generation-of-divergence-and-gradient-forms-fails into main
Compare and
5 files
+ 68
34
Preferences
Compare changes
Files
5
@@ -26,10 +26,21 @@ def integrand(
grad_u,
v,
tabulate,
component_index,
**_,
):
return (
-(jac_b_inv.T * tabulate(jac_a_inv.T * grad_u)).trace()
* tabulate(v * jac_a_abs_det)
* jac_b_abs_det
)
# working with vector-valued functions
if grad_u.is_square:
return (
-(jac_b_inv.T * tabulate(jac_a_inv.T * grad_u)).trace()
* tabulate(v * jac_a_abs_det)
* jac_b_abs_det
)
# working with scalar-valued functions (backward compatibility)
else:
return (
-(jac_b_inv.T * tabulate(jac_a_inv.T * grad_u))[component_index]
* tabulate(v * jac_a_abs_det)
* jac_b_abs_det
)