@@ -50,7 +50,7 @@ function compute_PairedExplicitRK2_butcher_tableau(num_stages, eig_vals, tspan,
5050 dteps,
5151 eig_vals; verbose)
5252
53- if num_stages != consistency_order
53+ if coeffs_max > 0
5454 monomial_coeffs = undo_normalization! (monomial_coeffs, consistency_order,
5555 num_stages)
5656 num_monomial_coeffs = length (monomial_coeffs)
@@ -81,24 +81,26 @@ function compute_PairedExplicitRK2_butcher_tableau(num_stages,
8181 a_matrix = zeros (2 , coeffs_max)
8282 a_matrix[1 , :] = c[3 : end ]
8383
84- path_monomial_coeffs = joinpath (base_path_monomial_coeffs,
85- " gamma_" * string (num_stages) * " .txt" )
84+ if coeffs_max > 0
85+ path_monomial_coeffs = joinpath (base_path_monomial_coeffs,
86+ " gamma_" * string (num_stages) * " .txt" )
8687
87- @assert isfile (path_monomial_coeffs) " Couldn't find file"
88- monomial_coeffs = readdlm (path_monomial_coeffs, Float64)
89- num_monomial_coeffs = size (monomial_coeffs, 1 )
88+ @assert isfile (path_monomial_coeffs) " Couldn't find file"
89+ monomial_coeffs = readdlm (path_monomial_coeffs, Float64)
90+ num_monomial_coeffs = size (monomial_coeffs, 1 )
9091
91- @assert num_monomial_coeffs == coeffs_max
92- A = compute_a_coeffs (num_stages, stage_scaling_factors, monomial_coeffs)
92+ @assert num_monomial_coeffs == coeffs_max
93+ A = compute_a_coeffs (num_stages, stage_scaling_factors, monomial_coeffs)
9394
94- a_matrix[1 , :] -= A
95- a_matrix[2 , :] = A
95+ a_matrix[1 , :] -= A
96+ a_matrix[2 , :] = A
97+ end
9698
9799 return a_matrix, c
98100end
99101
100102@doc raw """
101- PairedExplicitRK2(num_stages, base_path_monomial_coeffs::AbstractString, dt_opt = nothing,
103+ PairedExplicitRK2(num_stages, base_path_monomial_coeffs::AbstractString; dt_opt = nothing,
102104 bS = 1.0, cS = 0.5)
103105 PairedExplicitRK2(num_stages, tspan, semi::AbstractSemidiscretization;
104106 verbose = false, bS = 1.0, cS = 0.5)
@@ -144,7 +146,7 @@ struct PairedExplicitRK2 <: AbstractPairedExplicitRKSingle
144146end
145147
146148# Constructor that reads the coefficients from a file
147- function PairedExplicitRK2 (num_stages, base_path_monomial_coeffs:: AbstractString ,
149+ function PairedExplicitRK2 (num_stages, base_path_monomial_coeffs:: AbstractString ;
148150 dt_opt = nothing ,
149151 bS = 1.0 , cS = 0.5 )
150152 # If the user has the monomial coefficients, they also must have the optimal time step
0 commit comments