Skip to content

Commit a744099

Browse files
authored
Merge pull request #126 from gridap/update_to_gridap_0_17
Update to Gridap@0.17
2 parents d13de6b + fac6bdc commit a744099

2 files changed

Lines changed: 16 additions & 22 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2020
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2121

2222
[compat]
23-
Gridap = "0.16.4"
23+
Gridap = "0.17"
2424
GridapGmsh = "0.4"
2525
SpecialFunctions = "1"
2626
julia = "1.3"

src/fsi_tutorial.jl

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,18 @@ const μ_f = 0.01
176176
# Q \doteq \{ q \in C^0(\Omega):\ q|_T\in P_{k-1}(T) \text{ for all } T\in\mathcal{T}_{\rm F}\}.
177177
# ```
178178

179-
# Before creating the FE spaces, we first need to define the discrete model of each of the sub-domains, which are constructed restricting the global discrete model to the corresponding part. This is done by calling the `DiscreteModel` function with the desired geometrical part label, i.e. `"solid"` and `"fluid"`, respectively.
180-
model_solid = DiscreteModel(model,tags="solid")
181-
model_fluid = DiscreteModel(model,tags="fluid")
179+
# Before creating the FE spaces, we first need to define the triangulation of each of the sub-domains, which are constructed restricting the global triangulation to the corresponding part. This is done by calling the `Triangulation` (or equivalently `Interior`) function with the desired geometrical part label, i.e. `"solid"` and `"fluid"`, respectively. Here we create the triangulation of the global domain, $\mathcal{T}$, and the solid and fluid triangulations, $\mathcal{T}_{\rm F}$ and $\mathcal{T}_{\rm S}$.
180+
Ω = Interior(model)
181+
Ω_s = Interior(model,tags="solid")
182+
Ω_f = Interior(model,tags="fluid")
183+
184+
# We also generate the triangulation and associated outer normal field for the outlet boundary, $\Gamma_{\rm F,N_{out}}$, which will be used to impose a Neumann condition.
185+
Γ_out = BoundaryTriangulation(model,tags="outlet")
186+
n_Γout = get_normal_vector(Γ_out)
187+
188+
# Finally, to impose the interface condition between solid and fluid, we will need the triangulation and normal field of such interface, $\Gamma_{\rm FS}$. The interface triangulation is generated by calling the `InterfaceTriangulation` function specifying the two interfacing domain triangulations. Note that the normal field will point outwards with respect to the first entry.
189+
Γ_fs = InterfaceTriangulation(Ω_f,Ω_s)
190+
n_Γfs = get_normal_vector(Γ_fs)
182191

183192
# In what follows we will assume a second-order veloticty interpolation, i.e. $k=2$
184193
k = 2
@@ -189,20 +198,20 @@ reffeₚ = ReferenceFE(lagrangian,Float64,k-1)
189198

190199
# Having set up all the ingredients, we can create the different FE spaces for the test functions. For the velocity FE spaces we call the `TestFESpace` function with the corresponding discrete model, using the velocity reference FE `reffeᵤ` and conformity `:H1`. Note that we assign different Dirichlet boundary labels for the two different parts, generating the variational spaces with homogeneous Dirichlet boundary conditions, $V_{\rm F,0}$ and $V_{\rm S,0}$ .
191200
Vf = TestFESpace(
192-
model_fluid,
201+
Ω_f,
193202
reffeᵤ,
194203
conformity=:H1,
195204
dirichlet_tags=["inlet", "noSlip", "cylinder"])
196205

197206
Vs = TestFESpace(
198-
model_solid,
207+
Ω_s,
199208
reffeᵤ,
200209
conformity=:H1,
201210
dirichlet_tags=["fixed"])
202211

203212
# For the pressure test FE space, we use the fluid discrete model, the pressure reference FE `reffeₚ` and `:C0` conformity.
204213
Qf = TestFESpace(
205-
model_fluid,
214+
Ω_f,
206215
reffeₚ,
207216
conformity=:C0)
208217

@@ -219,21 +228,6 @@ X = MultiFieldFESpace([Us,Uf,Pf])
219228
# <a name="integration"></a>
220229
# ```
221230
# ### Numerical integration
222-
# To define the quadrature rules used in the numerical integration of the different terms, we first need to generate the domain triangulation. Here we create the triangulation of the global domain, $\mathcal{T}$.
223-
Ω = Triangulation(model)
224-
225-
# The solid and fluid triangulations, $\mathcal{T}_{\rm F}$ and $\mathcal{T}_{\rm S}$, are constructed from the discrete models restricted to the respective parts.
226-
Ω_s = Triangulation(model_solid)
227-
Ω_f = Triangulation(model_fluid)
228-
229-
# We also generate the triangulation and associated outer normal field for the outlet boundary, $\Gamma_{\rm F,N_{out}}$, which will be used to impose a Neumann condition.
230-
Γ_out = BoundaryTriangulation(model,tags="outlet")
231-
n_Γout = get_normal_vector(Γ_out)
232-
233-
# Finally, to impose the interface condition between solid and fluid, we will need the triangulation and normal field of such interface, $\Gamma_{\rm FS}$. The interface triangulation is generated by calling the `InterfaceTriangulation` function specifying the two interfacing domain models. Note that the normal field will point outwards with respect to the first entry.
234-
Γ_fs = InterfaceTriangulation(model_fluid,model_solid)
235-
n_Γfs = get_normal_vector(Γ_fs)
236-
237231
# Once we have all the triangulations, we can generate the quadrature rules to be applied each domain. This will be generated by calling the `Measure` function, that given a triangulation and an integration degree, it returns the Lebesgue integral measure $d\Omega$.
238232
degree = 2*k
239233
dΩₛ = Measure(Ω_s,degree)

0 commit comments

Comments
 (0)