You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,28 @@ Visit one of the following pages, depending of your needs, and start enjoying!
33
33
-[**STABLE**](https://gridap.github.io/Tutorials/stable)—**Tutorials for the most recently tagged version of Gridap.jl.**
34
34
-[**DEVEL**](https://gridap.github.io/Tutorials/dev)—*Tutorials for the in-development version of Gridap.jl.*
35
35
36
+
## Generating tutorials locally
37
+
38
+
Note: **only if you intend to contribute to the tutorials as an advanced user/developer**
39
+
40
+
If you want to contribute to the tutorials, e.g., to make changes in their sources, you might need to generate (render) them locally to see whether the changes in the sources produce the expected outcome in the output (i.e., Jupyter notebooks + HTML pages). To this end, you have to follow the following instructions once:
41
+
42
+
```
43
+
julia --project=docs # From the Unix shell, located at the root of Tutorials repo
44
+
develop . # From the Julia package manager prompt
45
+
instantiate # ""
46
+
build # ""
47
+
exit() # From the Julia REPL
48
+
```
49
+
50
+
and then, each time that you perform a change on the tutorial sources, you have to execute the following command:
51
+
52
+
```
53
+
julia --project=docs docs/make.jl # From the Unix shell, located at the root of Tutorials repo
54
+
```
55
+
56
+
to generate the tutorials. The files generated are available at `Tutorials/docs/build/`.
57
+
36
58
37
59
## Gridap community
38
60
@@ -62,3 +84,4 @@ In order to give credit to the `Gridap` contributors, we simply ask you to cite
62
84
63
85
Please, contact the project administrators, [Santiago Badia](mailto:santiago.badia@monash.edu) and [Francesc Verdugo](mailto:fverdugo@cimne.upc.edu), for further questions about licenses and terms of use.
# ## A low-level implementation of the residual integration and assembly
573
573
574
+
# In the rest of the tutorial we aim to solve a Poisson equation with homogeneous source term, i.e., $f=0$ and non-homogeneous Dirichlet boundary conditions $u=g_0$ on $\Gamma_D$, with $\Gamma_D$ being the whole boundary of the model. While the strong imposition of non-homogeneous Dirichlet boundary conditions in Gridap is done under the hood by modifying the global assembly process by subtracting the contributions of boundary conditions to the right hand side of the linear system, in this tutorial, for simplicity, we follow a different approach. This approach requires: (1) to be able to assemble the residual of the PDE for an arbitrary finite element function $\hat{u}_h$ (current section); (2) to be able to assemble the coefficient matrix of the finite element linear system (next section). We briefly outline this solution approach in the sequel.
575
+
576
+
# The discretized variational form of the Poisson problem reads as:
577
+
# >Find $u_h \in V_h^{\Gamma_D}=\{v_h \in V_h:v_h=g^h_0 \; on \; \Gamma_D\}$ such that
578
+
# >```math
579
+
# >a(u_h,v_h)=l(v_h)\quad \forall v_h \in V_h^0
580
+
# >```
581
+
# >where $V_h^0=\{v_h \in V_h:v_h=0 \; on \; \Gamma_D\}$ and $g^h_0$ is the interpolation of $g_0$ on the Dirichlet boundary.
582
+
#
583
+
# If we take an arbitrary function $\hat{u}_h \in V_h^{\Gamma_D}$, and compute $w_h \in V_h^0$ as the solution of the following discrete variational problem:
# then, it is easy to see that $\mathbf{ u_h=\hat{u}_h-w_h }$. This is the strategy that we implement in the sequel. Note that, in previous section, we created a FE function using `rand` for initializing the values of the degrees of freedom. This function indeed plays the role of $\hat{u}_h$.
588
+
574
589
# Let us now create manually an array of `Field`s uₖ that returns the FE function uₕ at each cell, and another array with its gradients, ∇uₖ. We hope that the next set of instructions can be already understood with the material covered so far
575
590
576
591
ϕrₖ =Fill(ϕr,num_cells(Tₕ))
@@ -659,7 +674,7 @@ A = allocate_matrix(assem,rs)
659
674
#
660
675
A =assemble_matrix!(A,assem,rs)
661
676
662
-
# Now we can obtain the free DOFs and add the solution to the initial guess
677
+
# Now we can obtain the free DOFs by subtracting the solution from the initial guess
0 commit comments