diff --git a/benchmark/benchmarks-assembly.jl b/benchmark/benchmarks-assembly.jl index 3c646a30db..70805a9de4 100644 --- a/benchmark/benchmarks-assembly.jl +++ b/benchmark/benchmarks-assembly.jl @@ -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() diff --git a/benchmark/benchmarks-boundary-conditions.jl b/benchmark/benchmarks-boundary-conditions.jl index b2a3b0ac7d..3531ff46c2 100644 --- a/benchmark/benchmarks-boundary-conditions.jl +++ b/benchmark/benchmarks-boundary-conditions.jl @@ -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() diff --git a/benchmark/benchmarks-mesh.jl b/benchmark/benchmarks-mesh.jl index 34d7413f38..6513bdc7b4 100644 --- a/benchmark/benchmarks-mesh.jl +++ b/benchmark/benchmarks-mesh.jl @@ -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 diff --git a/docs/src/devdocs/performance.md b/docs/src/devdocs/performance.md index 6c6dc56b00..32cb476405 100644 --- a/docs/src/devdocs/performance.md +++ b/docs/src/devdocs/performance.md @@ -24,7 +24,7 @@ JULIA_CMD= make compare target= 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. diff --git a/docs/src/literate/hyperelasticity.jl b/docs/src/literate/hyperelasticity.jl index 106a9b7172..9cfc2da750 100644 --- a/docs/src/literate/hyperelasticity.jl +++ b/docs/src/literate/hyperelasticity.jl @@ -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. # @@ -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]) diff --git a/docs/src/literate/landau.jl b/docs/src/literate/landau.jl index 57502c7765..f628ee0c52 100644 --- a/docs/src/literate/landau.jl +++ b/docs/src/literate/landau.jl @@ -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 diff --git a/docs/src/literate/linear_shell.jl b/docs/src/literate/linear_shell.jl index 0e548e449f..7fa3b51938 100644 --- a/docs/src/literate/linear_shell.jl +++ b/docs/src/literate/linear_shell.jl @@ -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 @@ -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]) ) @@ -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}}) @@ -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}, # ``` diff --git a/docs/src/literate/ns_vs_diffeq.jl b/docs/src/literate/ns_vs_diffeq.jl index f3eb0ccff3..c31247eb8e 100644 --- a/docs/src/literate/ns_vs_diffeq.jl +++ b/docs/src/literate/ns_vs_diffeq.jl @@ -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. # @@ -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}() @@ -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) @@ -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. diff --git a/docs/src/literate/plasticity.jl b/docs/src/literate/plasticity.jl index 49dd07327a..243322744a 100644 --- a/docs/src/literate/plasticity.jl +++ b/docs/src/literate/plasticity.jl @@ -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)) diff --git a/docs/src/literate/stokes-flow.jl b/docs/src/literate/stokes-flow.jl index f125a08b51..5744146e70 100644 --- a/docs/src/literate/stokes-flow.jl +++ b/docs/src/literate/stokes-flow.jl @@ -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 diff --git a/docs/src/literate/topology_optimization.jl b/docs/src/literate/topology_optimization.jl index 26f644e7ca..39a60a6241 100644 --- a/docs/src/literate/topology_optimization.jl +++ b/docs/src/literate/topology_optimization.jl @@ -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: @@ -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. diff --git a/docs/src/literate/transient_heat_equation.jl b/docs/src/literate/transient_heat_equation.jl index d1d9269fae..42a4956cf5 100644 --- a/docs/src/literate/transient_heat_equation.jl +++ b/docs/src/literate/transient_heat_equation.jl @@ -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 diff --git a/docs/src/manual/constraints.md b/docs/src/manual/constraints.md index 720339d776..1a29090cd1 100644 --- a/docs/src/manual/constraints.md +++ b/docs/src/manual/constraints.md @@ -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 ``` diff --git a/src/Dofs/ConstraintHandler.jl b/src/Dofs/ConstraintHandler.jl index 904a301a76..4acb8c24aa 100644 --- a/src/Dofs/ConstraintHandler.jl +++ b/src/Dofs/ConstraintHandler.jl @@ -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`, @@ -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 diff --git a/src/Dofs/MixedDofHandler.jl b/src/Dofs/MixedDofHandler.jl index f1fed7c2d4..79da354166 100644 --- a/src/Dofs/MixedDofHandler.jl +++ b/src/Dofs/MixedDofHandler.jl @@ -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`. @@ -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). @@ -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 diff --git a/src/Grid/coloring.jl b/src/Grid/coloring.jl index 3303762862..73bbd8b248 100644 --- a/src/Grid/coloring.jl +++ b/src/Grid/coloring.jl @@ -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) diff --git a/src/L2_projection.jl b/src/L2_projection.jl index 353872e922..7256238a24 100644 --- a/src/L2_projection.jl +++ b/src/L2_projection.jl @@ -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 diff --git a/src/interpolations.jl b/src/interpolations.jl index 229b9fbf3f..56c709352e 100644 --- a/src/interpolations.jl +++ b/src/interpolations.jl @@ -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 @@ -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. diff --git a/test/test_interpolations.jl b/test/test_interpolations.jl index 5fce8d8eeb..371dd243f4 100644 --- a/test/test_interpolations.jl +++ b/test/test_interpolations.jl @@ -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) diff --git a/test/test_mixeddofhandler.jl b/test/test_mixeddofhandler.jl index 7b20e60a23..55910cb78a 100644 --- a/test/test_mixeddofhandler.jl +++ b/test/test_mixeddofhandler.jl @@ -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: # ______ # /| |\