diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..e7bd87b4 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,2 @@ +[codespell] +ignore-words-list = missings,rcall,linke,fo diff --git a/CHANGELOG.md b/CHANGELOG.md index bde1d5a7..9abc4801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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), diff --git a/README.md b/README.md index 8fdf5446..c260a83b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/src/examples_intro.md b/docs/src/examples_intro.md index 4e616dbe..52e9396b 100644 --- a/docs/src/examples_intro.md +++ b/docs/src/examples_intro.md @@ -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 diff --git a/docs/src/index.md b/docs/src/index.md index ec06006e..7be1f6e0 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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. diff --git a/docs/src/nonlinearoperator.md b/docs/src/nonlinearoperator.md index 2b68662b..7c8ac29d 100644 --- a/docs/src/nonlinearoperator.md +++ b/docs/src/nonlinearoperator.md @@ -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} diff --git a/docs/src/pdesolvers.md b/docs/src/pdesolvers.md index 7c6777fe..c5efdf01 100644 --- a/docs/src/pdesolvers.md +++ b/docs/src/pdesolvers.md @@ -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. diff --git a/docs/src/pdesolvers_dt.md b/docs/src/pdesolvers_dt.md index c862863b..dfef667c 100644 --- a/docs/src/pdesolvers_dt.md +++ b/docs/src/pdesolvers_dt.md @@ -10,7 +10,7 @@ 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 @@ -18,7 +18,7 @@ the right-hand side description of the ODE 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 diff --git a/docs/src/problemdescription.md b/docs/src/problemdescription.md index ad984cdd..d43a9116 100644 --- a/docs/src/problemdescription.md +++ b/docs/src/problemdescription.md @@ -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 diff --git a/examples/Example105_NonlinearPoissonEquation.jl b/examples/Example105_NonlinearPoissonEquation.jl index 7af3905b..24143472 100644 --- a/examples/Example105_NonlinearPoissonEquation.jl +++ b/examples/Example105_NonlinearPoissonEquation.jl @@ -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) diff --git a/examples/Example108_RobinBoundaryCondition.jl b/examples/Example108_RobinBoundaryCondition.jl index 67262709..d48bf4f9 100644 --- a/examples/Example108_RobinBoundaryCondition.jl +++ b/examples/Example108_RobinBoundaryCondition.jl @@ -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) diff --git a/examples/Example235_StokesIteratedPenalty.jl b/examples/Example235_StokesIteratedPenalty.jl index f8f863a8..277e89e8 100644 --- a/examples/Example235_StokesIteratedPenalty.jl +++ b/examples/Example235_StokesIteratedPenalty.jl @@ -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 diff --git a/examples/Example245_NSEFlowAroundCylinder.jl b/examples/Example245_NSEFlowAroundCylinder.jl index 8cfdc280..7d6465ea 100644 --- a/examples/Example245_NSEFlowAroundCylinder.jl +++ b/examples/Example245_NSEFlowAroundCylinder.jl @@ -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 ] diff --git a/examples/Example265_FlowTransport.jl b/examples/Example265_FlowTransport.jl index 01cba6b4..a8ccd698 100644 --- a/examples/Example265_FlowTransport.jl +++ b/examples/Example265_FlowTransport.jl @@ -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: @@ -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 diff --git a/examples/Example280_CompressibleStokes.jl b/examples/Example280_CompressibleStokes.jl index a9a72c31..f486a988 100644 --- a/examples/Example280_CompressibleStokes.jl +++ b/examples/Example280_CompressibleStokes.jl @@ -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,:))) diff --git a/examples/Example282_IncompressibleMHD.jl b/examples/Example282_IncompressibleMHD.jl index 859b7245..5924fe0d 100644 --- a/examples/Example282_IncompressibleMHD.jl +++ b/examples/Example282_IncompressibleMHD.jl @@ -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} diff --git a/examples/Example290_PoroElasticity.jl b/examples/Example290_PoroElasticity.jl index 7cab00e7..dd4ee993 100644 --- a/examples/Example290_PoroElasticity.jl +++ b/examples/Example290_PoroElasticity.jl @@ -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: diff --git a/examples/Example310_DivFreeBasis.jl b/examples/Example310_DivFreeBasis.jl index 9deba7eb..9523b236 100644 --- a/examples/Example310_DivFreeBasis.jl +++ b/examples/Example310_DivFreeBasis.jl @@ -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 diff --git a/src/common_operators/bilinear_operator.jl b/src/common_operators/bilinear_operator.jl index eb642c41..b6b85056 100644 --- a/src/common_operators/bilinear_operator.jl +++ b/src/common_operators/bilinear_operator.jl @@ -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)"), diff --git a/src/common_operators/bilinear_operator_dg.jl b/src/common_operators/bilinear_operator_dg.jl index 827d0add..20a64987 100644 --- a/src/common_operators/bilinear_operator_dg.jl +++ b/src/common_operators/bilinear_operator_dg.jl @@ -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"), diff --git a/src/common_operators/homogeneousdata_operator.jl b/src/common_operators/homogeneousdata_operator.jl index f3d9a1dc..3e28e898 100644 --- a/src/common_operators/homogeneousdata_operator.jl +++ b/src/common_operators/homogeneousdata_operator.jl @@ -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 diff --git a/src/common_operators/interpolateboundarydata_operator.jl b/src/common_operators/interpolateboundarydata_operator.jl index e8a1b3eb..c9d9e302 100644 --- a/src/common_operators/interpolateboundarydata_operator.jl +++ b/src/common_operators/interpolateboundarydata_operator.jl @@ -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 diff --git a/src/common_operators/linear_operator_dg.jl b/src/common_operators/linear_operator_dg.jl index c3b6ece2..be5d12cf 100644 --- a/src/common_operators/linear_operator_dg.jl +++ b/src/common_operators/linear_operator_dg.jl @@ -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 diff --git a/src/common_operators/nonlinear_operator.jl b/src/common_operators/nonlinear_operator.jl index b754c58c..d5d5f792 100644 --- a/src/common_operators/nonlinear_operator.jl +++ b/src/common_operators/nonlinear_operator.jl @@ -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"), diff --git a/src/io.jl b/src/io.jl index baad3bb2..fb2fe67b 100644 --- a/src/io.jl +++ b/src/io.jl @@ -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" @@ -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") @@ -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 diff --git a/src/solver_config.jl b/src/solver_config.jl index 1d60aef2..7eba3831 100644 --- a/src/solver_config.jl +++ b/src/solver_config.jl @@ -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"), ) diff --git a/src/solvers.jl b/src/solvers.jl index 6ad96e41..f3677360 100644 --- a/src/solvers.jl +++ b/src/solvers.jl @@ -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 diff --git a/src/unknowns.jl b/src/unknowns.jl index bb2f7e40..0a2d02ec 100644 --- a/src/unknowns.jl +++ b/src/unknowns.jl @@ -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) """