Support CellVolume for Expressions on non-simplex geometries
- Dominant language
- Python
- Stars
- 192
- Forks
- 45
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 16
Description
MWE.
```python
import ufl
import numpy as np
cmap = ufl.VectorElement("Lagrange", ufl.quadrilateral, 1)
mesh = ufl.Mesh(cmap)
el = ufl.FiniteElement("Lagrange", mesh.ufl_cell(), 1)
elmVol_ufl = ufl.CellVolume(mesh)
expressions = [(elmVol_ufl, np.array([[0.5, 0.5]]))]
```
returns
```bash
WARNING:py.warnings:/root/shared/ufl/ufl/algorithms/apply_geometry_lowering.py:193: UserWarning: Only know how to compute the cell volume of an affine cell.
warnings.warn("Only know how to compute the cell volume of an affine cell.")
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/root/shared/ffcx/ffcx/__main__.py", line 12, in
sys.exit(main())
File "/root/shared/ffcx/ffcx/main.py", line 67, in main
code_h, code_c = compiler.compile_ufl_objects(
File "/root/shared/ffcx/ffcx/compiler.py", line 107, in compile_ufl_objects
code = generate_code(ir, options)
File "/root/shared/ffcx/ffcx/codegeneration/codegeneration.py", line 52, in generate_code
code_expressions = [expression_generator(expression_ir, options) for expression_ir in ir.expressions]
File "/root/shared/ffcx/ffcx/codegeneration/codegeneration.py", line 52, in
code_expressions = [expression_generator(expression_ir, options) for expression_ir in ir.expressions]
File "/root/shared/ffcx/ffcx/codegeneration/expressions.py", line 43, in generator
parts = eg.generate()
File "/root/shared/ffcx/ffcx/codegeneration/expressions.py", line 159, in generate
parts += self.generate_piecewise_partition()
File "/root/shared/ffcx/ffcx/codegeneration/expressions.py", line 273, in generate_piecewise_partition
parts = self.generate_partition(arraysymbol, F, "piecewise")
File "/root/shared/ffcx/ffcx/codegeneration/expressions.py", line 460, in generate_partition
vaccess = self.backend.access.get(mt.terminal, mt, tabledata, 0)
File "/root/shared/ffcx/ffcx/codegeneration/access.py", line 64, in get
raise RuntimeError(f"Not handled: {type(e)}")
RuntimeError: Not handled:
```
related to https://github.com/FEniCS/ufl/issues/140 and vaguely to: https://github.com/FEniCS/ffcx/pull/501
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.