Skip to content

Commit

Permalink
Safeguard in create Roe flux for invalid PDE types (#239)
Browse files Browse the repository at this point in the history
Minor fix to avoid seg faults when using Roe flux by accident
  • Loading branch information
Liki-RM authored Sep 3, 2023
1 parent 0f63a6a commit be278a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/numerical_flux/numerical_flux_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ ::create_euler_based_convective_numerical_flux(
using Model_enum = Parameters::AllParameters::ModelType;
std::shared_ptr<Physics::PhysicsBase<dim, nstate, real>> euler_based_physics_to_be_passed = physics_input;

if(pde_type!=PDE_enum::euler &&
pde_type!=PDE_enum::navier_stokes &&
!(pde_type==PDE_enum::physics_model && model_type==Model_enum::large_eddy_simulation))
{
std::cout << "Invalid convective numerical flux for pde_type. Aborting..." << std::endl;
std::abort();
}

#if PHILIP_DIM==3
if((pde_type==PDE_enum::physics_model &&
model_type==Model_enum::large_eddy_simulation))
Expand Down

0 comments on commit be278a2

Please sign in to comment.