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 53 of file NekSys.h.

Member Typedef Documentation

◆ FunctorType1

Definition at line 60 of file NekSys.h.

◆ FunctorType1Array

Definition at line 64 of file NekSys.h.

◆ FunctorType2

Definition at line 63 of file NekSys.h.

◆ FunctorType2Array

Definition at line 65 of file NekSys.h.

◆ InArrayType

Definition at line 56 of file NekSys.h.

◆ OutArrayType

Definition at line 57 of file NekSys.h.

Constructor & Destructor Documentation

◆ NekSysOperators() [1/2]

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

Definition at line 69 of file NekSys.h.

◆ NekSysOperators() [2/2]

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

Definition at line 73 of file NekSys.h.

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

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 122 of file NekSys.h.

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

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 129 of file NekSys.h.

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

References m_functors2.

◆ DefineNekSysLhsEval()

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

Definition at line 108 of file NekSys.h.

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

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 115 of file NekSys.h.

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

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 101 of file NekSys.h.

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

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 163 of file NekSys.h.

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

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 170 of file NekSys.h.

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

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 150 of file NekSys.h.

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

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 136 of file NekSys.h.

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

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 86 of file NekSys.h.

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

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 206 of file NekSys.h.

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

◆ nfunctor1

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

Definition at line 66 of file NekSys.h.

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

◆ nfunctor2

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

Definition at line 67 of file NekSys.h.

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