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 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 DoNekSysFixPointIte (InArrayType &rhs, InArrayType &xn, OutArrayType &xn1, const bool &flag=false) const
 

Static Public Attributes

static const int nfunctor1 = 3
 
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.

70  {
71  }

◆ 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

◆ DefineNekSysFixPointIte()

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

Definition at line 121 of file NekSys.h.

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

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::CFSImplicit::InitialiseNonlinSysSolver(), and Nektar::MultiRegions::GlobalLinSysIterative::v_SolveLinearSystem().

◆ 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::CFSImplicit::InitialiseNonlinSysSolver(), and Nektar::MultiRegions::GlobalLinSysIterative::v_SolveLinearSystem().

◆ 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().

◆ DoNekSysFixPointIte()

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

Definition at line 155 of file NekSys.h.

158  {
159  ASSERTL1(m_functors2[0], "DoNekSysFixPointIte should be defined");
160  m_functors2[0](rhs, xn, xn1, flag);
161  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250

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

144  {
145  if (m_functors1[2])
146  {
147  m_functors1[2](inarray, outarray, flag);
148  }
149  else
150  {
151  Vmath::Vcopy(outarray.size(), inarray, 1, outarray, 1);
152  }
153  }
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199

References m_functors1, and Vmath::Vcopy().

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

◆ DoNekSysResEval()

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

Definition at line 128 of file NekSys.h.

130  {
131  ASSERTL1(m_functors1[0], "DoNekSysResEval should be defined");
132  m_functors1[0](inarray, outarray, flag);
133  }

References ASSERTL1, and m_functors1.

Referenced by Nektar::LibUtilities::NekNonlinSysNewton::v_SetupNekNonlinSystem(), and Nektar::LibUtilities::NekNonlinSysNewton::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 184 of file NekSys.h.

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

◆ nfunctor1

const int Nektar::LibUtilities::NekSysOperators::nfunctor1 = 3
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=().