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

Add iscomplex type param to PDESolutions #361

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions src/solutions/pde_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Solution to a PDE, solved from an ODEProblem generated by a discretizer.
exited due to an error. For more details, see
[the return code documentation](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes).
"""
struct PDETimeSeriesSolution{T, N, uType, Disc, Sol, DType, tType, domType, ivType, dvType,
struct PDETimeSeriesSolution{T, N, uType, Disc, isCpx, Sol, DType, tType, domType, ivType, dvType,
P, A,
IType} <: AbstractPDETimeSeriesSolution{T, N, uType, Disc}
u::uType
Expand Down Expand Up @@ -77,7 +77,7 @@ Solution to a PDE, solved from an NonlinearProblem generated by a discretizer.
callback (`sol.retcode === ReturnCode.Terminated`), or whether it exited due to an error. For more
details, see the return code section of the ODEProblem.jl documentation.
"""
struct PDENoTimeSolution{T, N, uType, Disc, Sol, domType, ivType, dvType, P, A,
struct PDENoTimeSolution{T, N, uType, Disc, isCpx, Sol, domType, ivType, dvType, P, A,
IType} <: AbstractPDENoTimeSolution{T, N, uType, Disc}
u::uType
original_sol::Sol
Expand Down Expand Up @@ -115,6 +115,10 @@ function SciMLBase.wrap_sol(sol,
end
end

iscomplex(sol::PDETimeSeriesSolution{T, N, U, D, C}) where {T, N, U, D, C} = C <: Val{true} ? true : false
iscomplex(sol::PDENoTimeSolution{T, N, U, D, C}) where {T, N, U, D, C} = C <: Val{true} ? true : false


function Base.show(io::IO, m::MIME"text/plain", A::PDETimeSeriesSolution)
println(io, string("retcode: ", A.retcode))
println(io, string("Interpolation: "), typeof(A.interp))
Expand Down