Skip to content

Commit

Permalink
both array_vec and scalar_vec types cant be FieldType::None
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinRayAngus committed Aug 26, 2024
1 parent c79a810 commit ba587bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public:

[[nodiscard]] inline bool IsDefined () const { return m_is_defined; }

void Define ( WarpX* a_WarpX,
void Define ( WarpX* a_WarpX,
warpx::fields::FieldType a_array_type,
warpx::fields::FieldType a_scalar_type = warpx::fields::FieldType::None );

Expand Down Expand Up @@ -282,8 +282,10 @@ public:
private:

bool m_is_defined = false;

amrex::Vector<std::array<std::unique_ptr<amrex::MultiFab>,3>> m_array_vec;
amrex::Vector<std::unique_ptr<amrex::MultiFab>> m_scalar_vec;

warpx::fields::FieldType m_array_type = warpx::fields::FieldType::None;
warpx::fields::FieldType m_scalar_type = warpx::fields::FieldType::None;

Expand Down
5 changes: 5 additions & 0 deletions Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ void WarpXSolverVec::Define ( WarpX* a_WarpX,

}

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
m_array_type != FieldType::None ||
m_scalar_type != FieldType::None,
"WarpXSolverVec cannot be defined with both array and scalar vecs FieldType::None");

m_is_defined = true;
}

Expand Down

0 comments on commit ba587bc

Please sign in to comment.