From 50b9726ca73b139fea020fdb76809d3584f15286 Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Wed, 25 Oct 2023 06:49:42 -0600 Subject: [PATCH] doc fix --- docs/example1.rst | 12 ++++++------ docs/example2.rst | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/example1.rst b/docs/example1.rst index b58a027..923fd05 100644 --- a/docs/example1.rst +++ b/docs/example1.rst @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/docs/example2.rst b/docs/example2.rst index 034f705..bbc2344 100644 --- a/docs/example2.rst +++ b/docs/example2.rst @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: