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

Member Typedef Documentation

◆ FunctorType1

Definition at line 59 of file NekSys.h.

◆ FunctorType1Array

Definition at line 63 of file NekSys.h.

◆ FunctorType2

Definition at line 62 of file NekSys.h.

◆ FunctorType2Array

Definition at line 64 of file NekSys.h.

◆ InArrayType

Definition at line 55 of file NekSys.h.

◆ OutArrayType

Definition at line 56 of file NekSys.h.

Constructor & Destructor Documentation

◆ NekSysOperators() [1/2]

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

Definition at line 68 of file NekSys.h.

◆ NekSysOperators() [2/2]

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

Definition at line 72 of file NekSys.h.

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

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

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

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

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

References m_functors2.

◆ DefineNekSysLhsEval()

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

Definition at line 107 of file NekSys.h.

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

References m_functors1.

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

◆ DefineNekSysPrecon()

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

Definition at line 114 of file NekSys.h.

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

References m_functors1.

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

◆ DefineNekSysResEval()

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

Definition at line 100 of file NekSys.h.

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

References m_functors1.

Referenced by Nektar::CFSImplicit::InitialiseNonlinSysSolver(), and Nektar::ShallowWaterSystem::InitialiseNonlinSysSolver().

◆ DoAssembleLoc()

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

Definition at line 162 of file NekSys.h.

164 {
165 ASSERTL1(m_functors1[3], "DoAssembleLoc should be defined");
166 m_functors1[3](xn, xn1, flag);
167 }
#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 169 of file NekSys.h.

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

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

151 {
152 if (m_functors1[2])
153 {
154 m_functors1[2](inarray, outarray, flag);
155 }
156 else
157 {
158 Vmath::Vcopy(outarray.size(), inarray, 1, outarray, 1);
159 }
160 }
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 135 of file NekSys.h.

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

References ASSERTL1, and m_functors1.

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

◆ operator=()

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

Definition at line 85 of file NekSys.h.

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

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

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

◆ nfunctor1

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

Definition at line 65 of file NekSys.h.

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

◆ nfunctor2

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

Definition at line 66 of file NekSys.h.

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