Skip to content
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
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ version = "1.2.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[compat]
ADTypes = "1"
ExplicitImports = "1"
LinearAlgebra = "1"
OrdinaryDiffEq = "6, 7"
OrdinaryDiffEqSDIRK = "1, 2"
ProgressMeter = "1.2"
PyCall = "1.90"
Requires = "0.5, 1.0"
SafeTestsets = "0.1, 1"
Expand Down
5 changes: 1 addition & 4 deletions src/FEniCS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const mshr = PyCall.PyNULL()

function __init__()
@require PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" include("jplot.jl")
@require ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" begin
using ProgressMeter
end
copy!(fenics, pyimport_conda("fenics", "fenics=2019.1.0", "conda-forge"))
copy!(ufl, pyimport_conda("ufl", "ufl=2019.1.0", "conda-forge"))
include_mshr && copy!(mshr, pyimport_conda("mshr", "mshr=2019.1.0", "conda-forge"))
Expand Down Expand Up @@ -68,7 +65,7 @@ macro fenicsclass(name::Symbol, base1::Symbol = :fenicsobject)
end
)
end
export fenicsclass
export @fenicsclass

@enum LOGLEVEL begin
CRITICAL = 50
Expand Down
2 changes: 1 addition & 1 deletion src/jfem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end
export FunctionSpace, VectorFunctionSpace

@fenicsclass Expression
function Argument(V, number, part::StringOrSymbol = nothing)
function Argument(V, number, part::Union{StringOrSymbol, Nothing} = nothing)
return Expression(fenics.Argument(V.pyobject, number, part = part))
end
TrialFunction(V::FunctionSpace) = Expression(fenics.TrialFunction(V.pyobject))
Expand Down
15 changes: 10 additions & 5 deletions src/jsolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,16 @@ TimeSeries(path::StringOrSymbol) = fenics.TimeSeries(path)
retrieve(timeseries, placeholder, time) = timeseries.retrieve(placeholder, time)
export TimeSeries, retrieve

write(path, solution, time::Number) = path.write(solution.pyobject, time)
write(path, solution::PyObject, time::Number) = path.write(solution, time)

store(path, solution, time::Number) = path.store(solution.pyobject, time)
store(path, solution::PyObject, time::Number) = path.store(solution, time)
# `write` extends `Base.write`. Typing `solution::fenicsobject` keeps this from
# being type piracy (a FEniCS-owned argument), and typing `path::PyObject` (the
# value returned by `XDMFFile`/`TimeSeries`) keeps it from being ambiguous with
# `Base.write(::IO, ...)` / `write(::AbstractString, ...)`. A raw-`PyObject`
# solution is unused; use `store` (a FEniCS-owned function) for raw vectors such
# as `vector(u)`.
write(path::PyObject, solution::fenicsobject, time::Number) = path.write(solution.pyobject, time)

store(path::PyObject, solution, time::Number) = path.store(solution.pyobject, time)
store(path::PyObject, solution::PyObject, time::Number) = path.store(solution, time)

export write, store

Expand Down
8 changes: 3 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ run_tests(;
# body (core.jl) rather than as independent per-file groups, so it is passed
# explicitly instead of being discovered as a folder.
core = joinpath(@__DIR__, "core.jl"),
groups = Dict(
"QA" => (;
env = joinpath(@__DIR__, "qa"),
body = joinpath(@__DIR__, "qa", "qa.jl"),
),
qa = (;
env = joinpath(@__DIR__, "qa"),
body = joinpath(@__DIR__, "qa", "qa.jl"),
),
# The original ran only the Core body for the default GROUP="All"; QA ran only
# when explicitly selected (it exited early before loading FEniCS).
Expand Down
Loading