Skip to content
Snippets Groups Projects
Commit 9d3ea838 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

add prms to Project type

parent 14d86ad9
No related branches found
No related tags found
1 merge request!91make shock tube and blast wave tests run for SRHD when using MDA AV
......@@ -9,7 +9,8 @@ function Project(env::Environment, prms, mesh::Mesh1d)
tci = TCI.make_TCI(env.mesh, prms["TCI"])
hrsc = HRSC.make_HRSC(env.mesh, prms["HRSC"])
P = Project(equation, hrsc, tci)
fixedprms = (; av_regularization=:covariant)
P = Project(equation, hrsc, tci, fixedprms)
# register variables
# TODO Somehow replace _register_variables! with register_variables!
......@@ -55,7 +56,7 @@ function Project(env::Environment, prms, mesh::Mesh2d)
# TODO Somehow replace _register_variables! with register_variables!
@unpack cache = env
_register_variables!(mesh, P)
_register_variables!(mesh, hrsc)
_register_variables!(mesh, hrsc, nothing)
_register_variables!(mesh, bdrycond)
display(cache)
......@@ -108,23 +109,23 @@ function _register_variables!(mesh::Mesh, P::Project)
cell_variablenames = (:cellmax_v,),
global_variablenames = (:t, :tm1) # time steps
)
_register_variables!(mesh, P.hrsc)
_register_variables!(mesh, P.hrsc, P.prms)
_register_variables!(mesh, P.tci)
@unpack x = get_static_variables(mesh.cache)
# @. x = env.mesh.x[:]
end
function _register_variables!(mesh, tci_or_hrsc::Nothing) end
function _register_variables!(mesh, tci_or_hrsc::Nothing, args...) end
_register_variables!(mesh, hrsc::AbstractHRSC) =
_register_variables!(mesh, hrsc::AbstractHRSC, prms) =
error("_register_variables: Not implemented for hrsc of type '$(typeof(hrsc))'")
_register_variables!(mesh, hrsc::HRSC.AbstractReconstruction) = nothing
_register_variables!(mesh, hrsc::HRSC.AbstractReconstruction, prms) = nothing
function _register_variables!(mesh, hrsc::HRSC.AbstractArtificialViscosity)
function _register_variables!(mesh, hrsc::HRSC.AbstractArtificialViscosity, prms)
register_variables!(mesh.cache,
static_variablenames = (:ldg_D, :ldg_S, :ldg_tau,
:flx_ldg_D, :flx_ldg_S, :flx_ldg_tau),
......@@ -133,17 +134,23 @@ function _register_variables!(mesh, hrsc::HRSC.AbstractArtificialViscosity)
end
function _register_variables!(mesh, hrsc::HRSC.SmoothedArtificialViscosity)
_register_variables!(mesh, hrsc.av)
function _register_variables!(mesh, hrsc::HRSC.SmoothedArtificialViscosity, prms)
_register_variables!(mesh, hrsc.av, prms)
register_variables!(mesh.cache,
static_variablenames = (:smoothed_mu,),
bdry_variablenames = (:bdry_ldg_D, :bdry_ldg_S, :bdry_ldg_tau,
:bdry_smoothed_mu),
)
reg = prms.av_regularization
if reg == :covariant
register_variables!(mesh.cache,
bdry_variablenames = (:bdry_rhs_D, :bdry_rhs_S, :bdry_rhs_tau)
)
end
end
function _register_variables!(mesh::Mesh2d, hrsc::HRSC.EntropyViscosity)
function _register_variables!(mesh::Mesh2d, hrsc::HRSC.EntropyViscosity, prms)
register_variables!(mesh.cache,
static_variablenames = (:E, :Em1, :flx_E_x, :flx_E_y, :flxm1_E_x, :flxm1_E_y,
:ldg_D_x, :ldg_D_y, :ldg_Sx_x, :ldg_Sx_y,
......@@ -156,7 +163,7 @@ function _register_variables!(mesh::Mesh2d, hrsc::HRSC.EntropyViscosity)
end
function _register_variables!(mesh, tci::TCI.AbstractTCI)
function _register_variables!(mesh, tci::TCI.AbstractTCI, prms)
register_variables!(mesh.cache, cell_variablenames = (:flag,:D_flag,:S_flag,:tau_flag))
end
......
......@@ -21,11 +21,13 @@ end
struct Project{T_HRSC <:Maybe{HRSC.AbstractHRSC},
T_TCI <:Maybe{TCI.AbstractTCI}}
T_TCI <:Maybe{TCI.AbstractTCI},
T_Prms}
equation::Equation
hrsc::T_HRSC
tci::T_TCI
prms::T_Prms
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment