Skip to content

Commit

Permalink
Fix various typos in documentation and comments (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
goggle authored Apr 1, 2023
1 parent be83f2f commit a917a24
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmarks-assembly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for spatial_dim ∈ 1:3

qr = QuadratureRule{spatial_dim, ref_type}(2*order-1)

# Currenlty we just benchmark nodal Lagrange bases.
# Currently we just benchmark nodal Lagrange bases.
COMMON_LOCAL_ASSEMBLY["spatial-dim",spatial_dim][string(geo_type)][string(ip_type),string(order)] = BenchmarkGroup()
LAGRANGE_SUITE = COMMON_LOCAL_ASSEMBLY["spatial-dim",spatial_dim][string(geo_type)][string(ip_type),string(order)]
LAGRANGE_SUITE["fe-values"] = BenchmarkGroup()
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmarks-boundary-conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SUITE["boundary-conditions"] = BenchmarkGroup()

SUITE["boundary-conditions"]["Dirichlet"] = BenchmarkGroup()
DIRICHLET_SUITE = SUITE["boundary-conditions"]["Dirichlet"]
# span artifical scope...
# span artificial scope...
for spatial_dim [2]
# Benchmark application on global system
DIRICHLET_SUITE["global"] = BenchmarkGroup()
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmarks-mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SUITE["mesh"] = BenchmarkGroup()
# Generator benchmarks
SUITE["mesh"]["generator"] = BenchmarkGroup()

# Strucutred hyperrectangle generators
# Structured hyperrectangle generators
SUITE["mesh"]["generator"]["hyperrectangle"] = BenchmarkGroup()
HYPERRECTANGLE_GENERATOR = SUITE["mesh"]["generator"]["hyperrectangle"]
for spatial_dim 1:3
Expand Down
2 changes: 1 addition & 1 deletion docs/src/devdocs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ JULIA_CMD=<path-to-julia-executable> make compare target=<target-commit> baselin
```

!!! note
For the performance comparison between two commits you must not have any uncommited
For the performance comparison between two commits you must not have any uncommitted
or untracked files in your Ferrite.jl folder! Otherwise the `PkgBenchmark.jl` will
fail to setup the comparison.

Expand Down
6 changes: 3 additions & 3 deletions docs/src/literate/hyperelasticity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
# ``\Omega`` denotes the reference (sometimes also called *initial* or *material*) domain.
# Gradients are defined with respect to the reference domain, here denoted with an ``\mathbf{X}``.
# Formally this is expressed as ``(\nabla_{\mathbf{X}} \bullet)_{ij} := \frac{\partial(\bullet)_i}{\partial X_j}``.
# Note that for large deformation problems it is also possibile that gradients and integrals
# Note that for large deformation problems it is also possible that gradients and integrals
# are defined on the deformed (sometimes also called *current* or *spatial*) domain, depending
# on the specific formulation.
#
# The specific problem we will solve in this example is the cube from Figure 1: On one side
# we apply a rotation using Dirichlet boundary conditions, on the opposite side we fix the
# displacement with a homogenous Dirichlet boundary condition, and on the remaining four
# displacement with a homogeneous Dirichlet boundary condition, and on the remaining four
# sides we apply a traction in the normal direction of the surface. In addition, a body
# force is applied in one direction.
#
Expand Down Expand Up @@ -337,7 +337,7 @@ function solve()
end

dbcs = ConstraintHandler(dh)
## Add a homogenous boundary condition on the "clamped" edge
## Add a homogeneous boundary condition on the "clamped" edge
dbc = Dirichlet(:u, getfaceset(grid, "right"), (x,t) -> [0.0, 0.0, 0.0], [1, 2, 3])
add!(dbcs, dbc)
dbc = Dirichlet(:u, getfaceset(grid, "left"), (x,t) -> rotation(x, t), [1, 2, 3])
Expand Down
2 changes: 1 addition & 1 deletion docs/src/literate/landau.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The key to using a method like this for minimizing a free energy function directly,
# rather than the weak form, as is usually done with FEM, is to split up the
# gradient and Hessian calculations.
# This means that they are performed for each cell seperately instead of for the
# This means that they are performed for each cell separately instead of for the
# grid as a whole.

using ForwardDiff
Expand Down
14 changes: 7 additions & 7 deletions docs/src/literate/linear_shell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ## Introduction
#
# In this example we show how shell elements can be analyzed in Ferrite.jl. The shell implemented here comes from the book
# "The finite elment method - Linear static and dynamic finite element analysis" by Hughes (1987), and a brief description of it is
# "The finite element method - Linear static and dynamic finite element analysis" by Hughes (1987), and a brief description of it is
# given at the end of this tutorial. The first part of the tutorial explains how to set up the problem.

# ## Setting up the problem
Expand Down Expand Up @@ -51,12 +51,12 @@ ch = ConstraintHandler(dh)
add!(ch, Dirichlet(:u, getedgeset(grid, "left"), (x, t) -> (0.0, 0.0), [1,3]) )
add!(ch, Dirichlet(, getedgeset(grid, "left"), (x, t) -> (0.0, 0.0), [1,2]) )

# On the right edge, we also lock the displacements in the x- and z- directions, but apply a precribed roation.
# On the right edge, we also lock the displacements in the x- and z- directions, but apply a precribed rotation.
#+
add!(ch, Dirichlet(:u, getedgeset(grid, "right"), (x, t) -> (0.0, 0.0), [1,3]) )
add!(ch, Dirichlet(, getedgeset(grid, "right"), (x, t) -> (0.0, pi/10), [1,2]) )

# In order to not get rigid body motion, we lock the y-displacement in one fo the corners.
# In order to not get rigid body motion, we lock the y-displacement in one of the corners.
#+
add!(ch, Dirichlet(, getvertexset(grid, "corner"), (x, t) -> (0.0), [2]) )

Expand Down Expand Up @@ -133,16 +133,16 @@ end;

# ## The shell element
#
# The shell presented here comes from the book "The finite elment method - Linear static and dynamic finite element analysis" by Hughes (1987).
# The shell presented here comes from the book "The finite element method - Linear static and dynamic finite element analysis" by Hughes (1987).
# The shell is a so called degenerate shell element, meaning it is based on a continuum element.
# A brief describtion of the shell is given here.
# A brief description of the shell is given here.

#md # !!! note
#md # This element might experience various locking phenomenas, and should only be seen as a proof of concept.

# ##### Fiber coordinate system
# The element uses two coordinate systems. The first coordianate system, called the fiber system, is created for each
# element node, and is used as a reference frame for the rotations. The function below implements an algorthim that return the
# element node, and is used as a reference frame for the rotations. The function below implements an algorithm that return the
# fiber directions, $\boldsymbol{e}^{f}_{a1}$, $\boldsymbol{e}^{f}_{a2}$ and $\boldsymbol{e}^{f}_{a3}$, at each node $a$.
function fiber_coordsys(Ps::Vector{Vec{3,Float64}})

Expand Down Expand Up @@ -210,7 +210,7 @@ end;
# where $\boldsymbol{\bar{x}}_{a}$ are nodal positions on the mid-surface, and $\boldsymbol{\bar{p}_a}$ is an vector that defines the fiber direction
# on the reference surface. $N_a$ arethe shape functions.
#
# Based on the defintion of the position vector, we create an function for obtaining the Jacobian-matrix,
# Based on the definition of the position vector, we create an function for obtaining the Jacobian-matrix,
# ```math
# J_{ij} = \frac{\partial x_i}{\partial \xi_j},
# ```
Expand Down
8 changes: 4 additions & 4 deletions docs/src/literate/ns_vs_diffeq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# ```
# where $v_{in}(t) = \text{clamp}(t, 0.0, 1.0)$. With a dynamic viscosity of $\nu = 0.001$
# this is enough to induce turbulence behind the cylinder which leads to vortex shedding. The top and bottom of our
# channel have no-slip conditions, i.e. $v = [0,0]^{\textrm{T}}$, while the right boundary has the do-nothing boundary condtion
# channel have no-slip conditions, i.e. $v = [0,0]^{\textrm{T}}$, while the right boundary has the do-nothing boundary condition
# $\nu \partial_{\textrm{n}} v - p n = 0$ to model outflow. With these boundary conditions we can choose the zero solution as a
# feasible initial condition.
#
Expand Down Expand Up @@ -134,7 +134,7 @@ y_cells = round(Int, 41/3) #hide
grid = generate_grid(Quadrilateral, (x_cells, y_cells), Vec{2}((0.0, 0.0)), Vec{2}((2.2, 0.41)));

# Next we carve a hole $B_{0.05}(0.2,0.2)$ in the mesh by deleting the cells and update the boundary face sets.
# This code will be replaced once a proper mesh interface is avaliable.
# This code will be replaced once a proper mesh interface is available.
cell_indices = filter(ci->norm(mean(map(i->grid.nodes[i].x-[0.2,0.2], Ferrite.vertices(grid.cells[ci]))))>0.05, 1:length(grid.cells))
hole_cell_indices = filter(ci->norm(mean(map(i->grid.nodes[i].x-[0.2,0.2], Ferrite.vertices(grid.cells[ci]))))<=0.05, 1:length(grid.cells));
hole_face_ring = Set{FaceIndex}()
Expand Down Expand Up @@ -403,7 +403,7 @@ function navierstokes!(du,u_uc,p,t)
end
end

# For now we have to ingore the evolution of the Dirichlet BCs.
# For now we have to ignore the evolution of the Dirichlet BCs.
# The DBC dofs in the solution vector will be corrected in a post-processing step.
#+
apply_zero!(du, ch)
Expand All @@ -416,7 +416,7 @@ problem = ODEProblem(rhs, u₀, (0.0,T), p);
# Now we can put everything together by specifying how to solve the problem.
# We want to use the adaptive implicit Euler method with our custom linear
# solver, which helps in the enforcement of the Dirichlet BCs. Further we
# enable the progress bar with the `progess` and `progress_steps` arguments.
# enable the progress bar with the `progress` and `progress_steps` arguments.
# Finally we have to communicate the time step length and initialization
# algorithm. Since we start with a valid initial state we do not use one of
# DifferentialEquations.jl initialization algorithms.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/literate/plasticity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function solve()
end

## ## Postprocessing
## Only a vtu-file corrsponding to the last time-step is exported.
## Only a vtu-file corresponding to the last time-step is exported.
##
## The following is a quick (and dirty) way of extracting average cell data for export.
mises_values = zeros(getncells(grid))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/literate/stokes-flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# step-11](https://www.dealii.org/current/doxygen/deal.II/step_11.html) for some more
# discussion around this). In particular, we will enforce the mean value of the pressure on
# the boundary to be 0, i.e. ``\int_{\Gamma} p\ \mathrm{d}\Gamma = 0``. One option is to
# enforce this using a Lagrange multipler. This would give a contribution ``\lambda
# enforce this using a Lagrange multiplier. This would give a contribution ``\lambda
# \int_{\Gamma} \delta p\ \mathrm{d}\Gamma`` to the second equation in the weak form above,
# and a third equation ``\delta\lambda \int_{\Gamma} p\ \mathrm{d}\Gamma = 0`` so that we
# can solve for ``\lambda``. However, since we in this case are not interested in computing
Expand Down
4 changes: 2 additions & 2 deletions docs/src/literate/topology_optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# We obtain the mechanical displacement field by applying the Finite Element Method to the weak form
# of the Gibbs energy using Ferrite. In contrast, we use the evolution equation (i.e. the strong form) to calculate
# the value of the density field $\chi$. The advantage of this "split" approach is the very high computation speed.
# The evolution equation consists of the driving force, the damping paramter $\eta$, the regularization parameter $\beta$ times the Laplacian,
# The evolution equation consists of the driving force, the damping parameter $\eta$, the regularization parameter $\beta$ times the Laplacian,
# which is necessary to avoid numerical issues like mesh dependence or checkerboarding, and the constraint parameters $\lambda$, to keep the mass constant,
# and $\gamma$, to avoid leaving the set $[\chi_{\text{min}}, 1]$. By including gradient regularization, it becomes necessary to calculate the Laplacian.
# The Finite Difference Method for square meshes with the edge length $\Delta h$ approximates the Laplacian as follows:
Expand Down Expand Up @@ -379,7 +379,7 @@ end

# We put everything together in the main function. Here the user may choose the radius parameter, which
# is related to the regularization parameter as $\beta = ra^2$, the starting density, the number of elements in vertical direction and finally the
# name of the output. Addtionally, the user may choose whether only the final design (default)
# name of the output. Additionally, the user may choose whether only the final design (default)
# or every iteration step is saved.
#
# First, we compute the material parameters and create the grid, DofHandler, boundary condition and FE values.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/literate/transient_heat_equation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ K, f = doassemble_K!(K, f, cellvalues, dh)
M = doassemble_M!(M, cellvalues, dh)
A = (Δt .* K) + M;
# Now, we need to save all boundary condition related values of the unaltered system matrix `A`, which is done
# by `get_rhs_data`. The function returns a `RHSData` struct, which contains all needed informations to apply
# by `get_rhs_data`. The function returns a `RHSData` struct, which contains all needed information to apply
# the boundary conditions solely on the right-hand-side vector of the problem.
rhsdata = get_rhs_data(ch, A);
# We set the values at initial time step, denoted by uₙ, to a bubble-shape described by
Expand Down
2 changes: 1 addition & 1 deletion docs/src/manual/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ for iter in 1:maxiter
check_convergence(r, ...) && break # Only check convergence after `apply_zero!(K, r, ch)`
Δa = K \ r # Calculate the (negative) update
apply_zero!(Δa, ch) # Change the constrained values in `Δa` such that `a-Δa`
# fullfills constraints if `a` did.
# fulfills constraints if `a` did.
a .-= Δa
end
```
4 changes: 2 additions & 2 deletions src/Dofs/ConstraintHandler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end

const DofCoefficients{T} = Vector{Pair{Int,T}}
"""
AffineConstraint(constrained_dof::Int, entires::Vector{Pair{Int,T}}, b::T) where T
AffineConstraint(constrained_dof::Int, entries::Vector{Pair{Int,T}}, b::T) where T
Define an affine/linear constraint to constrain one degree of freedom, `u[i]`,
such that `u[i] = ∑(u[j] * a[j]) + b`,
Expand Down Expand Up @@ -584,7 +584,7 @@ result (e.g. `du` zero for all prescribed degrees of freedom).
apply_zero!(v::AbstractVector, ch::ConstraintHandler)
Zero-out values in `v` corresponding to prescribed degrees of freedom and update values
prescribed by affine constraints, such that if `a` fullfills the constraints,
prescribed by affine constraints, such that if `a` fulfills the constraints,
`a ± v` also will.
These methods are typically used in e.g. a Newton solver where the increment, `du`, should
Expand Down
6 changes: 3 additions & 3 deletions src/Dofs/MixedDofHandler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
Construct a `FieldHandler` based on an array of [`Field`](@ref)s and assigns it a set of cells.
A `FieldHandler` must fullfill the following requirements:
A `FieldHandler` must fulfill the following requirements:
- All [`Cell`](@ref)s in `cellset` are of the same type.
- Each field only uses a single interpolation on the `cellset`.
- Each cell belongs only to a single `FieldHandler`, i.e. all fields on a cell must be added within the same `FieldHandler`.
Expand Down Expand Up @@ -512,7 +512,7 @@ Return the index of the field with name `field_name` in a `MixedDofHandler`. The
field was found and the 2nd entry is the index of the field within the `FieldHandler`.
!!! note
Always finds the 1st occurence of a field within `MixedDofHandler`.
Always finds the 1st occurrence of a field within `MixedDofHandler`.
See also: [`find_field(fh::FieldHandler, field_name::Symbol)`](@ref),
[`_find_field(fh::FieldHandler, field_name::Symbol)`](@ref).
Expand Down Expand Up @@ -589,7 +589,7 @@ index, where `field_idx` represents the index of a field within a `FieldHandler`
The `dof_range` of a field can vary between different `FieldHandler`s. Therefore, it is
advised to use the `field_idxs` or refer to a given `FieldHandler` directly in case
several `FieldHandler`s exist. Using the `field_name` will always refer to the first
occurence of `field` within the `MixedDofHandler`.
occurrence of `field` within the `MixedDofHandler`.
Example:
```jldoctest
Expand Down
2 changes: 1 addition & 1 deletion src/Grid/coloring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function workstream_coloring(incidence_matrix, cellset)
## Zone N: All elements with connection to elements in Zone N-1
while true
s = Set{Int}()
# Loop over all elements in previous zone and add their neigbouring elements
# Loop over all elements in previous zone and add their neighbouring elements
# unless they are in any of the previous 2 zones.
empty_zone = true
for c in get(zones, Z-1, Z0)
Expand Down
2 changes: 1 addition & 1 deletion src/L2_projection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function project(proj::L2Projector,

projected_vals = _project(vars, proj, fe_values, M, T)::Vector{T}
if project_to_nodes
# NOTE we may have more projected values than verticies in the mesh => not all values are returned
# NOTE we may have more projected values than vertices in the mesh => not all values are returned
nnodes = getnnodes(proj.dh.grid)
reordered_vals = fill(convert(T, NaN * zero(T)), nnodes)
for node = 1:nnodes
Expand Down
4 changes: 2 additions & 2 deletions src/interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ boundarydof_indices(::Type{VertexIndex}) = Ferrite.vertexdof_indices
#########################
# TODO generalize to arbitrary basis positionings.
"""
Piecewise discontinous Lagrange basis via Gauss-Lobatto points.
Piecewise discontinuous Lagrange basis via Gauss-Lobatto points.
"""
struct DiscontinuousLagrange{dim,shape,order} <: Interpolation{dim,shape,order} end

Expand Down Expand Up @@ -1086,7 +1086,7 @@ end
"""
Classical non-conforming Crouzeix–Raviart element.
For details we refer ot the original paper:
For details we refer to the original paper:
M. Crouzeix and P. Raviart. "Conforming and nonconforming finite element
methods for solving the stationary Stokes equations I." ESAIM: Mathematical Modelling
and Numerical Analysis-Modélisation Mathématique et Analyse Numérique 7.R3 (1973): 33-75.
Expand Down
2 changes: 1 addition & 1 deletion test/test_interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
reinterpret(Float64, Ferrite.derivative(interpolation, x))
@test sum(Ferrite.value(interpolation, x)) 1.0

# Check if the important functions are consistens
# Check if the important functions are consistent
coords = Ferrite.reference_coordinates(interpolation)
@test length(coords) == n_basefuncs
@test Ferrite.value(interpolation, length(coords), x) == Ferrite.value(interpolation, length(coords), x)
Expand Down
2 changes: 1 addition & 1 deletion test/test_mixeddofhandler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ end


function test_element_order()
# Check that one can have non-contigous ordering of cells in a Grid
# Check that one can have non-contiguous ordering of cells in a Grid
# Something like this:
# ______
# /| |\
Expand Down

0 comments on commit a917a24

Please sign in to comment.