Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/RB/RBSteady/PostProcess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ end
function load_operator(dir,feop::LinearNonlinearParamOperator;label="")
feop_lin = get_linear_operator(feop)
feop_nlin = get_nonlinear_operator(feop)
trial,test = _fixed_operator_parts(dir,feop_lin;label)
trial,test = _load_fixed_operator_parts(dir,feop_lin;label)
red_lhs_lin,red_rhs_lin = _load_trian_operator_parts(
dir,feop_lin;label=_get_label("lin",label))
red_lhs_nlin,red_rhs_nlin = _load_trian_operator_parts(
Expand Down
25 changes: 25 additions & 0 deletions test/RBSteady/save_operator.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module SaveSteadyOperator

using Test
using GridapROMs
using GridapROMs.RBSteady

@testset "load_operator method for LinearNonlinearParamOperator" begin
# Verify the internal helper function used by load_operator exists
@test isdefined(RBSteady, :_load_fixed_operator_parts)

# Verify the typo'd name does NOT exist (regression guard)
@test !isdefined(RBSteady, :_fixed_operator_parts)

# Verify load_operator is defined for LinearNonlinearParamOperator
@test hasmethod(load_operator, Tuple{String, LinearNonlinearParamOperator})

# Verify the source calls _load_fixed_operator_parts, not _fixed_operator_parts
src = read(joinpath(pkgdir(GridapROMs), "src", "RB", "RBSteady", "PostProcess.jl"), String)
m = match(r"function load_operator\(dir,feop::LinearNonlinearParamOperator.*?\nend"s, src)
@test m !== nothing
@test occursin("_load_fixed_operator_parts(", m.match)
@test !occursin(r"= _fixed_operator_parts\(", m.match)
end

end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ using Test
@testset "poisson" begin include("RBSteady/poisson.jl") end
@testset "steady stokes" begin include("RBSteady/stokes.jl") end
@testset "steady navier-stokes" begin include("RBSteady/navier_stokes.jl") end
@testset "steady save operator" begin include("RBSteady/save_operator.jl") end

@testset "heat equation" begin include("RBTransient/heat_equation.jl") end
@testset "unsteady elasticity" begin include("RBTransient/elasticity.jl") end
Expand Down
Loading