Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some clang-tidy on MHD #2841

Merged
merged 4 commits into from
May 6, 2024
Merged
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 Exec/mhd_tests/OrszagTang/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void problem_initialize ()
{

// temporarily give B_0 value here
constexpr Real M_SQRT_PI = std::sqrt(M_PI);
const Real M_SQRT_PI = std::sqrt(M_PI);
problem::B_0 = 1.0 / (2.0_rt * M_SQRT_PI);

// compute the internal energy (erg/cc) for the left and right state
Expand Down
7 changes: 0 additions & 7 deletions Exec/mhd_tests/OrszagTang/problem_initialize_mhd_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ void problem_initialize_mhd_data (int i, int j, int k,
Array4<Real> const& B, const int ibdir,
const GeometryData& geomdata)
{
int coord_type = geomdata.Coord();

const Real* dx = geomdata.CellSize();
const Real* problo = geomdata.ProbLo();

Expand All @@ -20,11 +18,6 @@ void problem_initialize_mhd_data (int i, int j, int k,
y = problo[1] + dx[1] * (static_cast<Real>(j) + 0.5_rt);
#endif

Real z = 0.0;
#if AMREX_SPACEDIM == 3
z = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);
#endif

if (ibdir == 0) {
B(i,j,k) = -problem::B_0 * std::sin(2.0_rt * M_PI * y);
} else if (ibdir == 1) {
Expand Down
3 changes: 0 additions & 3 deletions Exec/mhd_tests/OrszagTang/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ void problem_initialize_state_data (int i, int j, int k,
Array4<Real> const& state,
const GeometryData& geomdata)
{
int coord_type = geomdata.Coord();

const Real* dx = geomdata.CellSize();
const Real* problo = geomdata.ProbLo();

Real x = problo[0] + dx[0] * (static_cast<Real>(i) + 0.5_rt);
Real y = problo[1] + dx[1] * (static_cast<Real>(j) + 0.5_rt);
Real z = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);

state(i,j,k,URHO) = problem::rho_0;
state(i,j,k,UMX) = -problem::rho_0 * problem::u_0 * std::sin(2.0_rt * M_PI * y);
Expand Down
10 changes: 5 additions & 5 deletions Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,11 @@ public:
/// @param Bz magnetic field in z
/// @param state the state to operate on
///
void add_magnetic_e (
amrex::MultiFab& Bx,
amrex::MultiFab& By,
amrex::MultiFab& Bz,
amrex::MultiFab& state);
static void add_magnetic_e (
amrex::MultiFab& Bx,
amrex::MultiFab& By,
amrex::MultiFab& Bz,
amrex::MultiFab& state);

///
/// Check if divergence of B is zero at initialization
Expand Down
8 changes: 4 additions & 4 deletions Source/mhd/Castro_mhd.H
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
amrex::Array4<amrex::Real const> const& flux1,
amrex::Array4<amrex::Real const> const& flux2);

void
static void
PrimToCons(const amrex::Box& bx,
amrex::Array4<amrex::Real const> const& q_arr,
amrex::Array4<amrex::Real> const& u_arr);
Expand All @@ -53,21 +53,21 @@
const amrex::Real dt);


void
static void
electric_edge_x(const amrex::Box& bx,
amrex::Array4<amrex::Real const> const& q_arr,
amrex::Array4<amrex::Real> const& E,
amrex::Array4<amrex::Real const> const& flxy,
amrex::Array4<amrex::Real const> const& flxz);

void
static void
electric_edge_y(const amrex::Box& bx,
amrex::Array4<amrex::Real const> const& q_arr,
amrex::Array4<amrex::Real> const& E,
amrex::Array4<amrex::Real const> const& flxx,
amrex::Array4<amrex::Real const> const& flxz);

void
static void
electric_edge_z(const amrex::Box& bx,
amrex::Array4<amrex::Real const> const& q_arr,
amrex::Array4<amrex::Real> const& E,
Expand Down