refactor driver.py and kernel_interface #234
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to refactor
driver.pyandkernel_interface.We introduce new classes
TSFCFormDataandTSFCIntegralData(that mimicufl.FormDataandufl.IntegralData), in the constructors of which we preprocessufl.FormDataandufl.IntegralDataas much as possible, extracting only essential information forKernelBuilders. This narrows down the scope ofKernelBuilders.TSFCFormDatacan also take multipleufl.FormDatas and combine them.Several tasks done in
driver.compile_integralwere factored out and turned into methods ofKernelBuilderMixinclass inkernel_interface.common:compile_ufl,compile_gem, etc. This simplifiesdriver.compile_integrala lot, and the contents of this function can now optionally be exposed in the problem solving environments' TSFC interface (such asfiredrake/tsfc_interface.py), which allows for application of intermediate operations during compilation that only problem solving environments understand (such as finite element basis transformations).Firedrake needs to be adapted to these changes:
firedrakeproject/firedrake#1864