Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Nektar::Collections::Collection Class Reference

Collection. More...

#include <Collection.h>

Collaboration diagram for Nektar::Collections::Collection:
Collaboration graph
[legend]

Public Member Functions

COLLECTIONS_EXPORT Collection (std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, OperatorImpMap &impTypes)
 
void ApplyOperator (const OperatorType &op, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &output)
 
void ApplyOperator (const OperatorType &op, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1)
 
void ApplyOperator (const OperatorType &op, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2)
 
void ApplyOperator (const OperatorType &op, int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &output)
 
bool HasOperator (const OperatorType &op)
 

Protected Attributes

StdRegions::StdExpansionSharedPtr m_stdExp
 
std::vector
< SpatialDomains::GeometrySharedPtr
m_geom
 
boost::unordered_map
< OperatorType,
OperatorSharedPtr
m_ops
 
CoalescedGeomDataSharedPtr m_geomData
 

Detailed Description

Collection.

Definition at line 56 of file Collection.h.

Constructor & Destructor Documentation

Nektar::Collections::Collection::Collection ( std::vector< StdRegions::StdExpansionSharedPtr pCollExp,
OperatorImpMap impTypes 
)

Definition at line 47 of file Collection.cpp.

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::Collections::GetOperatorFactory(), Nektar::iterator, and Nektar::Collections::SIZE_OperatorType.

50 {
52 
53  // Initialise geometry data.
55 
56  // Loop over all operator types.
57  for (int i = 0; i < SIZE_OperatorType; ++i)
58  {
59  OperatorType opType = (OperatorType)i;
60  ImplementationType impType;
61 
62  if ((it = impTypes.find(opType)) != impTypes.end())
63  {
64  impType = it->second;
65  OperatorKey opKey(pCollExp[0]->DetShapeType(), opType, impType,
66  pCollExp[0]->IsNodalNonTensorialExp());
67 
68  stringstream ss;
69  ss << opKey;
70  ASSERTL0(GetOperatorFactory().ModuleExists(opKey),
71  "Requested unknown operator "+ss.str());
72 
74  opKey, pCollExp, m_geomData);
75  }
76  }
77 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
CoalescedGeomDataSharedPtr m_geomData
Definition: Collection.h:94
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
Definition: Operator.h:159
boost::unordered_map< OperatorType, OperatorSharedPtr > m_ops
Definition: Collection.h:93
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:110
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator

Member Function Documentation

void Nektar::Collections::Collection::ApplyOperator ( const OperatorType op,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  output 
)
inline

Definition at line 105 of file Collection.h.

References m_ops, and Nektar::NullNekDouble1DArray.

109 {
110  Array<OneD, NekDouble> wsp(m_ops[op]->GetWspSize());
111  (*m_ops[op])(inarray, output, NullNekDouble1DArray,
112  NullNekDouble1DArray, wsp);
113 }
static Array< OneD, NekDouble > NullNekDouble1DArray
boost::unordered_map< OperatorType, OperatorSharedPtr > m_ops
Definition: Collection.h:93
void Nektar::Collections::Collection::ApplyOperator ( const OperatorType op,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1 
)
inline

Definition at line 119 of file Collection.h.

References m_ops, and Nektar::NullNekDouble1DArray.

124 {
125  Array<OneD, NekDouble> wsp(m_ops[op]->GetWspSize());
126  (*m_ops[op])(inarray, output0, output1, NullNekDouble1DArray, wsp);
127 }
static Array< OneD, NekDouble > NullNekDouble1DArray
boost::unordered_map< OperatorType, OperatorSharedPtr > m_ops
Definition: Collection.h:93
void Nektar::Collections::Collection::ApplyOperator ( const OperatorType op,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1,
Array< OneD, NekDouble > &  output2 
)
inline

Definition at line 133 of file Collection.h.

References m_ops.

139 {
140  Array<OneD, NekDouble> wsp(m_ops[op]->GetWspSize());
141  (*m_ops[op])(inarray, output0, output1, output2, wsp);
142 }
boost::unordered_map< OperatorType, OperatorSharedPtr > m_ops
Definition: Collection.h:93
void Nektar::Collections::Collection::ApplyOperator ( const OperatorType op,
int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  output 
)
inline

Definition at line 147 of file Collection.h.

References m_ops.

152 {
153  Array<OneD, NekDouble> wsp(m_ops[op]->GetWspSize());
154  (*m_ops[op])(dir, inarray, output, wsp);
155 }
boost::unordered_map< OperatorType, OperatorSharedPtr > m_ops
Definition: Collection.h:93
bool Nektar::Collections::Collection::HasOperator ( const OperatorType op)
inline

Definition at line 157 of file Collection.h.

References m_ops.

158 {
159  return (m_ops.find(op) != m_ops.end());
160 }
boost::unordered_map< OperatorType, OperatorSharedPtr > m_ops
Definition: Collection.h:93

Member Data Documentation

std::vector<SpatialDomains::GeometrySharedPtr> Nektar::Collections::Collection::m_geom
protected

Definition at line 92 of file Collection.h.

CoalescedGeomDataSharedPtr Nektar::Collections::Collection::m_geomData
protected

Definition at line 94 of file Collection.h.

boost::unordered_map<OperatorType, OperatorSharedPtr> Nektar::Collections::Collection::m_ops
protected

Definition at line 93 of file Collection.h.

Referenced by ApplyOperator(), and HasOperator().

StdRegions::StdExpansionSharedPtr Nektar::Collections::Collection::m_stdExp
protected

Definition at line 91 of file Collection.h.