Skip to content

Commit d931870

Browse files
committed
check for nonexistent fields
1 parent 267a75d commit d931870

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/io/DiagFramePlane.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ void DiagFramePlane::prepare(int a_nlevels, const amrex::Vector<amrex::Geometry>
116116
const amrex::Vector<amrex::DistributionMapping> &a_dmap, const amrex::Vector<std::string> &a_varNames)
117117
{
118118
if (first_time) {
119+
for (auto const &field : m_fieldNames) {
120+
bool found = false;
121+
for (auto const &name : a_varNames) {
122+
if (name == field) {
123+
found = true;
124+
break;
125+
}
126+
}
127+
if (!found) {
128+
amrex::Abort("DiagFramePlane: Field '" + field + "' is not available!");
129+
}
130+
}
131+
119132
// Store the level0 geometry
120133
auto initDomain = a_geoms[0].Domain();
121134
auto initRealBox = a_geoms[0].ProbDomain();

0 commit comments

Comments
 (0)