-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emmarothwell1/restricted _function_space: Implement a RestrictedFunct…
…ionSpace class. (#3215) * If `restrict=True`, solver replaces test and trial functions with those on the RestrictedFunctionSpace. * If `restrict=True`, eigenproblem solver takes the constrained DoFs out of the system (default). Co-authored-by: David A. Ham <[email protected]> Co-authored-by: ksagiyam <[email protected]>
- Loading branch information
1 parent
486fa41
commit 02bdb5f
Showing
19 changed files
with
745 additions
and
147 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -4,7 +4,8 @@ Oceanic Basin Modes: Quasi-Geostrophic approach | |
.. rst-class:: emphasis | ||
|
||
This tutorial was contributed by Christine Kaufhold and `Francis | ||
Poulin <mailto:[email protected]>`__. | ||
Poulin <mailto:[email protected]>`__. The tutorial was later updated by | ||
Emma Rothwell to add in the restrict flag in the LinearEigenproblem. | ||
|
||
As a continuation of the Quasi-Geostrophic (QG) model described in the other | ||
tutorial, we will now see how we can use Firedrake to compute the spatial | ||
|
@@ -138,12 +139,14 @@ We define the Test Function :math:`\phi` and the Trial Function | |
|
||
To build the weak formulation of our equation we need to build two PETSc | ||
matrices in the form of a generalized eigenvalue problem, | ||
:math:`A\psi = \lambda M\psi` :: | ||
:math:`A\psi = \lambda M\psi`. This eigenproblem takes `restrict=True` to help | ||
users to avoid convergence failures by removing eigenvalues on the | ||
boundary, while preserving the original function space for the eigenmodes. :: | ||
|
||
eigenproblem = LinearEigenproblem( | ||
A=beta*phi*psi.dx(0)*dx, | ||
M=-inner(grad(psi), grad(phi))*dx - F*psi*phi*dx, | ||
bcs=bc) | ||
bcs=bc, restrict=True) | ||
|
||
Next we program our eigenvalue solver through the PETSc options system. The | ||
first is specifying that we have an generalized eigenvalue problem that is | ||
|
This file contains 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 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 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 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 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.