Skip to content

Commit

Permalink
Add and apply codespell config (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpthiele authored Nov 20, 2024
1 parent 9c9d514 commit 6d23969
Show file tree
Hide file tree
Showing 28 changed files with 40 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list = missings,rcall,linke,fo
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## October 28, 2024

Moved repositiory from https://github.com/chmerdon/ExtendableFEM.jl to https://github.com/WIAS-PDELib/ExtendableFEM.jl.
Moved repository from https://github.com/chmerdon/ExtendableFEM.jl to https://github.com/WIAS-PDELib/ExtendableFEM.jl.
[WIAS-PDELib](https://github.com/WIAS-PDELib/) is a github organization created to collectively manage the Julia packages developed under
the lead of the [WIAS Numerical Mathematics and Scientific Computing](https://wias-berlin.de/research/rgs/fg3) research group.
According to the [github docs on repository transfer](https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository#whats-transferred-with-a-repository),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function f!(fval, qpinfo)
end
assign_operator!(PD, LinearOperator(f!, [id(u)]))

# assing boundary data (here: u = 0)
# assign boundary data (here: u = 0)
assign_operator!(PD, HomogeneousBoundaryData(u; regions = 1:4))

# discretise = choose FESpace
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The examples have been designed with the following issues in mind:

## Running the examples

In order to run `ExampleXXX`, peform the following steps:
In order to run `ExampleXXX`, perform the following steps:

- Download the example file (e.g. via the source code link at the top)
- Make sure all used packages are installed in your Julia environment
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ calculate quantities of interest or plot components.
## Gradient-robustness

This package offers some ingredients to build gradient-robust schemes via reconstruction operators or divergence-free elements.
Gradient-robustness is a feature of discretisations that exactly balance gradient forces in the momentum balance. In the case of the incompressible Navier--Stokes equations this means that the discrete velocity does not depend on the exact pressure. Divergence-free finite element methods have this property but are usually expensive and difficult to contruct. However, also non-divergence-free classical finite element methods can be made pressure-robust with the help of reconstruction operators applied to testfunctions in certain terms of the momentum balance, see e.g. references [1,2] below.
Gradient-robustness is a feature of discretisations that exactly balances gradient forces in the momentum balance. In the case of the incompressible Navier--Stokes equations this means that the discrete velocity does not depend on the exact pressure. Divergence-free finite element methods have this property but are usually expensive and difficult to construct. However, also non-divergence-free classical finite element methods can be made pressure-robust with the help of reconstruction operators applied to testfunctions in certain terms of the momentum balance, see e.g. references [1,2] below.

Recently gradient-robustness was also connected to the design of well-balanced schemes e.g. in the context of (nearly) compressible flows, see e.g. reference [3] below.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/nonlinearoperator.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ components of ``u=(u_1,u_2)'`` and the four components of the gradient
``\nabla u = \begin{pmatrix} u_{11} & u_{12} \\ u_{21} & u_{22}\end{pmatrix}``
in order, i.e. ``(u_1,u_2,u_{11},u_{12},u_{21},u_{22})``.
As the convection term is tested with ``v``,
the ouptut vector ``o`` only has to contain what should be tested with each component
the output vector ``o`` only has to contain what should be tested with each component
of ``v``, i.e.
```math
\begin{equation}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pdesolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ residual

The type of fixed-point algorithm depends on the discretisation of the nonlinearities. If all
of them are assembled as a NonlinearOperator, this will result in a Newton scheme
(which can be somewhat costumized via the keywords arguments like damping). If all nonlinearities
(which can be somewhat customized via the keywords arguments like damping). If all nonlinearities
are linearized by LinearOperator and BilinearOperator, this will result in other types of
fixed-point iterations.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pdesolvers_dt.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ and Example205 (Heat equation).

## Using SciMLBase.ODEProblem and DifferentialEquations.jl

It is possible to reframe the ProblemDescription for the spacial differential operator of the PDE
It is possible to reframe the ProblemDescription for the spatial differential operator of the PDE
as the right-hand side of an ODEProblem. Here, the ProblemDescription contains
the right-hand side description of the ODE
```math
\begin{aligned}
M u_t(t) & = b(u(t)) - A(u(t)) u(t)
\end{aligned}
```
where A and b correspond to the assembled (linearized) spacial operator and the right-hand side operators
where A and b correspond to the assembled (linearized) spatial operator and the right-hand side operators
in the ProblemDescription. Note, that A comes with a minus sign. The matrix M is the mass matrix
and can be customized somewhat (as long as it stays constant). The operators in the ProblemDescription
might depend on time (if their kernels use qpinfo.time) and will be reassembled in each time step. To avoid
Expand Down
2 changes: 1 addition & 1 deletion docs/src/problemdescription.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The three most important operator classes are:
- BilinearOperator (e.g. the Laplacian in a Poisson problem)
- LinearOperator (e.g. the right-hand side in a Poisson or Navier-Stokes problem)

To assing boundary conditions or global constraints there are three possibilities:
To assign boundary conditions or global constraints there are three possibilities:
- InterpolateBoundaryData
- HomogeneousData
- FixDofs
Expand Down
2 changes: 1 addition & 1 deletion examples/Example105_NonlinearPoissonEquation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function boundary_data!(result, qpinfo)
result[1] = qpinfo.x[1]
end

## kernel for the (nonlinear) reaction-convection-diffusion oeprator
## kernel for the (nonlinear) reaction-convection-diffusion operator
function nonlinear_kernel!(result, input, qpinfo)
u, ∇u, ϵ = input[1], input[2], qpinfo.params[1]
result[1] = exp(u) - exp(-u)
Expand Down
2 changes: 1 addition & 1 deletion examples/Example108_RobinBoundaryCondition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function u!(result, qpinfo)
result[1] = exp(qpinfo.x[1])
end

## kernel for the (nonlinear) reaction-convection-diffusion oeprator
## kernel for the (nonlinear) reaction-convection-diffusion operator
function nonlinear_kernel!(result, input, qpinfo)
u, ∇u = input[1], input[2]
result[1] = u * ∇u + u # convection + reaction (will be multiplied with v)
Expand Down
2 changes: 1 addition & 1 deletion examples/Example235_StokesIteratedPenalty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Given intermediate solutions ``\mathbf{u}_h`` and ``p_h`` the next approximation
```
This is done consecutively until the residual of both equations is small enough.
The discrete divergence is computed via a RT0 reconstruction operator that preserves the disrete divergence.
The discrete divergence is computed via a RT0 reconstruction operator that preserves the discrete divergence.
(another way would be to compute ``B M^{-1} B^T`` where ``M`` is the mass matrix of the pressure and ``B`` is the matrix for the div-pressure block).
!!! reference
Expand Down
2 changes: 1 addition & 1 deletion examples/Example245_NSEFlowAroundCylinder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function get_draglift(sol::FEVector, μ; parallel = false, kwargs...)
end
end

## drag lift calcuation by testfunctions
## drag lift calculation by testfunctions
function draglift_kernel(result, input, qpinfo)
## input = [ u, grad(u), p , v , grad(v)]
## [1:2, 3:6, 7 ,8:9, 10:13 ]
Expand Down
4 changes: 2 additions & 2 deletions examples/Example265_FlowTransport.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ upwind discretisation ensures mass conservation.
Note, that the transport equation is very convection-dominated and no stabilisation in the finite element discretisations was used here (but instead a nonzero ``\kappa``).
Also note, that only the finite volume discretisation perfectly obeys the maximum principle for the concentration but the isolines do no stay
parallel until the outlet is reached, possibly due to articifial diffusion.
parallel until the outlet is reached, possibly due to artificial diffusion.
The computed solution for the default parameters looks like this:
Expand Down Expand Up @@ -129,7 +129,7 @@ function main(; nrefs = 4, Plotter = nothing, reconstruct = true, FVtransport =
sol = solve(PD; init = sol, kwargs...)
sol = solve(PDT; init = sol, maxiterations = 20, target_residual = 1e-12, constant_matrix = true, kwargs...)

## print minimal and maximal concentration to check max principle (shoule be in [0,1])
## print minimal and maximal concentration to check max principle (should be in [0,1])
println("\n[min(c),max(c)] = [$(minimum(view(sol[T]))),$(maximum(view(sol[T])))]")

## plot
Expand Down
2 changes: 1 addition & 1 deletion examples/Example280_CompressibleStokes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function main(;
SC2 = SolverConfiguration(PDT; init = sol, maxiterations = 1, target_residual = target_residual, kwargs...)
sol, nits = iterate_until_stationarity([SC1, SC2]; energy_integrator = EnergyIntegrator, maxsteps = maxsteps, init = sol, kwargs...)

## caculate error
## calculate error
error = evaluate(ErrorIntegratorExact, sol)
Results[lvl,1] = sqrt(sum(view(error,1,:)) + sum(view(error,2,:)))
Results[lvl,2] = sqrt(sum(view(error,3,:)) + sum(view(error,4,:)) + sum(view(error,5,:)) + sum(view(error,6,:)))
Expand Down
2 changes: 1 addition & 1 deletion examples/Example282_IncompressibleMHD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 282 : Incompressible MHD
([source code](@__SOURCE_URL__))
This example yields a prototype for te stationary incompressible viscious MHD equations that seek
This example yields a prototype for the stationary incompressible viscous MHD equations that seek
a velocity field ``\mathbf{u}``, a pressure field ``p`` and a divergence-free magnetic field ``\mathbf{B}`` such that
```math
\begin{aligned}
Expand Down
2 changes: 1 addition & 1 deletion examples/Example290_PoroElasticity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ As a test problem the first benchmark problem from the same reference is used.
"A study of two modes of locking in poroelasticity",\
S.-Y. Yi,\
SIAM J. Numer. Anal. 55(4) (2017),\
SIAM J. Num. Anal. 55(4) (2017),\
[>Journal-Link<](https://epubs.siam.org/doi/10.1137/16M1056109)
The computed solution for the default parameters looks like this:
Expand Down
2 changes: 1 addition & 1 deletion examples/Example310_DivFreeBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function main(;
sol = solve(PD, FES)
end

## evalute error
## evaluate error
error = evaluate(ErrorIntegratorExact, sol)
L2error[lvl] = sqrt(sum(view(error, 1, :)) + sum(view(error, 2, :)))
if divfree_basis
Expand Down
2 changes: 1 addition & 1 deletion src/common_operators/bilinear_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ default_blfop_kwargs() = Dict{Symbol, Tuple{Any, String}}(
:params => (nothing, "array of parameters that should be made available in qpinfo argument of kernel function"),
:entry_tolerance => (0, "threshold to add entry to sparse matrix"),
:use_sparsity_pattern => ("auto", "read sparsity pattern of jacobian of kernel to find out which components couple"),
:parallel_groups => (false, "assemble operator in parallel using CellAssemblyGroups (assembles seperated matrices that are added together sequantially)"),
:parallel_groups => (false, "assemble operator in parallel using CellAssemblyGroups (assembles separated matrices that are added together sequantially)"),
:parallel => (false, "assemble operator in parallel using colors/partitions information (assembles into full matrix directly)"),
:time_dependent => (false, "operator is time-dependent ?"),
:store => (false, "store matrix separately (and copy from there when reassembly is triggered)"),
Expand Down
2 changes: 1 addition & 1 deletion src/common_operators/bilinear_operator_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ default_blfopdg_kwargs() = Dict{Symbol, Tuple{Any, String}}(
:params => (nothing, "array of parameters that should be made available in qpinfo argument of kernel function"),
:entry_tolerance => (0, "threshold to add entry to sparse matrix"),
:use_sparsity_pattern => ("auto", "read sparsity pattern of jacobian of kernel to find out which components couple"),
:parallel_groups => (false, "assemble operator in parallel using CellAssemblyGroups (assembles seperated matrices that are added together sequantially)"),
:parallel_groups => (false, "assemble operator in parallel using CellAssemblyGroups (assembles separated matrices that are added together sequantially)"),
:parallel => (false, "assemble operator in parallel using colors/partitions information (assembles into full matrix directly)"),
:time_dependent => (false, "operator is time-dependent ?"),
:callback! => (nothing, "function with interface (A, b, sol) that is called in each assembly step"),
Expand Down
4 changes: 2 additions & 2 deletions src/common_operators/homogeneousdata_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ end
function apply!(U::FEVectorBlock, O::HomogeneousData; offset = 0, kwargs...)
bdofs = O.bdofs
value = O.parameters[:value]
UE = U.entries
UE[bdofs] .= value
Uentries = U.entries
Uentries[bdofs] .= value
end


Expand Down
2 changes: 1 addition & 1 deletion src/common_operators/interpolateboundarydata_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end
fixed_dofs(O::InterpolateBoundaryData)
````
returns the fixed degress of freedoms of O
returns the fixed degrees of freedoms of O
"""
fixed_dofs(O::InterpolateBoundaryData) = O.bdofs

Expand Down
2 changes: 1 addition & 1 deletion src/common_operators/linear_operator_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function LinearOperatorDG(
````
Generates a nonlinear linear form that evaluates a kernel function
that depends on the (discontinous) operator evaluations of the current solution.
that depends on the (discontinuous) operator evaluations of the current solution.
The result of the kernel function is used in a vector product with the operator evaluation(s)
of the test function(s). Hence, this can be used as a linearization of a
nonlinear operator. The header of the kernel functions needs to be conform
Expand Down
4 changes: 2 additions & 2 deletions src/common_operators/nonlinear_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ default_nlop_kwargs() = Dict{Symbol, Tuple{Any, String}}(
:bonus_quadorder => (0, "additional quadrature order added to quadorder"),
:entities => (ON_CELLS, "assemble operator on these grid entities (default = ON_CELLS)"),
:entry_tolerance => (0, "threshold to add entry to sparse matrix"),
:extra_inputsize => (0, "additional entries in input vector (e.g. for type-stable storage for intermediate resutls)"),
:extra_inputsize => (0, "additional entries in input vector (e.g. for type-stable storage for intermediate results)"),
:factor => (1, "factor that should be multiplied during assembly"),
:name => ("NonlinearOperator", "name for operator used in printouts"),
:parallel_groups => (false, "assemble operator in parallel using CellAssemblyGroups (assembles seperated matrices that are added together sequantially)"),
:parallel_groups => (false, "assemble operator in parallel using CellAssemblyGroups (assembles separated matrices that are added together sequantially)"),
:parallel => (false, "assemble operator in parallel using colors/partitions information (assembles into full matrix directly)"),
:params => (nothing, "array of parameters that should be made available in qpinfo argument of kernel function"),
:quadorder => ("auto", "quadrature order"),
Expand Down
16 changes: 8 additions & 8 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ end

"""
````
function print_convergencehistory(X, Y; X_to_h = X -> X, ylabels = [], xlabel = "ndofs", latex_mode = false, seperator = latex_mode ? "&" : "|", order_seperator = latex_mode ? "&" : "")
function print_convergencehistory(X, Y; X_to_h = X -> X, ylabels = [], xlabel = "ndofs", latex_mode = false, separator = latex_mode ? "&" : "|", order_seperator = latex_mode ? "&" : "")
````
Prints a convergence history based on arrays X vs. Y.
"""
function print_convergencehistory(X, Y; X_to_h = X -> X, ylabels = [], xlabel = "ndofs", latex_mode = false, seperator = latex_mode ? "&" : "|", order_seperator = latex_mode ? "&" : "")
function print_convergencehistory(X, Y; X_to_h = X -> X, ylabels = [], xlabel = "ndofs", latex_mode = false, separator = latex_mode ? "&" : "|", order_seperator = latex_mode ? "&" : "")
xlabel = center_string(xlabel, 12)
if latex_mode
tabular_argument = "c"
Expand All @@ -54,15 +54,15 @@ function print_convergencehistory(X, Y; X_to_h = X -> X, ylabels = [], xlabel =
end
@printf("\\begin{tabular}{%s}", tabular_argument)
end
@printf("\n%s%s", xlabel, seperator)
@printf("\n%s%s", xlabel, separator)
for j 1:size(Y, 2)
if length(ylabels) < j
push!(ylabels, "DATA $j")
end
if j == size(Y, 2)
@printf("%s %s order %s", center_string(ylabels[j], 18), order_seperator, latex_mode ? "" : seperator)
@printf("%s %s order %s", center_string(ylabels[j], 18), order_seperator, latex_mode ? "" : separator)
else
@printf("%s %s order %s", center_string(ylabels[j], 18), order_seperator, seperator)
@printf("%s %s order %s", center_string(ylabels[j], 18), order_seperator, separator)
end
end
@printf("\n")
Expand All @@ -77,15 +77,15 @@ function print_convergencehistory(X, Y; X_to_h = X -> X, ylabels = [], xlabel =
@printf("\n")
order = 0
for j 1:length(X)
@printf(" %7d %s", X[j], seperator)
@printf(" %7d %s", X[j], separator)
for k 1:size(Y, 2)
if j > 1
order = -log(Y[j-1, k] / Y[j, k]) / (log(X_to_h(X[j]) / X_to_h(X[j-1])))
end
if k == size(Y, 2)
@printf(" %.3e %s %.2f %s", Y[j, k], order_seperator, order, latex_mode ? "" : seperator)
@printf(" %.3e %s %.2f %s", Y[j, k], order_seperator, order, latex_mode ? "" : separator)
else
@printf(" %.3e %s %.2f %s", Y[j, k], order_seperator, order, seperator)
@printf(" %.3e %s %.2f %s", Y[j, k], order_seperator, order, separator)
end
end
if latex_mode
Expand Down
2 changes: 1 addition & 1 deletion src/solver_config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ default_solver_kwargs() = Dict{Symbol, Tuple{Any, String}}(
:constant_matrix => (false, "matrix is constant (skips reassembly and refactorization in solver)"),
:constant_rhs => (false, "right-hand side is constant (skips reassembly)"),
:method_linear => (UMFPACKFactorization(), "any solver or custom LinearSolveFunction compatible with LinearSolve.jl (default = UMFPACKFactorization())"),
:precon_linear => (nothing, "function that computes preconditioner for method_linear incase an iterative solver is chosen"),
:precon_linear => (nothing, "function that computes preconditioner for method_linear in case an iterative solver is chosen"),
:initialized => (false, "linear system in solver configuration is already assembled (turns true after first solve)"),
:plot => (false, "plot all solved unknowns with a (very rough but fast) unicode plot"),
)
Expand Down
2 changes: 1 addition & 1 deletion src/solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function iterate_until_stationarity(
````
Iterates consecutively over all SolverConfigurations
(each contains the ProblemDescription of the corressponding subproblem)
(each contains the ProblemDescription of the corresponding subproblem)
until the residuals of all subproblems are below their tolerances
and returns the solution of the combined unknowns of all subproblems.
The additional argument maxsteps limits the number of these iterations
Expand Down
2 changes: 1 addition & 1 deletion src/unknowns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
struct Unknown
````
Structure holding information for an unknwon with the following fields:
Structure holding information for an unknown with the following fields:
$(TYPEDFIELDS)
"""
Expand Down

0 comments on commit 6d23969

Please sign in to comment.