Skip to content

Commit c1e997a

Browse files
committed
fix issue with the domain constructors on Julia 1.6
Removes Parameters.jl macros and unused defaults allowing the primary constructors to work properly
1 parent 57a4ec3 commit c1e997a

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

src/Domain.jl

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export AbstractConstantKDomain
1616
abstract type AbstractVariableKDomain <: AbstractDomain end
1717
export AbstractVariableKDomain
1818

19-
@with_kw mutable struct ConstantTPDomain{N<:AbstractPhase,S<:Integer,W<:Real, W2<:Real, I<:Integer, Q<:AbstractArray} <: AbstractConstantKDomain
19+
mutable struct ConstantTPDomain{N<:AbstractPhase,S<:Integer,W<:Real, W2<:Real, I<:Integer, Q<:AbstractArray} <: AbstractConstantKDomain
2020
phase::N
2121
indexes::Q #assumed to be in ascending order
2222
parameterindexes::Q
@@ -28,16 +28,17 @@ export AbstractVariableKDomain
2828
efficiencyinds::Array{I,1}
2929
Gs::Array{W,1}
3030
rxnarray::Array{Int64,2}
31-
mu::W = 0.0
32-
diffusivity::Array{W,1} = Array{Float64,1}()
33-
jacobian::Array{W,2} = Array{Float64,2}(undef,(0,0))
34-
sensitivity::Bool = false
35-
alternativepformat::Bool=false
36-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
37-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
31+
mu::W
32+
diffusivity::Array{W,1}
33+
jacobian::Array{W,2}
34+
sensitivity::Bool
35+
alternativepformat::Bool
36+
jacuptodate::MArray{Tuple{1},Bool,1,1}
37+
t::MArray{Tuple{1},W2,1,1}
3838
p::Array{W,1}
3939
thermovariabledict::Dict{String,Int64}
4040
end
41+
4142
function ConstantTPDomain(;phase::E2,initialconds::Dict{X,X2},constantspecies::Array{X3,1}=Array{String,1}(),
4243
sparse::Bool=false,sensitivity::Bool=false) where {E<:Real,E2<:AbstractPhase,Q<:AbstractInterface,W<:Real,X,X2,X3}
4344
#set conditions and initialconditions
@@ -101,7 +102,7 @@ function ConstantTPDomain(;phase::E2,initialconds::Dict{X,X2},constantspecies::A
101102
end
102103
export ConstantTPDomain
103104

104-
@with_kw struct ConstantVDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
105+
struct ConstantVDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
105106
phase::N
106107
indexes::Q #assumed to be in ascending order
107108
parameterindexes::Q
@@ -110,9 +111,9 @@ export ConstantTPDomain
110111
efficiencyinds::Array{I,1}
111112
rxnarray::Array{Int64,2}
112113
jacobian::Array{W,2}
113-
sensitivity::Bool = false
114-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
115-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
114+
sensitivity::Bool
115+
jacuptodate::MArray{Tuple{1},Bool,1,1}
116+
t::MArray{Tuple{1},W2,1,1}
116117
p::Array{W,1}
117118
thermovariabledict::Dict{String,Int64}
118119
end
@@ -169,7 +170,7 @@ function ConstantVDomain(;phase::Z,initialconds::Dict{X,E},constantspecies::Arra
169170
end
170171
export ConstantVDomain
171172

172-
@with_kw struct ConstantPDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
173+
struct ConstantPDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
173174
phase::N
174175
indexes::Q #assumed to be in ascending order
175176
parameterindexes::Q
@@ -178,9 +179,9 @@ export ConstantVDomain
178179
efficiencyinds::Array{I,1}
179180
rxnarray::Array{Int64,2}
180181
jacobian::Array{W,2}
181-
sensitivity::Bool = false
182-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
183-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
182+
sensitivity::Bool
183+
jacuptodate::MArray{Tuple{1},Bool,1,1}
184+
t::MArray{Tuple{1},W2,1,1}
184185
p::Array{W,1}
185186
thermovariabledict::Dict{String,Int64}
186187
end
@@ -237,7 +238,7 @@ function ConstantPDomain(;phase::Z,initialconds::Dict{X,E},constantspecies::Arra
237238
end
238239
export ConstantPDomain
239240

240-
@with_kw struct ParametrizedTPDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
241+
struct ParametrizedTPDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
241242
phase::N
242243
indexes::Q #assumed to be in ascending order
243244
parameterindexes::Q
@@ -247,9 +248,9 @@ export ConstantPDomain
247248
efficiencyinds::Array{I,1}
248249
rxnarray::Array{Int64,2}
249250
jacobian::Array{W,2}
250-
sensitivity::Bool = false
251-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
252-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
251+
sensitivity::Bool
252+
jacuptodate::MArray{Tuple{1},Bool,1,1}
253+
t::MArray{Tuple{1},W2,1,1}
253254
p::Array{W,1}
254255
thermovariabledict::Dict{String,Int64}
255256
end
@@ -318,7 +319,7 @@ function ParametrizedTPDomain(;phase::Z,initialconds::Dict{X,Any},constantspecie
318319
end
319320
export ParametrizedTPDomain
320321

321-
@with_kw struct ParametrizedVDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
322+
struct ParametrizedVDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
322323
phase::N
323324
indexes::Q #assumed to be in ascending order
324325
parameterindexes::Q
@@ -327,9 +328,9 @@ export ParametrizedTPDomain
327328
efficiencyinds::Array{I,1}
328329
rxnarray::Array{Int64,2}
329330
jacobian::Array{W,2}
330-
sensitivity::Bool = false
331-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
332-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
331+
sensitivity::Bool
332+
jacuptodate::MArray{Tuple{1},Bool,1,1}
333+
t::MArray{Tuple{1},W2,1,1}
333334
p::Array{W,1}
334335
thermovariabledict::Dict{String,Int64}
335336
end
@@ -395,7 +396,7 @@ function ParametrizedVDomain(;phase::Z,initialconds::Dict{X,Any},constantspecies
395396
end
396397
export ParametrizedVDomain
397398

398-
@with_kw struct ParametrizedPDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
399+
struct ParametrizedPDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
399400
phase::N
400401
indexes::Q #assumed to be in ascending order
401402
parameterindexes::Q
@@ -404,9 +405,9 @@ export ParametrizedVDomain
404405
efficiencyinds::Array{I,1}
405406
rxnarray::Array{Int64,2}
406407
jacobian::Array{W,2}
407-
sensitivity::Bool = false
408-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
409-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
408+
sensitivity::Bool
409+
jacuptodate::MArray{Tuple{1},Bool,1,1}
410+
t::MArray{Tuple{1},W2,1,1}
410411
p::Array{W,1}
411412
thermovariabledict::Dict{String,Int64}
412413
end
@@ -472,7 +473,7 @@ function ParametrizedPDomain(;phase::Z,initialconds::Dict{X,Any},constantspecies
472473
end
473474
export ParametrizedPDomain
474475

475-
@with_kw mutable struct ConstantTVDomain{N<:AbstractPhase,S<:Integer,W<:Real, W2<:Real, I<:Integer, Q<:AbstractArray} <: AbstractConstantKDomain
476+
mutable struct ConstantTVDomain{N<:AbstractPhase,S<:Integer,W<:Real, W2<:Real, I<:Integer, Q<:AbstractArray} <: AbstractConstantKDomain
476477
phase::N
477478
indexes::Q #assumed to be in ascending order
478479
parameterindexes::Q
@@ -485,13 +486,13 @@ export ParametrizedPDomain
485486
efficiencyinds::Array{I,1}
486487
Gs::Array{W,1}
487488
rxnarray::Array{Int64,2}
488-
mu::W = 0.0
489-
diffusivity::Array{W,1} = Array{Float64,1}()
490-
jacobian::Array{W,2} = Array{Float64,2}(undef,(0,0))
491-
sensitivity::Bool = false
492-
alternativepformat::Bool=false
493-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
494-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
489+
mu::W
490+
diffusivity::Array{W,1}
491+
jacobian::Array{W,2}
492+
sensitivity::Bool
493+
alternativepformat::Bool
494+
jacuptodate::MArray{Tuple{1},Bool,1,1}
495+
t::MArray{Tuple{1},W2,1,1}
495496
p::Array{W,1}
496497
thermovariabledict::Dict{String,Int64}
497498
end
@@ -555,7 +556,7 @@ function ConstantTVDomain(;phase::Z,initialconds::Dict{X,E},constantspecies::Arr
555556
end
556557
export ConstantTVDomain
557558

558-
@with_kw struct ParametrizedTConstantVDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
559+
struct ParametrizedTConstantVDomain{N<:AbstractPhase,S<:Integer,W<:Real,W2<:Real,I<:Integer,Q<:AbstractArray} <: AbstractVariableKDomain
559560
phase::N
560561
indexes::Q #assumed to be in ascending order
561562
parameterindexes::Q
@@ -565,9 +566,9 @@ export ConstantTVDomain
565566
efficiencyinds::Array{I,1}
566567
rxnarray::Array{Int64,2}
567568
jacobian::Array{W,2}
568-
sensitivity::Bool = false
569-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
570-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
569+
sensitivity::Bool
570+
jacuptodate::MArray{Tuple{1},Bool,1,1}
571+
t::MArray{Tuple{1},W2,1,1}
571572
p::Array{W,1}
572573
thermovariabledict::Dict{String,Int64}
573574
end
@@ -625,7 +626,7 @@ function ParametrizedTConstantVDomain(;phase::IdealDiluteSolution,initialconds::
625626
end
626627
export ParametrizedTConstantVDomain
627628

628-
@with_kw mutable struct ConstantTAPhiDomain{N<:AbstractPhase,S<:Integer,W<:Real, W2<:Real, I<:Integer, Q<:AbstractArray} <: AbstractConstantKDomain
629+
mutable struct ConstantTAPhiDomain{N<:AbstractPhase,S<:Integer,W<:Real, W2<:Real, I<:Integer, Q<:AbstractArray} <: AbstractConstantKDomain
629630
phase::N
630631
indexes::Q #assumed to be in ascending order
631632
parameterindexes::Q
@@ -638,13 +639,13 @@ export ParametrizedTConstantVDomain
638639
efficiencyinds::Array{I,1}
639640
Gs::Array{W,1}
640641
rxnarray::Array{Int64,2}
641-
mu::W = 0.0
642-
diffusivity::Array{W,1} = Array{Float64,1}()
643-
jacobian::Array{W,2} = Array{Float64,2}(undef,(0,0))
644-
sensitivity::Bool = false
645-
alternativepformat::Bool=false
646-
jacuptodate::MArray{Tuple{1},Bool,1,1}=MVector(false)
647-
t::MArray{Tuple{1},W2,1,1}=MVector(0.0)
642+
mu::W
643+
diffusivity::Array{W,1}
644+
jacobian::Array{W,2}
645+
sensitivity::Bool
646+
alternativepformat::Bool
647+
jacuptodate::MArray{Tuple{1},Bool,1,1}
648+
t::MArray{Tuple{1},W2,1,1}
648649
p::Array{W,1}
649650
thermovariabledict::Dict{String,Int64}
650651
end

0 commit comments

Comments
 (0)