Generation of divergence and gradient forms fails
Hi,
I tried to regenerate the forms for divergence/gradient for the P1-P0 combination, but this does not (or no longer?) work. Running e.g.
python3 generate_all_hyteg_forms.py -f p0_to_p1 -o FOO
gives me
[MainProcess] — [2025-02-26 18:19:30,391] — [ generate_all_hyteg_forms.py] — [line 1029] - [ INFO] ################################
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1030] - [ INFO] ### HyTeG Operator Generator ###
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1031] - [ INFO] ################################
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1064] - [ INFO] - selected geometries: triangle, tetrahedron
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1067] - [ INFO] Generating 2 forms:
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1071] - [ INFO] - p0_to_p1_divt_affine_q0
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1071] - [ INFO] - p0_to_p1_divt_blending_q0
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1073] - [ INFO] Patience you must have young padawan
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1075] - [ INFO] p0_to_p1_divt_affine_q0, trial: (Lagrange, degree 0), test: (Lagrange, degree 1), dimension: 3 x 1, qua\
drature schemes/degree (dimension): {2: 0, 3: 0}, blending: IdentityMap
[MainProcess] — [2025-02-26 18:19:30,392] — [ generate_all_hyteg_forms.py] — [line 1099] - [ INFO] - Generating code for class p0_to_p1_divt_0_affine_q0, 2D ...
[MainProcess] — [2025-02-26 18:19:30,484] — [ generate_all_hyteg_forms.py] — [line 1099] - [ INFO] - Generating code for class p0_to_p1_divt_0_affine_q0, 2D ... done (took 0.09 s)
Traceback (most recent call last):
File "[...]/hog/generate_all_hyteg_forms.py", line 1181, in <module>
main()
File "[...]/hog/generate_all_hyteg_forms.py", line 1111, in main
mat = form_func(
^^^^^^^^^^
File "[...]/hog/generate_all_hyteg_forms.py", line 822, in form_func
return gradient(
^^^^^^^^^
File "[...]/hog/hog/forms.py", line 615, in gradient
return process_integrand(
^^^^^^^^^^^^^^^^^^
File "[...]/hog/hog/integrand.py", line 494, in process_integrand
mat[data.row, data.col] = integrand(**asdict(s))
^^^^^^^^^^^^^^^^^^^^^^
File "[...]/hog/hog/recipes/integrands/volume/gradient.py", line 32, in integrand
-(jac_b_inv.T * tabulate(jac_a_inv.T * grad_v)).trace()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[...]/python-for-hog/lib/python3.11/site-packages/sympy/matrices/common.py", line 2443, in trace
raise NonSquareMatrixError()
The problem actually seems to affect all gradient and divergence forms.