diff --git a/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.H b/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.H index ca8608bf557..edadfa21126 100644 --- a/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.H +++ b/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.H @@ -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 ); @@ -282,8 +282,10 @@ public: private: bool m_is_defined = false; + amrex::Vector,3>> m_array_vec; amrex::Vector> m_scalar_vec; + warpx::fields::FieldType m_array_type = warpx::fields::FieldType::None; warpx::fields::FieldType m_scalar_type = warpx::fields::FieldType::None; diff --git a/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.cpp b/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.cpp index 61b67701da0..f2a88d82d42 100644 --- a/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.cpp +++ b/Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.cpp @@ -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; }