Skip to content

Commit

Permalink
doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cgcgcg committed Oct 25, 2023
1 parent 3458cec commit 50b9726
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions docs/example1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Meshes
The first object we need to create is a mesh to support the finite element discretization.
We start by construction a mesh for a square domain :math:`\Omega=[0, 1] \times [0, 1]` and refining it uniformly three times:

.. literalinclude:: ../drivers/example1.py
.. literalinclude:: ../examples/example1.py
:start-after: Get a mesh
:end-before: #################
:lineno-match:
Expand All @@ -41,7 +41,7 @@ In the next step, we create a finite element space on the mesh.
By default, we assume a Dirichlet condition on the entire boundary of the domain.
We build a piecewise linear finite element space.

.. literalinclude:: ../drivers/example1.py
.. literalinclude:: ../examples/example1.py
:start-after: Construct a finite element space
:end-before: #################
:lineno-match:
Expand Down Expand Up @@ -76,7 +76,7 @@ We assemble the right-hand side
of the linear system by calling the ``assembleRHS`` method of the DoFMap object, and interpolate the exact solutions into the finite element space.


.. literalinclude:: ../drivers/example1.py
.. literalinclude:: ../examples/example1.py
:start-after: Construct some simple functions
:end-before: #################
:lineno-match:
Expand All @@ -100,7 +100,7 @@ and the stiffness matrix associated with the Laplacian
\int_\Omega \nabla u \cdot \nabla v
.. literalinclude:: ../drivers/example1.py
.. literalinclude:: ../examples/example1.py
:start-after: Assemble mass
:end-before: #######
:lineno-match:
Expand All @@ -113,7 +113,7 @@ Solvers
Now that we have assembled our linear system, we want to solve it.
We choose to solve one system using an LU solver, and the other one using a CG solver.

.. literalinclude:: ../drivers/example1.py
.. literalinclude:: ../examples/example1.py
:start-after: Construct solvers
:end-before: #################
:lineno-match:
Expand All @@ -128,7 +128,7 @@ Norms and inner products
Finally, we want to check that we actually solved the system by computing residual errors.
We also compute errors in :math:`H^1_0` and :math:`L^2` norms.

.. literalinclude:: ../drivers/example1.py
.. literalinclude:: ../examples/example1.py
:start-after: Inner products
:end-before: plt.show
:lineno-match:
Expand Down
10 changes: 5 additions & 5 deletions docs/example2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ A fractional kernel

We start off by creating a fractional kernel with infinite horizon and constant fractional order :math:`s=0.75`.

.. literalinclude:: ../drivers/example2.py
.. literalinclude:: ../examples/example2.py
:start-after: Get a fractional kernel
:end-before: #################
:lineno-match:
Expand Down Expand Up @@ -66,7 +66,7 @@ Instead of the `meshFactory` used in the previous example, we now use the `nonlo
The advantage is that this factory can generate meshes with appropriate interaction domains.
For this particular example, the factory will not generate any interaction domain, since the homogeneous Dirichlet condition on :math:`\mathbb{R}^2\setminus\Omega` can be enforced via a boundary integral.

.. literalinclude:: ../drivers/example2.py
.. literalinclude:: ../examples/example2.py
:start-after: Generate an appropriate mesh
:end-before: #################
:lineno-match:
Expand All @@ -80,7 +80,7 @@ We assemble the nonlocal operator by passing the kernel to the `assembleNonlocal
The optional parameter `matrixFormat` determines what kind of linear operator is assembled.
We time the assembly of the operator as a dense matrix, and as a hierarchical matrix, and inspect the resulting objects.

.. literalinclude:: ../drivers/example2.py
.. literalinclude:: ../examples/example2.py
:start-after: Assemble the operator
:end-before: #################
:lineno-match:
Expand All @@ -93,7 +93,7 @@ For larger number of unknowns, we expect the hierarchical assembly scale like :m

Similar to the local PDE example, we can then solve the resulting linear equation and compute the error in energy norm.

.. literalinclude:: ../drivers/example2.py
.. literalinclude:: ../examples/example2.py
:start-after: Solve the linear system
:end-before: #################
:lineno-match:
Expand All @@ -116,7 +116,7 @@ We will choose :math:`\gamma(x,y) \sim \chi_{V_{\delta}^{(2)}(x)}(y)` for :math:
where :math:`\mathcal{I}:=\{y\in\mathbb{R}^2\setminus\Omega | \exists x\in\Omega: \gamma(x,y)\neq 0\}` is the interaction domain.

.. literalinclude:: ../drivers/example2.py
.. literalinclude:: ../examples/example2.py
:start-after: Solve a problem with finite horizon
:end-before: #################
:lineno-match:
Expand Down

0 comments on commit 50b9726

Please sign in to comment.