-
Notifications
You must be signed in to change notification settings - Fork 17
make getform work (without DirichletBCs) for DOLFINx #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jorgensd
wants to merge
7
commits into
firedrakeproject:master
Choose a base branch
from
jorgensd:dokken/getForm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9031a1d
make getform work (without bcs).
jorgensd f5cbeea
Some minor logic fixes in BoundsConstraindDirichletBC
jorgensd e292ed6
Merge remote-tracking branch 'upstream' into dokken/getForm
jorgensd 547c0d2
Start reverting to Pablo's suggestions.
jorgensd ad84b2b
Fix bcs for firedrake (revert to proper functionality as well as star…
jorgensd 60ed4ee
Add try accept for fml
jorgensd 301d79f
Further work on the irksome DOLFINx interface
jorgensd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,9 +1,32 @@ | ||||||
| """Firedrake backend for Irksome""" | ||||||
|
|
||||||
|
|
||||||
| from operator import mul | ||||||
| from functools import reduce | ||||||
|
|
||||||
|
Comment on lines
+3
to
+5
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| import firedrake | ||||||
| import ufl | ||||||
| from ..tools import get_stage_space | ||||||
| import typing | ||||||
|
|
||||||
| TestFunction = firedrake.TestFunction | ||||||
|
|
||||||
|
|
||||||
| def get_stage_space(V: ufl.FunctionSpace, num_stages:int)->ufl.FunctionSpace: | ||||||
| return reduce(mul, (V for _ in range(num_stages))) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| def extract_bcs(bcs: typing.Any)->tuple[typing.Any]: | ||||||
| """Return an iterable of boundary conditions on the residual form""" | ||||||
| return tuple(bc.extract_form("F") for bc in firedrake.solving._extract_bcs(bcs)) | ||||||
|
|
||||||
|
|
||||||
| def create_nonlinearvariational_solver(F: ufl.Form, u: ufl.Coefficient, bcs: typing.Sequence | None = None, solver_parameters: dict | None = None, **kwargs): | ||||||
| """Create a non-linear variational solver that uses PETSc SNES.""" | ||||||
| problem = firedrake.NonlinearVariationalProblem(F, u, bcs=bcs) | ||||||
| return firedrake.NonlinearVariationalSolver( | ||||||
| problem, solver_parameters=solver_parameters, **kwargs | ||||||
| ) | ||||||
|
|
||||||
| def get_function_space(u: ufl.Coefficient) -> firedrake.FunctionSpace: | ||||||
| return u.function_space() | ||||||
|
|
@@ -36,3 +59,10 @@ def Constant(self, val=0.0) -> ufl.Coefficient: | |||||
|
|
||||||
| def get_mesh_constant(MC: MeshConstant | None): | ||||||
| return MC.Constant if MC else firedrake.Constant | ||||||
|
|
||||||
| class Function(firedrake.Function): | ||||||
| pass | ||||||
|
|
||||||
|
|
||||||
| class DirichletBC(firedrake.DirichletBC): | ||||||
| pass | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be made public