WarpX
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
WarpXSolverVec Class Reference

This is a wrapper class around a Vector of array of pointers to MultiFabs that contains basic math operators and functionality needed to interact with nonlinear solvers in WarpX and linear solvers in AMReX, such as GMRES. More...

#include <WarpXSolverVec.H>

Public Types

using value_type = amrex::Real
 
using RT = value_type
 

Public Member Functions

 WarpXSolverVec ()=default
 
 WarpXSolverVec (const WarpXSolverVec &)=delete
 
 ~WarpXSolverVec ()=default
 
bool IsDefined () const
 
void Define (const WarpXSolverVec &a_vec)
 
void Define (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &a_solver_vec)
 
void SetDotMask (const amrex::Vector< amrex::Geometry > &a_Geom)
 
RT dotProduct (const WarpXSolverVec &a_X) const
 
void Copy (const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &a_solver_vec)
 
void Copy (const WarpXSolverVec &a_vec)
 
WarpXSolverVecoperator= (const WarpXSolverVec &a_vec)=delete
 
 WarpXSolverVec (WarpXSolverVec &&) noexcept=default
 
WarpXSolverVecoperator= (WarpXSolverVec &&a_vec) noexcept
 
void operator+= (const WarpXSolverVec &a_vec)
 
void operator-= (const WarpXSolverVec &a_vec)
 
void linComb (const RT a, const WarpXSolverVec &X, const RT b, const WarpXSolverVec &Y)
 Y = a*X + b*Y. More...
 
void increment (const WarpXSolverVec &X, const RT a)
 Increment Y by a*X (Y += a*X) More...
 
void scale (RT a_a)
 Scale Y by a (Y *= a) More...
 
void zero ()
 
void setVal (const RT a_val)
 
RT norm2 () const
 
const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > & getVec () const
 
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > & getVec ()
 

Static Public Member Functions

static void clearDotMask ()
 

Private Attributes

bool m_is_defined = false
 
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > m_field_vec
 

Static Private Attributes

static constexpr int m_ncomp = 1
 
static constexpr int m_num_amr_levels = 1
 
static bool m_dot_mask_defined = false
 
static amrex::Vector< std::array< std::unique_ptr< amrex::iMultiFab >, 3 > > m_dotMask
 

Detailed Description

This is a wrapper class around a Vector of array of pointers to MultiFabs that contains basic math operators and functionality needed to interact with nonlinear solvers in WarpX and linear solvers in AMReX, such as GMRES.

The size of the Vector is the number of amr levels. Hardcoded for 1 right now. The size of the array is the number of MultiFabs. It is hardcoded for 3 right now as it is only used for the electric field in the implicit electromagnetic time solvers. In the future, the array size can be made a template parameter so that this class can be used for other solver vectors, such as electrostatic (array size 1) or Darwin (array size 4).

Member Typedef Documentation

◆ RT

◆ value_type

using WarpXSolverVec::value_type = amrex::Real

Constructor & Destructor Documentation

◆ WarpXSolverVec() [1/3]

WarpXSolverVec::WarpXSolverVec ( )
default

◆ WarpXSolverVec() [2/3]

WarpXSolverVec::WarpXSolverVec ( const WarpXSolverVec )
delete

◆ ~WarpXSolverVec()

WarpXSolverVec::~WarpXSolverVec ( )
default

◆ WarpXSolverVec() [3/3]

WarpXSolverVec::WarpXSolverVec ( WarpXSolverVec &&  )
defaultnoexcept

Member Function Documentation

◆ clearDotMask()

static void WarpXSolverVec::clearDotMask ( )
inlinestatic

◆ Copy() [1/2]

void WarpXSolverVec::Copy ( const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &  a_solver_vec)
inline

◆ Copy() [2/2]

void WarpXSolverVec::Copy ( const WarpXSolverVec a_vec)
inline

◆ Define() [1/2]

void WarpXSolverVec::Define ( const amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > &  a_solver_vec)
inline

◆ Define() [2/2]

void WarpXSolverVec::Define ( const WarpXSolverVec a_vec)
inline

◆ dotProduct()

amrex::Real WarpXSolverVec::dotProduct ( const WarpXSolverVec a_X) const

◆ getVec() [1/2]

amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > >& WarpXSolverVec::getVec ( )
inline

◆ getVec() [2/2]

const amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > >& WarpXSolverVec::getVec ( ) const
inline

◆ increment()

void WarpXSolverVec::increment ( const WarpXSolverVec X,
const RT  a 
)
inline

Increment Y by a*X (Y += a*X)

◆ IsDefined()

bool WarpXSolverVec::IsDefined ( ) const
inline

◆ linComb()

void WarpXSolverVec::linComb ( const RT  a,
const WarpXSolverVec X,
const RT  b,
const WarpXSolverVec Y 
)
inline

Y = a*X + b*Y.

◆ norm2()

RT WarpXSolverVec::norm2 ( ) const
inline

◆ operator+=()

void WarpXSolverVec::operator+= ( const WarpXSolverVec a_vec)
inline

◆ operator-=()

void WarpXSolverVec::operator-= ( const WarpXSolverVec a_vec)
inline

◆ operator=() [1/2]

WarpXSolverVec& WarpXSolverVec::operator= ( const WarpXSolverVec a_vec)
delete

◆ operator=() [2/2]

WarpXSolverVec& WarpXSolverVec::operator= ( WarpXSolverVec &&  a_vec)
inlinenoexcept

◆ scale()

void WarpXSolverVec::scale ( RT  a_a)
inline

Scale Y by a (Y *= a)

◆ SetDotMask()

void WarpXSolverVec::SetDotMask ( const amrex::Vector< amrex::Geometry > &  a_Geom)

◆ setVal()

void WarpXSolverVec::setVal ( const RT  a_val)
inline

◆ zero()

void WarpXSolverVec::zero ( )
inline

Member Data Documentation

◆ m_dot_mask_defined

bool WarpXSolverVec::m_dot_mask_defined = false
inlinestaticprivate

◆ m_dotMask

amrex::Vector<std::array<std::unique_ptr<amrex::iMultiFab>,3> > WarpXSolverVec::m_dotMask
inlinestaticprivate

◆ m_field_vec

amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > WarpXSolverVec::m_field_vec
private

◆ m_is_defined

bool WarpXSolverVec::m_is_defined = false
private

◆ m_ncomp

constexpr int WarpXSolverVec::m_ncomp = 1
staticconstexprprivate

◆ m_num_amr_levels

constexpr int WarpXSolverVec::m_num_amr_levels = 1
staticconstexprprivate

The documentation for this class was generated from the following files: