Skip to content

Commit 5a2eed6

Browse files
committed
add constructors and doc strings for verbosity specifiers
1 parent 0329949 commit 5a2eed6

15 files changed

+556
-0
lines changed

src/problems/analytical_problems.jl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,41 @@ struct AnalyticalAliasSpecifier <: AbstractAliasSpecifier
6565
end
6666
end
6767
end
68+
69+
@doc doc"""
70+
71+
Determines what is printed when solving an `AnalyticalProblem`.
72+
73+
### Fields
74+
* `verbosity`
75+
76+
### Constructors
77+
78+
```julia
79+
AnalyticalVerbosity(verbose::Bool): sets all fields to `verbose`
80+
AnalyticalVerbosity(; verbose = nothing): kwarg constructor
81+
AnalyticalVerbosity(::Nothing): uses default options
82+
83+
```
84+
"""
85+
struct AnalyticalVerbosity <: AbstractVerbositySpecifier
86+
verbose::Any
87+
88+
function AnalyticalVerbosity(verbose::Bool)
89+
if verbose
90+
new((true for _ in fieldnames(AnalyticalVerbosity))...)
91+
else
92+
new((false for _ in fieldnames(AnalyticalVerbosity))...)
93+
end
94+
end
95+
96+
AnalyticalVerbosity(verbose) = new(verbose)
97+
end
98+
99+
function AnalyticalVerbosity(; verbose = nothing)
100+
AnalyticalVerbosity(verbose)
101+
end
102+
103+
function AnalyticalVerbosity(::Nothing)
104+
AnalyticalVerbosity(verbose = true)
105+
end

src/problems/bvp_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,40 @@ struct BVPAliasSpecifier <: AbstractAliasSpecifier
474474
end
475475
end
476476
end
477+
478+
@doc doc"""
479+
480+
Determines what is printed when solving a `BVPProblem`.
481+
482+
### Fields
483+
* `verbosity`
484+
485+
### Constructors
486+
487+
```julia
488+
BVPVerbosity(verbose::Bool): sets all fields to `verbose`
489+
BVPVerbosity(; verbose = nothing): kwarg constructor
490+
BVPVerbosity(::Nothing): uses default options
491+
```
492+
"""
493+
struct BVPVerbosity <: AbstractVerbositySpecifier
494+
verbose::Any
495+
496+
function BVPVerbosity(verbose::Bool)
497+
if verbose
498+
new((true for _ in fieldnames(BVPVerbosity))...)
499+
else
500+
new((false for _ in fieldnames(BVPVerbosity))...)
501+
end
502+
end
503+
504+
BVPVerbosity(verbose) = new(verbose)
505+
end
506+
507+
function BVPVerbosity(; verbose = nothing)
508+
BVPVerbosity(verbose)
509+
end
510+
511+
function BVPVerbosity(::Nothing)
512+
BVPVerbosity(verbose = true)
513+
end

src/problems/dae_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,40 @@ struct DAEAliasSpecifier
155155
end
156156
end
157157
end
158+
159+
@doc doc"""
160+
161+
Determines what is printed when solving a `DAEProblem`.
162+
163+
### Fields
164+
* `verbosity`
165+
166+
### Constructors
167+
168+
```julia
169+
DAEVerbosity(verbose::Bool): sets all fields to `verbose`
170+
DAEVerbosity(; verbose = nothing): kwarg constructor
171+
DAEVerbosity(::Nothing): uses default options
172+
```
173+
"""
174+
struct DAEVerbosity <: AbstractVerbositySpecifier
175+
verbose::Any
176+
177+
function DAEVerbosity(verbose::Bool)
178+
if verbose
179+
new((true for _ in fieldnames(DAEVerbosity))...)
180+
else
181+
new((false for _ in fieldnames(DAEVerbosity))...)
182+
end
183+
end
184+
185+
DAEVerbosity(verbose) = new(verbose)
186+
end
187+
188+
function DAEVerbosity(; verbose = nothing)
189+
DAEVerbosity(verbose)
190+
end
191+
192+
function DAEVerbosity(::Nothing)
193+
DAEVerbosity(verbose = true)
194+
end

src/problems/dde_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,40 @@ struct DDEAliasSpecifier
431431
end
432432
end
433433
end
434+
435+
@doc doc"""
436+
437+
Determines what is printed when solving a `DDEProblem`.
438+
439+
### Fields
440+
* `verbosity`
441+
442+
### Constructors
443+
444+
```julia
445+
DDEVerbosity(verbose::Bool): sets all fields to `verbose`
446+
DDEVerbosity(; verbose = nothing): kwarg constructor
447+
DDEVerbosity(::Nothing): uses default options
448+
```
449+
"""
450+
struct DDEVerbosity <: AbstractAliasSpecifier
451+
verbose::Any
452+
453+
function DDEVerbosity(verbose::Bool)
454+
if verbose
455+
new((true for _ in fieldnames(DDEVerbosity))...)
456+
else
457+
new((false for _ in fieldnames(DDEVerbosity))...)
458+
end
459+
end
460+
461+
DDEVerbosity(verbose) = new(verbose)
462+
end
463+
464+
function DDEVerbosity(; verbose = nothing)
465+
DDEVerbosity(verbose)
466+
end
467+
468+
function DDEVerbosity(::Nothing)
469+
DDEVerbosity(verbose = true)
470+
end

src/problems/discrete_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,40 @@ struct DiscreteAliasSpecifier
197197
end
198198
end
199199
end
200+
201+
@doc doc"""
202+
203+
Determines what is printed when solving a `DiscreteProblem`.
204+
205+
### Fields
206+
* `verbosity`
207+
208+
### Constructors
209+
210+
```julia
211+
DiscreteVerbosity(verbose::Bool): sets all fields to `verbose`
212+
DiscreteVerbosity(; verbose = nothing): kwarg constructor
213+
AnalyticalVerbosity(::Nothing): uses default options
214+
```
215+
"""
216+
struct DiscreteVerbosity <: AbstractVerbositySpecifier
217+
verbose::Any
218+
219+
function DiscreteVerbosity(verbose::Bool)
220+
if verbose
221+
new((true for _ in fieldnames(DiscreteVerbosity))...)
222+
else
223+
new((false for _ in fieldnames(DiscreteVerbosity))...)
224+
end
225+
end
226+
227+
DiscreteVerbosity(verbose) = new(verbose)
228+
end
229+
230+
function DiscreteVerbosity(; verbose = nothing)
231+
DiscreteVerbosity(verbose)
232+
end
233+
234+
function DiscreteVerbosity(::Nothing)
235+
DiscreteVerbosity(verbose = true)
236+
end

src/problems/implicit_discrete_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,40 @@ struct ImplicitDiscreteAliasSpecifier
163163
end
164164
end
165165
end
166+
167+
@doc doc"""
168+
169+
Determines what is printed when solving a `ImplicitDiscreteProblem`.
170+
171+
### Fields
172+
* `verbosity`
173+
174+
### Constructors
175+
176+
```julia
177+
ImplicitDiscreteVerbosity(verbose::Bool): sets all fields to `verbose`
178+
ImplicitDiscreteVerbosity(; verbose = nothing): kwarg constructor
179+
ImplicitDiscreteVerbosity(::Nothing): uses default options
180+
```
181+
"""
182+
struct ImplicitDiscreteVerbosity <: AbstractVerbositySpecifier
183+
verbose::Any
184+
185+
function ImplicitDiscreteVerbosity(verbose::Bool)
186+
if verbose
187+
new((true for _ in fieldnames(ImplicitDiscreteVerbosity))...)
188+
else
189+
new((false for _ in fieldnames(ImplicitDiscreteVerbosity))...)
190+
end
191+
end
192+
193+
ImplicitDiscreteVerbosity(verbose) = new(verbose)
194+
end
195+
196+
function ImplicitDiscreteVerbosity(; verbose = nothing)
197+
ImplicitDiscreteVerbosity(verbose)
198+
end
199+
200+
function ImplicitDiscreteVerbosity(::Nothing)
201+
ImplicitDiscreteVerbosity(verbose = true)
202+
end

src/problems/integral_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,40 @@ struct IntegralAliasSpecifier <: AbstractAliasSpecifier
196196
end
197197
end
198198
end
199+
200+
@doc doc"""
201+
202+
Determines what is printed when solving a `IntegralProblem`.
203+
204+
### Fields
205+
* `verbosity`
206+
207+
### Constructors
208+
209+
```julia
210+
IntegralVerbosity(verbose::Bool): sets all fields to `verbose`
211+
IntegralVerbosity(; verbose = nothing): kwarg constructor
212+
IntegralVerbosity(::Nothing): uses default options
213+
```
214+
"""
215+
struct IntegralVerbosity #<: AbstractAliasSpecifier
216+
verbose::Any
217+
218+
function IntegralVerbosity(verbose::Bool)
219+
if verbose
220+
new((true for _ in fieldnames(IntegralVerbosity))...)
221+
else
222+
new((false for _ in fieldnames(IntegralVerbosity))...)
223+
end
224+
end
225+
226+
IntegralVerbosity(verbose) = new(verbose)
227+
end
228+
229+
function IntegralVerbosity(; verbose = nothing)
230+
IntegralVerbosity(verbose)
231+
end
232+
233+
function IntegralVerbosity(::Nothing)
234+
IntegralVerbosity(verbose = true)
235+
end

src/problems/linear_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,40 @@ struct LinearAliasSpecifier <: AbstractAliasSpecifier
107107
end
108108
end
109109
end
110+
111+
@doc doc"""
112+
113+
Determines what is printed when solving a `LinearProblem`.
114+
115+
### Fields
116+
* `verbosity`
117+
118+
### Constructors
119+
120+
```julia
121+
LinearVerbosity(verbose::Bool): sets all fields to `verbose`
122+
LinearVerbosity(; verbose = nothing): kwarg constructor
123+
LinearVerbosity(::Nothing): uses default options
124+
```
125+
"""
126+
struct LinearVerbosity <: AbstractVerbositySpecifier
127+
verbose::Any
128+
129+
function LinearVerbosity(verbose::Bool)
130+
if verbose
131+
new((true for _ in fieldnames(LinearVerbosity))...)
132+
else
133+
new((false for _ in fieldnames(LinearVerbosity))...)
134+
end
135+
end
136+
137+
LinearVerbosity(verbose) = new(verbose)
138+
end
139+
140+
function LinearVerbosity(; verbose = nothing)
141+
LinearVerbosity(verbose)
142+
end
143+
144+
function LinearVerbosity(::Nothing)
145+
LinearVerbosity(verbose = true)
146+
end

src/problems/nonlinear_problems.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,3 +581,40 @@ struct NonlinearAliasSpecifier <: AbstractAliasSpecifier
581581
end
582582
end
583583
end
584+
585+
@doc doc"""
586+
587+
Determines what is printed when solving a `NonlinearProblem`.
588+
589+
### Fields
590+
* `verbosity`
591+
592+
### Constructors
593+
594+
```julia
595+
NonlinearVerbosity(verbose::Bool): sets all fields to `verbose`
596+
NonlinearVerbosity(; verbose = nothing): kwarg constructor
597+
NonlinearVerbosity(::Nothing): uses default options
598+
```
599+
"""
600+
struct NonlinearVerbosity <: AbstractVerbositySpecifier
601+
verbose::Any
602+
603+
function NonlinearVerbosity(verbose::Bool)
604+
if verbose
605+
new((true for _ in fieldnames(NonlinearVerbosity))...)
606+
else
607+
new((false for _ in fieldnames(NonlinearVerbosity))...)
608+
end
609+
end
610+
611+
NonlinearVerbosity(verbose) = new(verbose)
612+
end
613+
614+
function NonlinearVerbosity(; verbose = nothing)
615+
NonlinearVerbosity(verbose)
616+
end
617+
618+
function NonlinearVerbosity(::Nothing)
619+
NonlinearVerbosity(verbose = true)
620+
end

0 commit comments

Comments
 (0)