Skip to content

Commit

Permalink
clean up enum
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren committed Oct 2, 2024
1 parent b9e1740 commit 6fb49b5
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions ExampleCodes/heFFTe/Poisson/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

using namespace amrex;

enum struct LaplacianType {
AMREX_ENUM(LaplacianType,
Unknown, Exact, Discrete
};
);

int main (int argc, char* argv[])
{
Expand Down Expand Up @@ -40,7 +40,6 @@ int main (int argc, char* argv[])
Real prob_hi_y = 1.;
Real prob_hi_z = 1.;

std::string laplacian_type_string;
LaplacianType laplacian_type = LaplacianType::Unknown;

// **********************************
Expand Down Expand Up @@ -69,20 +68,9 @@ int main (int argc, char* argv[])
pp.query("prob_hi_y",prob_hi_y);
pp.query("prob_hi_z",prob_hi_z);

pp.query("laplacian_type",laplacian_type_string);
pp.query_enum_case_insensitive("laplacian_type",laplacian_type);
}

if ( (laplacian_type_string == "Exact") ||
(laplacian_type_string == "exact") ) {
laplacian_type = LaplacianType::Exact;
}
else
if ( (laplacian_type_string == "Discrete") ||
(laplacian_type_string == "discrete") ) {
laplacian_type = LaplacianType::Discrete;
}


if (laplacian_type == LaplacianType::Unknown) {
amrex::Abort("Must specify exact or discrete Laplacian");
}
Expand Down

0 comments on commit 6fb49b5

Please sign in to comment.