Skip to content

Commit 0d4a06c

Browse files
Merge pull request #173 from gridap/fix_typos
Fixing misc typos
2 parents 9bd0683 + ea03c04 commit 0d4a06c

8 files changed

Lines changed: 17 additions & 17 deletions

src/TopOptEMFocus.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# ```
7171
# where $n_{air}=1$ and $n_{metal}$ are the refractive indices ($\sqrt{\varepsilon}$) of the air and metal, respectively. (It is tempting to simply linearly interpolate the permittivities ε, rather than the refractive indices, but this turns out to lead to artificial singularities in the case of metals where ε can pass through zero [4].)
7272
#
73-
# In practice, to avoid obtaining arbitrarily fine features as the spatial resolution is increased, one needs to regularize the problem with a minimum lengthscale $r_f$ by generating a smoothed/filtered parameter function $p_f$. (Although this regularizes the problem, strictly speaking it does not impose a minimum feature size because of the nonlinear-projection step below. In practical applications, one imposes additional [manufacturing constraints](http://doi.org/10.1364/OE.431188) explicitly.) We perform the smoothing $p \to p_f$ by solving a simple "damped diffusion" PDE, also called a Helmholtz filter [5], for $p_f$ given the design variables $p$:
73+
# In practice, to avoid obtaining arbitrarily fine features as the spatial resolution is increased, one needs to regularize the problem with a minimum length-scale $r_f$ by generating a smoothed/filtered parameter function $p_f$. (Although this regularizes the problem, strictly speaking it does not impose a minimum feature size because of the nonlinear-projection step below. In practical applications, one imposes additional [manufacturing constraints](http://doi.org/10.1364/OE.431188) explicitly.) We perform the smoothing $p \to p_f$ by solving a simple "damped diffusion" PDE, also called a Helmholtz filter [5], for $p_f$ given the design variables $p$:
7474
# ```math
7575
# \begin{aligned}
7676
# -r_f^2\nabla^2p_f+p_f&=p\, ,\\
@@ -182,14 +182,14 @@ pf_reffe = ReferenceFE(lagrangian, Float64, 1)
182182
Qf = TestFESpace(Ω_d, pf_reffe, vector_type = Vector{Float64})
183183
Pf = Qf
184184

185-
# Finally, we pack up every thing related to gridap as a named tuple called `fem_params`. This is because we want to pass those as local parameters to the optimization functions later, instead of making them as global parameters.
185+
# Finally, we pack up every thing related to Gridap as a named tuple called `fem_params`. This is because we want to pass those as local parameters to the optimization functions later, instead of making them as global parameters.
186186
#
187187

188188
fem_params = (; V, U, Q, P, Qf, Pf, np, Ω, dΩ, dΩ_d, dΩ_c, dΓ_s)
189189

190190
# ## PML formulation
191191
#
192-
# First we pack up all physical parameters as a structure call `phys`. Then we define a `s_PML` function: $s(x)=1+\mathrm{i}\sigma(u)/\omega,$ and its derivative `ds_PML`. The parameter `LHp` and `LHn` indicates the size of the inner boundary of the PML regions. Finally, we create a function-like object `Λ` that returns the PML factors and define its derivative in gridap.
192+
# First we pack up all physical parameters as a structure call `phys`. Then we define a `s_PML` function: $s(x)=1+\mathrm{i}\sigma(u)/\omega,$ and its derivative `ds_PML`. The parameter `LHp` and `LHn` indicates the size of the inner boundary of the PML regions. Finally, we create a function-like object `Λ` that returns the PML factors and define its derivative in Gridap.
193193
#
194194
# Note that here we are defining a "callable object" of type `Λ` that encapsulates all of the PML parameters. This is convenient, both because we can pass lots of parameters around easily and also because we can define additional methods on `Λ`, e.g. to express the `∇(Λv)` operation.
195195
#
@@ -318,7 +318,7 @@ end
318318

319319
# ## Optimization with adjoint method
320320
#
321-
# Now that we have our objective to optimize, the next step is to find out the derivative to the desigin parameter $p$ in order to apply a gradient-based optimization algorithm. We will be using `ChainRulesCore` and `Zygote` packages.
321+
# Now that we have our objective to optimize, the next step is to find out the derivative to the design parameter $p$ in order to apply a gradient-based optimization algorithm. We will be using `ChainRulesCore` and `Zygote` packages.
322322
#
323323

324324
using ChainRulesCore, Zygote

src/darcy.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ X = MultiFieldFESpace([U, P])
8585

8686
# ## Numerical integration
8787
#
88-
# In this example we need to integrate in the interior of $\Omega$ and on the Neumann boundary $\Gamma_{\rm N}$. For the volume integrals, we extract the triangulation from the geometrical model and define the corresponding Lebesge measures, which will allow to write down the integrals of the weak form.
88+
# In this example we need to integrate in the interior of $\Omega$ and on the Neumann boundary $\Gamma_{\rm N}$. For the volume integrals, we extract the triangulation from the geometrical model and define the corresponding Lebesgue measures, which will allow to write down the integrals of the weak form.
8989

9090
trian = Triangulation(model)
9191
degree = 2
9292
= Measure(trian,degree)
9393

94-
# In order to integrate the Neumann boundary condition, we only need to build an integration mesh for the right side of the domain (which is the only part of $\Gamma_{\rm N}$, where the Neumann function $h$ is different from zero). Within the model, the right side of $\Omega$ is identified with the boundary tag 8. Using this identifier, we extract the corresponding surface triangulation and create the required Lebesge measure.
94+
# In order to integrate the Neumann boundary condition, we only need to build an integration mesh for the right side of the domain (which is the only part of $\Gamma_{\rm N}$, where the Neumann function $h$ is different from zero). Within the model, the right side of $\Omega$ is identified with the boundary tag 8. Using this identifier, we extract the corresponding surface triangulation and create the required Lebesgue measure.
9595

9696
neumanntags = [8,]
9797
btrian = BoundaryTriangulation(model,tags=neumanntags)

src/dg_discretization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ writevtk(Λ,"strian")
245245
# ![](../assets/dg_discretization/skeleton_trian.png)
246246
#
247247
# Once we have constructed the triangulations needed in this example, we define
248-
# the corresponding quadrature rules by passing the triangualtions
248+
# the corresponding quadrature rules by passing the triangulations
249249
# together with the desired degree to the `Measure` function.
250250

251251
degree = 2*order

src/emscatter.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# Note that at a finite mesh resolution, PML reflects some waves, and the standard technique to mitigate this is to "turn on" the PML absorption gradually—in this case we use a quadratic profile. The amplitude $\sigma_0$ is chosen so that in the limit of infinite resolution the "round-trip" normal-incidence is some small number.
3636
#
3737
# Since PML absorbs all waves in $x/y$ direction, the associated boundary condition is then usually the zero Dirichlet boundary condition. Here, the boundary conditions are zero Dirichlet boundary on the top and bottom side $\Gamma_D$ but periodic boundary condition on the left ($\Gamma_L$) and right side ($\Gamma_R$).
38-
# The reason that we use a periodic boundary condition for the left and right side instead of zero Dirichlet boundary condition is that we want to simulate a plane wave exicitation, which then requires a periodic boundary condition.
38+
# The reason that we use a periodic boundary condition for the left and right side instead of zero Dirichlet boundary condition is that we want to simulate a plane wave excitation, which then requires a periodic boundary condition.
3939
#
4040
# Consider $\mu(x)=1$ (which is mostly the case in electromagnetic problems) and denote $\Lambda=\operatorname{diagm}(\Lambda_x,\Lambda_y)$ where $\Lambda_{x/y}=\frac{1}{1+\mathrm{i}\sigma(u_{x/y})/\omega}$, we can formulate the problem as
4141
#
@@ -46,7 +46,7 @@
4646
# H|_{\Gamma_L}&=H|_{\Gamma_R},&\\
4747
# \end{aligned}\right.
4848
# ```
49-
# For convenience, in the weak form and Julia implementation below we represent $\Lambda$ as a vector instead of a diagonal $2 \times 2$ matrix, in which case $\Lambda\nabla$ becomes the elementwise product.
49+
# For convenience, in the weak form and Julia implementation below we represent $\Lambda$ as a vector instead of a diagonal $2 \times 2$ matrix, in which case $\Lambda\nabla$ becomes the element-wise product.
5050
#
5151
# ## Numerical scheme
5252
#
@@ -89,7 +89,7 @@ model = GmshDiscreteModel("../models/geometry.msh")
8989

9090
# ## FE spaces
9191
#
92-
# We use the first-order lagrangian as the finite element function space basis. The Dirichlet edges are labeled with `DirichletEdges` in the mesh file. Since our problem involves complex numbers (because of PML), we need to assign the `vector_type` to be `Vector{ComplexF64}`.
92+
# We use the first-order Lagrangian as the finite element function space basis. The Dirichlet edges are labeled with `DirichletEdges` in the mesh file. Since our problem involves complex numbers (because of PML), we need to assign the `vector_type` to be `Vector{ComplexF64}`.
9393
#
9494

9595
# ### Test and trial finite element function space
@@ -120,7 +120,7 @@ dΓ = Measure(Γ,degree)
120120
# ### PML parameters
121121
Rpml = 1e-12 # Tolerance for PML reflection
122122
σ = -3/4*log(Rpml)/d_pml # σ_0
123-
LH = (L,H) # Size of the PML inner boundary (a rectangular centere at (0,0))
123+
LH = (L,H) # Size of the PML inner boundary (a rectangular center at (0,0))
124124

125125
# ### PML coordinate stretching functions
126126
function s_PML(x,σ,k,LH,d_pml)
@@ -189,7 +189,7 @@ uh = solve(op)
189189

190190
# ## Analytical solution
191191
# ### Theoretical analysis
192-
# In this section, we construct the semi-analytical solution to this scattering problem, for comparison to the numerical solution. This is possible because of the symmetry of the cylinder, which allows us to expand the solutions of the Helmoltz equation in Bessel functions and match boundary conditions at the cylinder interface. (In 3d, the analogous process with spherical harmonics is known as "Mie scattering".) For more information on this technique, see Ref [4].
192+
# In this section, we construct the semi-analytical solution to this scattering problem, for comparison to the numerical solution. This is possible because of the symmetry of the cylinder, which allows us to expand the solutions of the Helmholtz equation in Bessel functions and match boundary conditions at the cylinder interface. (In 3d, the analogous process with spherical harmonics is known as "Mie scattering".) For more information on this technique, see Ref [4].
193193
# In 2D cylinder coordinates, we can expand the plane wave in terms of Bessel functions (this is the Jacobi–Anger identity [5]):
194194
#
195195
# ```math

src/fsi_tutorial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ n_Γout = get_normal_vector(Γ_out)
189189
Γ_fs = InterfaceTriangulation(Ω_f,Ω_s)
190190
n_Γfs = get_normal_vector(Γ_fs)
191191

192-
# In what follows we will assume a second-order veloticty interpolation, i.e. $k=2$
192+
# In what follows we will assume a second-order velocity interpolation, i.e. $k=2$
193193
k = 2
194194

195195
# Now we define the reference FE for the velocity and pressure fields. The velocity field reference FE, both for fluid and solid domains, will be defined by a 2-dimensional `VectorValue` type `:Lagrangian` reference FE element of order `k`. The reference FE for the pressure will be given by a scalar value type `:Lagrangian` reference FE element of order `k-1`.

src/poisson_transient.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ U = TransientTrialFESpace(V,g)
6363

6464
# The weak form of the problem follows the same structure as other `Gridap` tutorials, where we define the bilinear and linear forms to define the `FEOperator`. In this case we need to deal with time-dependent quantities and with the presence of time derivatives. The former is handled by passing the time, $t$, as an additional argument to the form, i.e. $a(t,u,v)$. The latter is defined using the time derivative operator `∂t`.
6565

66-
# The most general way of constructing a transient FE operator is by using the `TransientFEOperator` function, which receives a residual, a jacobian with respect to the unknown and a jacobian with respect to the time derivative.
66+
# The most general way of constructing a transient FE operator is by using the `TransientFEOperator` function, which receives a residual, a Jacobian with respect to the unknown and a Jacobian with respect to the time derivative.
6767
κ(t) = 1.0 + 0.95*sin(2π*t)
6868
f(t) = sin*t)
6969
res(t,u,v) = ( ∂t(u)*v + κ(t)*((u)(v)) - f(t)*v )dΩ

src/validation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ uh = solve(op)
107107
#
108108
# ## Measuring the discretization error
109109
#
110-
# Our goal is to check that the discratization error associated with the computed approximation `uh` is close to machine precision. To this end, the first step is to compute the discretization error, which is done as you would expect:
110+
# Our goal is to check that the discretization error associated with the computed approximation `uh` is close to machine precision. To this end, the first step is to compute the discretization error, which is done as you would expect:
111111

112112
e = u - uh
113113

src/validation_DrWatson.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# In this tutorial, we will learn
22
# - How to use `DrWatson.jl` to accelerate and reproduce our Gridap simulation workflows
33

4-
# [DrWatson.jl](https://github.com/JuliaDynamics/DrWatson.jl) is a Julia package that helps managing a typical scientific workflow thorought all its phases, see a summary [here](https://juliadynamics.github.io/DrWatson.jl/stable/workflow/).
4+
# [DrWatson.jl](https://github.com/JuliaDynamics/DrWatson.jl) is a Julia package that helps managing a typical scientific workflow through all its phases, see a summary [here](https://juliadynamics.github.io/DrWatson.jl/stable/workflow/).
55

66
# All its functionalities can be accessed with (non-invasive) simple function calls.
77

@@ -40,7 +40,7 @@ import Gridap: ∇
4040

4141
# To this end, we want to solve our computational model for many combinations of mesh size and order of FE approximation (*parameters*) and extract the L2- and H1-norm errors (*output data*).
4242

43-
# We first group all parameters and parameter values in a single ditionary
43+
# We first group all parameters and parameter values in a single dictionary
4444

4545
params = Dict(
4646
"cells_per_axis" => [8,16,32,64],

0 commit comments

Comments
 (0)