Skip to content

Commit

Permalink
Fix some typos. (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
termi-official authored Nov 8, 2024
1 parent 3b081be commit 5153307
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/src/literate-tutorials/ns_vs_diffeq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ jac_sparsity = sparse(K);

# To apply the nonlinear portion of the Navier-Stokes problem we simply hand
# over the dof handler and cell values to the right-hand-side (RHS) as a parameter.
# Furthermore the pre-assembled linear part, our Stokes opeartor (which is time independent)
# Furthermore the pre-assembled linear part, our Stokes operator (which is time independent)
# is passed to save some additional runtime. To apply the time-dependent Dirichlet BCs, we
# also need to hand over the constraint handler.
# The basic idea to apply the Dirichlet BCs consistently is that we copy the
Expand Down
2 changes: 1 addition & 1 deletion docs/src/topics/sparse_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ with linear Lagrange interpolation) this would be reduced to 216 MB.

To give an example, in this one-dimensional heat problem (see the [Heat
equation](../tutorials/heat_equation.md) tutorial for the weak form) we have 4 nodes
with 3 elements in between. For simplicitly DoF numbers and node numbers are the same
with 3 elements in between. For simplicity DoF numbers and node numbers are the same
but this is not true in general since nodes and DoFs can be numbered independently (and
in fact are numbered independently in Ferrite).

Expand Down
2 changes: 1 addition & 1 deletion src/FEValues/common_values.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
"""
ValuesUpdateFlags(ip_fun::Interpolation; update_gradients = Val(true), update_hessians = Val(false), update_detJdV = Val(true))
Creates a singelton type for specifying what parts of the AbstractValues should be updated. Note that this is internal
Creates a singleton type for specifying what parts of the AbstractValues should be updated. Note that this is internal
API used to get type-stable construction. Keyword arguments in `AbstractValues` constructors are forwarded, and the public API
is passing these as `Bool`, while the `ValuesUpdateFlags` method supports both boolean and `Val(::Bool)` keyword args.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/L2_projection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end
Initiate an `L2Projector` for projecting quadrature data onto
a function space. To define the function space, add interpolations for
differents cell sets with `add!` before `close!`ing the projector,
different cell sets with `add!` before `close!`ing the projector,
see the example below.
The `L2Projector` acts as the integrated left hand side of the projection equation:
Expand Down
2 changes: 1 addition & 1 deletion src/interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ end
get_n_copies(::VectorizedInterpolation{vdim}) where {vdim} = vdim
InterpolationInfo(ip::VectorizedInterpolation) = InterpolationInfo(ip.ip, get_n_copies(ip))

# Error when trying to get dof indicies from vectorized interpolations.
# Error when trying to get dof indices from vectorized interpolations.
# Currently, this should only be done for the scalar interpolation.
function _entitydof_indices_vectorized_ip_error(f::Symbol)
throw(ArgumentError(string(f, " is not implemented for VectorizedInterpolations and should be called on the scalar base interpolation")))
Expand Down
16 changes: 8 additions & 8 deletions test/test_pointevaluation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Ferrite, Test
function test_pe_scalar_field()
# isoparametric approximation
mesh = generate_grid(QuadraticQuadrilateral, (3, 3))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)

f(x) = x[1] + x[2]

Expand Down Expand Up @@ -47,7 +47,7 @@ end

function test_pe_embedded()
mesh = generate_grid(QuadraticQuadrilateral, (3, 3))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
mesh = Grid(mesh.cells, map(x -> Node(Vec((x.x[1], x.x[2], x.x[1] + x.x[2]))), mesh.nodes))

f(x) = x[1] + x[2]
Expand Down Expand Up @@ -91,7 +91,7 @@ function test_pe_vector_field()
## vector field
# isoparametric approximation
mesh = generate_grid(QuadraticQuadrilateral, (3, 3))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
f(x) = Vec((x[1], x[2]))
nodal_vals = [f(p.x) for p in mesh.nodes]

Expand Down Expand Up @@ -134,7 +134,7 @@ end
function test_pe_superparametric()
# superparametric approximation
mesh = generate_grid(Quadrilateral, (3, 3))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
f(x) = x
ip_f = Lagrange{RefQuadrilateral, 2}() # function interpolation

Expand Down Expand Up @@ -170,7 +170,7 @@ end

function test_pe_dofhandler()
mesh = generate_grid(Quadrilateral, (2, 2))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
dof_vals = [1.0, 2.0, 5.0, 4.0, 3.0, 6.0, 8.0, 7.0, 9.0]
points = [node.x for node in mesh.nodes] # same as nodes

Expand Down Expand Up @@ -235,7 +235,7 @@ function test_pe_dofhandler2(; three_dimensional = true)
# but not using L2Projector since we want the DofHandler dofs
if (three_dimensional)
mesh = generate_grid(Hexahedron, (3, 3, 3))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
f_s = x -> 1.0 + x[1] + x[2] + x[1] * x[2] + x[2] * x[3]
f_v = x -> Vec{3}((1.0 + x[1] + x[2] + x[1] * x[2], 2.0 - x[1] - x[2] - x[1] * x[2], 4.0 + x[1] - x[2] + x[3] - x[1] * x[3] - x[2] * x[3]))
points = [Vec((x, x, x)) for x in range(0; stop = 1, length = 100)]
Expand All @@ -244,7 +244,7 @@ function test_pe_dofhandler2(; three_dimensional = true)
qr = QuadratureRule{RefHexahedron}(3)
else
mesh = generate_grid(Quadrilateral, (3, 3))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
f_s = x -> 1.0 + x[1] + x[2] + x[1] * x[2]
f_v = x -> Vec{2}((1.0 + x[1] + x[2] + x[1] * x[2], 2.0 - x[1] - x[2] - x[1] * x[2]))
points = [Vec((x, x)) for x in range(0; stop = 1, length = 100)]
Expand Down Expand Up @@ -377,7 +377,7 @@ end
function test_pe_oneD()
# isoparametric approximation
mesh = generate_grid(Line, (2,))
perturbate_standard_grid!(mesh, 1 / 10)
perturb_standard_grid!(mesh, 1 / 10)
f(x) = x[1]
nodal_vals = [f(p.x) for p in mesh.nodes]

Expand Down
6 changes: 3 additions & 3 deletions test/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,16 @@ getfacerefshape(::Tetrahedron, ::Int) = RefTriangle
getfacerefshape(::Pyramid, face::Int) = face == 1 ? RefQuadrilateral : RefTriangle
getfacerefshape(::Wedge, face::Int) = face (1, 5) ? RefTriangle : RefQuadrilateral

function perturbate_standard_grid!(grid::Ferrite.AbstractGrid{dim}, strength) where {dim}
function perturbate(x::Vec{dim}) where {dim}
function perturb_standard_grid!(grid::Ferrite.AbstractGrid{dim}, strength) where {dim}
function perturb(x::Vec{dim}) where {dim}
for d in 1:dim
if x[d] 1.0 || x[d] -1.0
return x
end
end
return x + Vec{dim}(0.5 * strength .* (2 .* rand(Vec{dim}) .- 1.0))
end
return transform_coordinates!(grid, perturbate)
return transform_coordinates!(grid, perturb)
end

######################################################
Expand Down

0 comments on commit 5153307

Please sign in to comment.