Skip to content

Commit 9692b46

Browse files
committed
Merge branch 'moment-based-reffes' of github.com:Antoinemarteau/Tutorials into v0.20
2 parents 2e81a79 + d9197b1 commit 9692b46

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ BlockArrays = "1.6.3"
4040
DataStructures = "0.18.22"
4141
Gridap = "0.20"
4242
GridapDistributed = "0.4"
43+
GridapEmbedded = "0.9.9"
4344
GridapGmsh = "0.7"
4445
GridapP4est = "0.3"
4546
GridapPETSc = "0.5"

src/darcy.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ model = CartesianDiscreteModel(domain,partition)
6363
# Next, we build the FE spaces. We consider the first order RT space for the flux and the discontinuous pressure space as described above. This mixed FE pair satisfies the inf-sup condition and, thus, it is stable.
6464

6565
order = 1
66+
h = 1/100
6667

6768
V = FESpace(model, ReferenceFE(raviart_thomas,Float64,order),
68-
conformity=:HDiv, dirichlet_tags=[5,6])
69+
conformity=:HDiv, dirichlet_tags=[5,6], scale_dof=true, global_meshsize=h)
6970

7071
Q = FESpace(model, ReferenceFE(lagrangian,Float64,order),
71-
conformity=:L2)
72+
conformity=:L2, scale_dof=true, global_meshsize=h)
7273

73-
# Note that the Dirichlet boundary for the flux are the bottom and top sides of the squared domain (identified with the boundary tags 5, and 6 respectively), whereas no Dirichlet data can be imposed on the pressure space. We select `conformity=:HDiv` for the flux (i.e., shape functions with $H^1(\mathrm{div};\Omega)$ regularity) and `conformity=:L2` for the pressure (i.e. discontinuous shape functions).
74+
# We select `conformity=:HDiv` for the flux (i.e., shape functions with $H^1(\mathrm{div};\Omega)$ regularity) and `conformity=:L2` for the pressure (i.e. discontinuous shape functions).
75+
# Note that the Dirichlet boundary for the flux are the bottom and top sides of the squared domain (identified with the boundary tags 5, and 6 respectively), whereas no Dirichlet data can be imposed on the pressure space.
76+
#
77+
# The `scale_dof=true` argument is given to cancel the scaling of the DoFs with the meshsize `h` that is introduced by the piola map, e.g. `h`$^{2-1}$ (2 is the dimension) for the div-conforming contra-variant Piola map. This is usefull for mixed elements of different conformity that use small or non-uniform meshsize. On a uniform Cartesian mesh like `model` used here, we also passed `global_meshsize=1/100`. This argument fixes the local meshsize estimate needed to re-scale the DoFs, avoiding the computation of the volume of each face of the mesh that own a DoF. But this should only be used on quasi-uniform and shape-regular meshes.
7478
#
7579
# From these objects, we construct the trial spaces. Note that we impose homogeneous boundary conditions for the flux.
7680

src/inc_navier_stokes.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ P = TrialFESpace(Q)
105105
Y = MultiFieldFESpace([V, Q])
106106
X = MultiFieldFESpace([U, P])
107107

108+
# `scale_dof` is not used here, because currently $H^1$ and $L^2$ conforming elements both use the same Piola map in Gridap (the trivial one).
109+
108110
# ## Triangulation and integration quadrature
109111
#
110112
# From the discrete model we can define the triangulation and integration measure

0 commit comments

Comments
 (0)