Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
Signed-off-by: ErikQQY <[email protected]>
  • Loading branch information
ErikQQY committed Apr 20, 2024
1 parent 14762c0 commit ae3ac8c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/problems/bvp_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ $(TYPEDEF)
"""
struct TwoPointSecondOrderBVProblem{iip} end # The iip is needed to make type stable construction easier


@doc doc"""
Defines a second order BVP problem.
Expand Down Expand Up @@ -361,7 +360,7 @@ struct SecondOrderBVProblem{uType, tType, isinplace, nlls, P, F, PT, K} <:
_u0 = prepare_initial_state(u0)
_tspan = promote_tspan(tspan)
warn_paramtype(p)

return new{typeof(_u0), typeof(_tspan), iip, typeof(nlls), typeof(p), typeof(f),
typeof(problem_type), typeof(kwargs)}(f, _u0, _tspan, p, problem_type, kwargs)
end
Expand Down Expand Up @@ -396,15 +395,18 @@ end

function TwoPointSecondOrderBVProblem{iip}(f, bc, u0, tspan, p = NullParameters();

Check warning on line 396 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L396

Added line #L396 was not covered by tests
bcresid_prototype = nothing, kwargs...) where {iip}
return TwoPointSecondOrderBVProblem(TwoPointDynamicalBVPFunction{iip}(f, bc; bcresid_prototype), u0, tspan,
return TwoPointSecondOrderBVProblem(

Check warning on line 398 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L398

Added line #L398 was not covered by tests
TwoPointDynamicalBVPFunction{iip}(f, bc; bcresid_prototype), u0, tspan,
p; kwargs...)
end
function TwoPointSecondOrderBVProblem(f, bc, u0, tspan, p = NullParameters();

Check warning on line 402 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L402

Added line #L402 was not covered by tests
bcresid_prototype = nothing, kwargs...)
return TwoPointSecondOrderBVProblem(TwoPointDynamicalBVPFunction(f, bc; bcresid_prototype), u0, tspan, p;
return TwoPointSecondOrderBVProblem(

Check warning on line 404 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L404

Added line #L404 was not covered by tests
TwoPointDynamicalBVPFunction(f, bc; bcresid_prototype), u0, tspan, p;
kwargs...)
end
function TwoPointSecondOrderBVProblem{iip}(f::AbstractBVPFunction{iip, twopoint}, u0, tspan,
function TwoPointSecondOrderBVProblem{iip}(

Check warning on line 408 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L408

Added line #L408 was not covered by tests
f::AbstractBVPFunction{iip, twopoint}, u0, tspan,
p = NullParameters(); kwargs...) where {iip, twopoint}
@assert twopoint "`TwoPointSecondOrderBVProblem` can only be used with a `TwoPointDynamicalBVPFunction`. Instead of using `DynamicalBVPFunction`, use `TwoPointDynamicalBVPFunction` or pass a kwarg `twopoint=Val(true)` during the construction of the `DynamicalBVPFunction`."
return SecondOrderBVProblem{iip}(f, u0, tspan, p; kwargs...)

Check warning on line 412 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L411-L412

Added lines #L411 - L412 were not covered by tests
Expand All @@ -421,8 +423,9 @@ function TwoPointSecondOrderBVProblem(f::AbstractODEFunction, bc, sol::T, tspan:
return TwoPointSecondOrderBVProblem(f, bc, sol.u, tspan, p; kwargs...)

Check warning on line 423 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L423

Added line #L423 was not covered by tests
end
# Allow initial guess function for the initial guess
function TwoPointSecondOrderBVProblem(f::AbstractODEFunction, bc, initialGuess, tspan::AbstractVector,
function TwoPointSecondOrderBVProblem(

Check warning on line 426 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L426

Added line #L426 was not covered by tests
f::AbstractODEFunction, bc, initialGuess, tspan::AbstractVector,
p = NullParameters(); kwargs...)
u0 = [initialGuess(i) for i in tspan]
return TwoPointSecondOrderBVProblem(f, bc, u0, (tspan[1], tspan[end]), p; kwargs...)

Check warning on line 430 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L429-L430

Added lines #L429 - L430 were not covered by tests
end
end

0 comments on commit ae3ac8c

Please sign in to comment.