36#ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_NEK_NekSys_H
37#define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_NEK_NekSys_H
99 template <
typename FuncPo
interT,
typename ObjectPo
interT>
103 std::bind(
func, obj, std::placeholders::_1, std::placeholders::_2,
104 std::placeholders::_3);
106 template <
typename FuncPo
interT,
typename ObjectPo
interT>
110 std::bind(
func, obj, std::placeholders::_1, std::placeholders::_2,
111 std::placeholders::_3);
113 template <
typename FuncPo
interT,
typename ObjectPo
interT>
117 std::bind(
func, obj, std::placeholders::_1, std::placeholders::_2,
118 std::placeholders::_3);
120 template <
typename FuncPo
interT,
typename ObjectPo
interT>
124 std::bind(
func, obj, std::placeholders::_1, std::placeholders::_2,
125 std::placeholders::_3);
127 template <
typename FuncPo
interT,
typename ObjectPo
interT>
131 std::bind(
func, obj, std::placeholders::_1, std::placeholders::_2,
132 std::placeholders::_3, std::placeholders::_4);
136 const bool &flag =
false)
const
143 const bool &flag =
false)
const
150 const bool &flag =
false)
const
163 const bool &flag =
false)
const
171 const bool &flag =
false)
const
236class NekSys :
public std::enable_shared_from_this<NekSys>
248 pSession, vRowComm, nDimen, pKey);
312 [[maybe_unused]]
const int nGlobal,
315 [[maybe_unused]]
const int nDir)
317 ASSERTL0(
false,
"LinSysIterSolver NOT CORRECT.");
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define LIB_UTILITIES_EXPORT
void SetFlagWarnings(bool in)
void SetRhsMagnitude(const NekDouble mag)
const NekSysOperators & GetSysOperators()
static NekSysSharedPtr CreateInstance(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vRowComm, const int nDimen, const NekSysKey &pKey)
void SetSysOperators(const NekSysOperators &in)
LibUtilities::CommSharedPtr m_rowComm
virtual void v_InitObject()
int SolveSystem(const int nGlobal, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int nDir=0)
NekSysOperators m_operator
virtual ~NekSys()=default
NekDouble m_rhs_magnitude
NekSys(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vRowComm, const int nDimen, const NekSysKey &pKey)
virtual int v_SolveSystem(const int nGlobal, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int nDir)
virtual void v_SetSysOperators(const NekSysOperators &in)
NekDouble m_NekNonLinSysTolerance
NekDouble m_NonlinIterTolRelativeL2
int m_NekNonlinSysMaxIterations
NekDouble m_NekLinSysTolerance
bool m_NekLinSysLeftPrecon
bool m_GMRESCentralDifference
std::string m_LinSysIterSolverTypeInNonlin
bool m_NekLinSysRightPrecon
int m_KrylovMaxHessMatBand
int m_NekLinSysMaxIterations
void DefineAssembleLoc(FuncPointerT func, ObjectPointerT obj)
void DefineNekSysFixPointIte(FuncPointerT func, ObjectPointerT obj)
Array< OneD, FunctorType2 > FunctorType2Array
static const int nfunctor2
void DoNekSysResEval(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
void DefineNekSysResEval(FuncPointerT func, ObjectPointerT obj)
static const int nfunctor1
void DefineNekSysLhsEval(FuncPointerT func, ObjectPointerT obj)
const Array< OneD, const NekDouble > InArrayType
FunctorType2Array m_functors2
NekSysOperators & operator=(const NekSysOperators &in)
std::function< void(InArrayType &, InArrayType &, OutArrayType &, const bool &)> FunctorType2
Array< OneD, NekDouble > OutArrayType
std::function< void(InArrayType &, OutArrayType &, const bool &)> FunctorType1
NekSysOperators(const NekSysOperators &in)
FunctorType1Array m_functors1
void DoNekSysFixPointIte(InArrayType &rhs, InArrayType &xn, OutArrayType &xn1, const bool &flag=false) const
void DoAssembleLoc(InArrayType &xn, OutArrayType &xn1, const bool &flag=false) const
void DoNekSysPrecon(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
Array< OneD, FunctorType1 > FunctorType1Array
void DefineNekSysPrecon(FuncPointerT func, ObjectPointerT obj)
void DoNekSysLhsEval(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< NekSys > NekSysSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
static const NekDouble kNekIterativeTol
static const NekDouble kNekUnsetDouble
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)