Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-linear -> nonlinear #223

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Algebra/Algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export allocate_residual
export allocate_jacobian
export allocate_residual_and_jacobian
export zero_initial_guess
export test_non_linear_operator
export test_nonlinear_operator

export NonlinearSolver
export test_non_linear_solver
export test_nonlinear_solver

export NewtonRaphsonSolver
export NLSolver
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/LinearSolvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function test_linear_solver(

op = AffineOperator(A,b)
x0 = copy(x)
test_non_linear_solver(ls,op,x0,x)
test_nonlinear_solver(ls,op,x0,x)

end

Expand Down
5 changes: 2 additions & 3 deletions src/Algebra/NonlinearOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ function allocate_residual_and_jacobian(op::NonlinearOperator,x::AbstractVector)
end

"""
test_non_linear_operator(
test_nonlinear_operator(
op::NonlinearOperator,
x::AbstractVector,
b::AbstractVector,
pred=isapprox;
jac=nothing)
"""
function test_non_linear_operator(
function test_nonlinear_operator(
op::NonlinearOperator,
x::AbstractVector,
b::AbstractVector,
Expand Down Expand Up @@ -173,4 +173,3 @@ function allocate_jacobian(op::NonlinearOperatorMock,x::AbstractVector)
m = 2
zeros(T,n,m)
end

4 changes: 2 additions & 2 deletions src/Algebra/NonlinearSolvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ function solve(nls::NonlinearSolver,op::NonlinearOperator)
end

"""
test_non_linear_solver(
test_nonlinear_solver(
nls::NonlinearSolver,
op::NonlinearOperator,
x0::AbstractVector,
x::AbstractVector,
pred::Function=isapprox)
"""
function test_non_linear_solver(
function test_nonlinear_solver(
nls::NonlinearSolver,
op::NonlinearOperator,
x0::AbstractVector,
Expand Down
3 changes: 1 addition & 2 deletions src/FESpaces/FEOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function test_fe_operator(op::FEOperator,args...;kwargs...)
@test isa(b,AbstractVector)
@test isa(A,AbstractMatrix)
_op = get_algebraic_operator(op)
test_non_linear_operator(_op,args...;kwargs...)
test_nonlinear_operator(_op,args...;kwargs...)
end

# FEOperator viewed as a NonlinearOperator
Expand Down Expand Up @@ -164,4 +164,3 @@ function zero_initial_guess(::Type{T},op::AlgebraicOpFromFEOp) where T
trial = get_trial(op.feop)
x = zero_free_values(T,trial)
end

4 changes: 2 additions & 2 deletions test/AlgebraTests/LinearSolversTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ x = rand(n^2)
b = A*x

op = AffineOperator(A,b)
test_non_linear_operator(op,x,zeros(size(x)),jac=A)
test_nonlinear_operator(op,x,zeros(size(x)),jac=A)

ls = LUSolver()
test_linear_solver(ls,A,b,x)
Expand All @@ -46,6 +46,6 @@ op = AffineOperator(A,b)
@test jacobian(op,x) === op.matrix

solve!(x0,nls,op)
test_non_linear_solver(nls,op,x0,x)
test_nonlinear_solver(nls,op,x0,x)

end # module
4 changes: 2 additions & 2 deletions test/AlgebraTests/NLSolversTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ nls = NLSolver(show_trace=false,method=:newton)

x0 = zero_initial_guess(op)
x = [1.0, 3.0]
test_non_linear_solver(nls,op,x0,x)
test_nonlinear_solver(nls,op,x0,x)

x0 = [2.1,2.9]
x = [2.0, 3.0]
test_non_linear_solver(nls,op,x0,x)
test_nonlinear_solver(nls,op,x0,x)

x0 = zero_initial_guess(op)
cache = solve!(x0,nls,op)
Expand Down
2 changes: 1 addition & 1 deletion test/AlgebraTests/NonlinearOperatorsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ x = [1.0, 3.0]
b = [0.0,0.0]
A = [-1.0 0.0; 0.0 1.0]

test_non_linear_operator(op,x,b,jac=A)
test_nonlinear_operator(op,x,b,jac=A)

@test residual(op,x) ≈ b
@test jacobian(op,x) ≈ A
Expand Down
4 changes: 2 additions & 2 deletions test/AlgebraTests/NonlinearSolversTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ nls = NewtonRaphsonSolver(ls,tol,maxiters)

x0 = zero_initial_guess(op)
x = [1.0, 3.0]
test_non_linear_solver(nls,op,x0,x)
test_nonlinear_solver(nls,op,x0,x)

x0 = [2.1,2.9]
x = [2.0, 3.0]
test_non_linear_solver(nls,op,x0,x)
test_nonlinear_solver(nls,op,x0,x)

end # module