Skip to content

Commit 34a042e

Browse files
committed
fix the FE space definition
1 parent b4dcc98 commit 34a042e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/poisson_dev_fe.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,17 +574,17 @@ low_level_manual_gradient_dv_array = lazy_map(Broadcasting(Operation(⋅)),inv_J
574574
# 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.
575575

576576
# 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_0 \; on \; \Gamma_D\}$ such that
577+
# >Find $u_h \in V_h^{\Gamma_D}=\{v_h \in V_h:v_h=g^h_0 \; on \; \Gamma_D\}$ such that
578578
# >```math
579579
# >a(u_h,v_h)=l(v_h)\quad \forall v_h \in V_h^0
580580
# >```
581581
# >where $V_h^0=\{v_h \in V_h:v_h=0 \; on \; \Gamma_D\}$.
582582
#
583583
# 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:
584584
# ```math
585-
# a(w_h,v_h)=a(\hat{u}_h,v_h)-l(v_h)\quad \forall v_h,w_h \in V_h^0.
585+
# a(w_h,v_h)=a(\hat{u}_h,v_h)-l(v_h)\quad \forall v_h,w_h \in V_h^0,
586586
# ```
587-
# 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$.
587+
# 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$.
588588

589589
# 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
590590

@@ -674,7 +674,7 @@ A = allocate_matrix(assem,rs)
674674
#
675675
A = assemble_matrix!(A,assem,rs)
676676

677-
# 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
678678

679679
x = A \ b
680680
uf = get_free_dof_values(uₕ) - x

0 commit comments

Comments
 (0)