-
- Downloads
Refactoring forms. WIP.
This commit moves the boilerplate code that has been part of every form to a dedicated place: the IntegrandSymbols class and the process_integrand() function (integrand.py). This change simplifies the construction of new operators/forms. The refactoring is not complete (essentially, the files forms.py, forms_boundary.py, manifold_forms.py, etc. will become unnecessary). But for regression testing, the skeletons are kept for another while. Concrete changes and additions: * implemented the function process_integrand() that processes a symbolic integrand - see docstrings in integrand.py for details * moved symbolic integrand expressions to hog/recipes/integrands - less code and better separation of concerns * the TensorialVectorFunctionSpace can now be restricted to a single component - now the same integrands can be used for full vector forms and component-wise terms * fixing test and trial mix-up in generate_all_operators.py (see #14)
Showing
- generate_all_operators.py 26 additions, 16 deletionsgenerate_all_operators.py
- hog/forms.py 219 additions, 918 deletionshog/forms.py
- hog/forms_boundary.py 17 additions, 63 deletionshog/forms_boundary.py
- hog/forms_new.py 0 additions, 139 deletionshog/forms_new.py
- hog/function_space.py 39 additions, 7 deletionshog/function_space.py
- hog/integrand.py 342 additions, 0 deletionshog/integrand.py
- hog/operator_generation/function_space_impls.py 8 additions, 2 deletionshog/operator_generation/function_space_impls.py
- hog/quadrature/tabulation.py 4 additions, 2 deletionshog/quadrature/tabulation.py
- hog/recipes/__init__.py 15 additions, 0 deletionshog/recipes/__init__.py
- hog/recipes/common.py 19 additions, 0 deletionshog/recipes/common.py
- hog/recipes/integrands/__init__.py 15 additions, 0 deletionshog/recipes/integrands/__init__.py
- hog/recipes/integrands/boundary/__init__.py 15 additions, 0 deletionshog/recipes/integrands/boundary/__init__.py
- hog/recipes/integrands/boundary/mass.py 22 additions, 0 deletionshog/recipes/integrands/boundary/mass.py
- hog/recipes/integrands/volume/__init__.py 15 additions, 0 deletionshog/recipes/integrands/volume/__init__.py
- hog/recipes/integrands/volume/diffusion.py 38 additions, 0 deletionshog/recipes/integrands/volume/diffusion.py
- hog/recipes/integrands/volume/diffusion_affine.py 35 additions, 0 deletionshog/recipes/integrands/volume/diffusion_affine.py
- hog/recipes/integrands/volume/div_k_grad.py 39 additions, 0 deletionshog/recipes/integrands/volume/div_k_grad.py
- hog/recipes/integrands/volume/div_k_grad_affine.py 36 additions, 0 deletionshog/recipes/integrands/volume/div_k_grad_affine.py
- hog/recipes/integrands/volume/divdiv.py 33 additions, 0 deletionshog/recipes/integrands/volume/divdiv.py
- hog/recipes/integrands/volume/divergence.py 35 additions, 0 deletionshog/recipes/integrands/volume/divergence.py
Loading