Nektar++
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
Nektar::LibUtilities::NekSysOperators Class Reference

#include <NekSys.h>

Public Types

typedef const Array< OneD, const NekDoubleInArrayType
 
typedef Array< OneD, NekDoubleOutArrayType
 
typedef std::function< void(InArrayType &, OutArrayType &, const bool &)> FunctorType1
 
typedef std::function< void(InArrayType &, InArrayType &, OutArrayType &, const bool &)> FunctorType2
 
typedef Array< OneD, FunctorType1FunctorType1Array
 
typedef Array< OneD, FunctorType2FunctorType2Array
 

Public Member Functions

 NekSysOperators (void)
 
 NekSysOperators (const NekSysOperators &in)
 
NekSysOperatorsoperator= (const NekSysOperators &in)
 
template<typename FuncPointerT , typename ObjectPointerT >
void DefineNekSysResEval (FuncPointerT func, ObjectPointerT obj)
 
template<typename FuncPointerT , typename ObjectPointerT >
void DefineNekSysLhsEval (FuncPointerT func, ObjectPointerT obj)
 
template<typename FuncPointerT , typename ObjectPointerT >
void DefineNekSysPrecon (FuncPointerT func, ObjectPointerT obj)
 
template<typename FuncPointerT , typename ObjectPointerT >
void DefineAssembleLoc (FuncPointerT func, ObjectPointerT obj)
 
template<typename FuncPointerT , typename ObjectPointerT >
void DefineNekSysFixPointIte (FuncPointerT func, ObjectPointerT obj)
 
void DoNekSysResEval (InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
 
void DoNekSysLhsEval (InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
 
void DoNekSysPrecon (InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
 
void DoAssembleLoc (InArrayType &xn, OutArrayType &xn1, const bool &flag=false) const
 
void DoNekSysFixPointIte (InArrayType &rhs, InArrayType &xn, OutArrayType &xn1, const bool &flag=false) const
 

Static Public Attributes

static const int nfunctor1 = 4
 
static const int nfunctor2 = 1
 

Protected Attributes

FunctorType1Array m_functors1
 
FunctorType2Array m_functors2
 

Detailed Description

Definition at line 51 of file NekSys.h.

Member Typedef Documentation

◆ FunctorType1

Definition at line 58 of file NekSys.h.

◆ FunctorType1Array

Definition at line 62 of file NekSys.h.

◆ FunctorType2

Definition at line 61 of file NekSys.h.

◆ FunctorType2Array

Definition at line 63 of file NekSys.h.

◆ InArrayType

Definition at line 54 of file NekSys.h.

◆ OutArrayType

Definition at line 55 of file NekSys.h.

Constructor & Destructor Documentation

◆ NekSysOperators() [1/2]

Nektar::LibUtilities::NekSysOperators::NekSysOperators ( void  )
inline

Definition at line 67 of file NekSys.h.

◆ NekSysOperators() [2/2]

Nektar::LibUtilities::NekSysOperators::NekSysOperators ( const NekSysOperators in)
inline

Definition at line 71 of file NekSys.h.

73 {
74 for (int i = 0; i < nfunctor1; ++i)
75 {
76 m_functors1[i] = in.m_functors1[i];
77 }
78 for (int i = 0; i < nfunctor2; ++i)
79 {
80 m_functors2[i] = in.m_functors2[i];
81 }
82 }

References m_functors1, m_functors2, nfunctor1, and nfunctor2.

Member Function Documentation

◆ DefineAssembleLoc()

template<typename FuncPointerT , typename ObjectPointerT >
void Nektar::LibUtilities::NekSysOperators::DefineAssembleLoc ( FuncPointerT  func,
ObjectPointerT  obj 
)
inline

Definition at line 120 of file NekSys.h.

121 {
122 m_functors1[3] =
123 std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
124 std::placeholders::_3);
125 }

References m_functors1.

Referenced by Nektar::MultiRegions::GlobalLinSysIterative::GlobalLinSysIterative().

◆ DefineNekSysFixPointIte()

template<typename FuncPointerT , typename ObjectPointerT >
void Nektar::LibUtilities::NekSysOperators::DefineNekSysFixPointIte ( FuncPointerT  func,
ObjectPointerT  obj 
)
inline

Definition at line 127 of file NekSys.h.

128 {
129 m_functors2[0] =
130 std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
131 std::placeholders::_3, std::placeholders::_4);
132 }

References m_functors2.

◆ DefineNekSysLhsEval()

template<typename FuncPointerT , typename ObjectPointerT >
void Nektar::LibUtilities::NekSysOperators::DefineNekSysLhsEval ( FuncPointerT  func,
ObjectPointerT  obj 
)
inline

Definition at line 106 of file NekSys.h.

107 {
108 m_functors1[1] =
109 std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
110 std::placeholders::_3);
111 }

References m_functors1.

Referenced by Nektar::MultiRegions::GlobalLinSysIterative::GlobalLinSysIterative(), and Nektar::CFSImplicit::InitialiseNonlinSysSolver().

◆ DefineNekSysPrecon()

template<typename FuncPointerT , typename ObjectPointerT >
void Nektar::LibUtilities::NekSysOperators::DefineNekSysPrecon ( FuncPointerT  func,
ObjectPointerT  obj 
)
inline

Definition at line 113 of file NekSys.h.

114 {
115 m_functors1[2] =
116 std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
117 std::placeholders::_3);
118 }

References m_functors1.

Referenced by Nektar::MultiRegions::GlobalLinSysIterative::GlobalLinSysIterative(), and Nektar::CFSImplicit::InitialiseNonlinSysSolver().

◆ DefineNekSysResEval()

template<typename FuncPointerT , typename ObjectPointerT >
void Nektar::LibUtilities::NekSysOperators::DefineNekSysResEval ( FuncPointerT  func,
ObjectPointerT  obj 
)
inline

Definition at line 99 of file NekSys.h.

100 {
101 m_functors1[0] =
102 std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
103 std::placeholders::_3);
104 }

References m_functors1.

Referenced by Nektar::CFSImplicit::InitialiseNonlinSysSolver().

◆ DoAssembleLoc()

void Nektar::LibUtilities::NekSysOperators::DoAssembleLoc ( InArrayType xn,
OutArrayType xn1,
const bool &  flag = false 
) const
inline

Definition at line 161 of file NekSys.h.

163 {
164 ASSERTL1(m_functors1[3], "DoAssembleLoc should be defined");
165 m_functors1[3](xn, xn1, flag);
166 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242

References ASSERTL1, and m_functors1.

Referenced by Nektar::LibUtilities::NekLinSysIterGMRESLoc::DoArnoldi(), Nektar::LibUtilities::NekLinSysIterCGLoc::DoConjugateGradient(), Nektar::LibUtilities::NekLinSysIterGMRESLoc::DoGMRES(), Nektar::LibUtilities::NekLinSysIterGMRESLoc::DoGmresRestart(), and Nektar::LibUtilities::NekLinSysIter::Set_Rhs_Magnitude().

◆ DoNekSysFixPointIte()

void Nektar::LibUtilities::NekSysOperators::DoNekSysFixPointIte ( InArrayType rhs,
InArrayType xn,
OutArrayType xn1,
const bool &  flag = false 
) const
inline

Definition at line 168 of file NekSys.h.

171 {
172 ASSERTL1(m_functors2[0], "DoNekSysFixPointIte should be defined");
173 m_functors2[0](rhs, xn, xn1, flag);
174 }

References ASSERTL1, and m_functors2.

Referenced by Nektar::LibUtilities::NekLinSysIterFixedpointJacobi::v_SolveSystem().

◆ DoNekSysLhsEval()

void Nektar::LibUtilities::NekSysOperators::DoNekSysLhsEval ( InArrayType inarray,
OutArrayType outarray,
const bool &  flag = false 
) const
inline

◆ DoNekSysPrecon()

void Nektar::LibUtilities::NekSysOperators::DoNekSysPrecon ( InArrayType inarray,
OutArrayType outarray,
const bool &  flag = false 
) const
inline

Definition at line 148 of file NekSys.h.

150 {
151 if (m_functors1[2])
152 {
153 m_functors1[2](inarray, outarray, flag);
154 }
155 else
156 {
157 Vmath::Vcopy(outarray.size(), inarray, 1, outarray, 1);
158 }
159 }
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References m_functors1, and Vmath::Vcopy().

Referenced by Nektar::LibUtilities::NekLinSysIterGMRES::DoArnoldi(), Nektar::LibUtilities::NekLinSysIterGMRESLoc::DoArnoldi(), Nektar::LibUtilities::NekLinSysIterCGLoc::DoConjugateGradient(), Nektar::LibUtilities::NekLinSysIterCG::DoConjugateGradient(), Nektar::LibUtilities::NekLinSysIterGMRES::DoGmresRestart(), and Nektar::LibUtilities::NekLinSysIterGMRESLoc::DoGmresRestart().

◆ DoNekSysResEval()

void Nektar::LibUtilities::NekSysOperators::DoNekSysResEval ( InArrayType inarray,
OutArrayType outarray,
const bool &  flag = false 
) const
inline

Definition at line 134 of file NekSys.h.

136 {
137 ASSERTL1(m_functors1[0], "DoNekSysResEval should be defined");
138 m_functors1[0](inarray, outarray, flag);
139 }

References ASSERTL1, and m_functors1.

Referenced by Nektar::LibUtilities::NekNonlinSysNewton::v_SolveSystem().

◆ operator=()

NekSysOperators & Nektar::LibUtilities::NekSysOperators::operator= ( const NekSysOperators in)
inline

Definition at line 84 of file NekSys.h.

85 {
86 for (int i = 0; i < nfunctor1; ++i)
87 {
88 m_functors1[i] = in.m_functors1[i];
89 }
90 for (int i = 0; i < nfunctor2; ++i)
91 {
92 m_functors2[i] = in.m_functors2[i];
93 }
94
95 return *this;
96 }

References m_functors1, m_functors2, nfunctor1, and nfunctor2.

Member Data Documentation

◆ m_functors1

FunctorType1Array Nektar::LibUtilities::NekSysOperators::m_functors1
protected

◆ m_functors2

FunctorType2Array Nektar::LibUtilities::NekSysOperators::m_functors2
protected

Definition at line 204 of file NekSys.h.

Referenced by DefineNekSysFixPointIte(), DoNekSysFixPointIte(), NekSysOperators(), and operator=().

◆ nfunctor1

const int Nektar::LibUtilities::NekSysOperators::nfunctor1 = 4
static

Definition at line 64 of file NekSys.h.

Referenced by NekSysOperators(), and operator=().

◆ nfunctor2

const int Nektar::LibUtilities::NekSysOperators::nfunctor2 = 1
static

Definition at line 65 of file NekSys.h.

Referenced by NekSysOperators(), and operator=().