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

#include <CoalescedGeomData.h>

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

Public Member Functions

 CoalescedGeomData (void)
 
virtual ~CoalescedGeomData (void)
 
const Array< OneD, const
NekDouble > & 
GetJac (std::vector< StdRegions::StdExpansionSharedPtr > &pColLExp)
 
const Array< OneD, const
NekDouble > & 
GetJacWithStdWeights (std::vector< StdRegions::StdExpansionSharedPtr > &pColLExp)
 
const Array< TwoD, const
NekDouble > & 
GetDerivFactors (std::vector< StdRegions::StdExpansionSharedPtr > &pColLExp)
 

Private Attributes

std::map< GeomData, Array
< OneD, NekDouble > > 
m_oneDGeomData
 
std::map< GeomData, Array
< TwoD, NekDouble > > 
m_twoDGeomData
 

Detailed Description

Definition at line 54 of file CoalescedGeomData.h.

Constructor & Destructor Documentation

Nektar::Collections::CoalescedGeomData::CoalescedGeomData ( void  )

Definition at line 44 of file CoalescedGeomData.cpp.

45 {
46 }
Nektar::Collections::CoalescedGeomData::~CoalescedGeomData ( void  )
virtual

Definition at line 48 of file CoalescedGeomData.cpp.

49 {
50 }

Member Function Documentation

const Array< TwoD, const NekDouble > & Nektar::Collections::CoalescedGeomData::GetDerivFactors ( std::vector< StdRegions::StdExpansionSharedPtr > &  pColLExp)

Definition at line 147 of file CoalescedGeomData.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::eDerivFactors, Vmath::Fill(), npts, and Vmath::Vcopy().

149 {
150  if(m_twoDGeomData.count(eDerivFactors) == 0)
151  {
152  LibUtilities::PointsKeyVector ptsKeys = pCollExp[0]->GetPointsKeys();
153 
154  int nElmts = pCollExp.size();
155  const int coordim = pCollExp[0]->GetCoordim();
156  int dim = ptsKeys.size();
157 
158  // set up Cached Jacobians to be continuous
159  int npts = 1;
160  for (int i = 0; i < dim; ++i)
161  {
162  npts *= ptsKeys[i].GetNumPoints();
163  }
164 
165 
166  Array<TwoD, NekDouble> newDFac(dim*coordim,npts*nElmts);
167 
168  //copy Jacobians into a continuous list and set new chatched value
169  int cnt = 0;
170  for(int i = 0; i < nElmts; ++i)
171  {
172  const Array<TwoD, const NekDouble> Dfac =
173  pCollExp[i]->GetMetricInfo()->GetDerivFactors(ptsKeys);
174 
175  if (pCollExp[i]->GetMetricInfo()->GetGtype() ==
177  {
178  for (int j = 0; j < dim*coordim; ++j)
179  {
180  Vmath::Vcopy(npts, &Dfac[j][0], 1, &newDFac[j][cnt], 1);
181  }
182  }
183  else
184  {
185  for (int j = 0; j < dim*coordim; ++j)
186  {
187  Vmath::Fill(npts, Dfac[j][0], &newDFac[j][cnt], 1);
188  }
189  }
190  cnt += npts;
191  }
192 
193  m_twoDGeomData[eDerivFactors] = newDFac;
194  }
195 
197 }
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:242
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:46
static std::string npts
Definition: InputFld.cpp:43
std::map< GeomData, Array< TwoD, NekDouble > > m_twoDGeomData
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
Geometry is curved or has non-constant factors.
const Array< OneD, const NekDouble > & Nektar::Collections::CoalescedGeomData::GetJac ( std::vector< StdRegions::StdExpansionSharedPtr > &  pColLExp)

Definition at line 52 of file CoalescedGeomData.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::eJac, Vmath::Fill(), npts, and Vmath::Vcopy().

54 {
55 
56  if(m_oneDGeomData.count(eJac) == 0)
57  {
58 
59  LibUtilities::PointsKeyVector ptsKeys = pCollExp[0]->GetPointsKeys();
60  int nElmts = pCollExp.size();
61 
62  // set up Cached Jacobians to be continuous
63  int npts = 1;
64  for (int i = 0; i < ptsKeys.size(); ++i)
65  {
66  npts *= ptsKeys[i].GetNumPoints();
67  }
68 
69 
70  Array<OneD, NekDouble> newjac(npts*nElmts);
71 
72  //copy Jacobians into a continuous list and set new chatched value
73  int cnt = 0;
74  for(int i = 0; i < nElmts; ++i)
75  {
76  const Array<OneD, const NekDouble> jac =
77  pCollExp[i]->GetMetricInfo()->GetJac(ptsKeys);
78 
79  if (pCollExp[i]->GetMetricInfo()->GetGtype() ==
81  {
82  Vmath::Vcopy(npts, &jac[0], 1, &newjac[cnt], 1);
83  }
84  else
85  {
86  Vmath::Fill(npts, jac[0], &newjac[cnt], 1);
87  }
88 
89  cnt += npts;
90  }
91 
92  m_oneDGeomData[eJac] = newjac;
93  }
94 
95  return m_oneDGeomData[eJac];
96 }
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:242
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:46
std::map< GeomData, Array< OneD, NekDouble > > m_oneDGeomData
static std::string npts
Definition: InputFld.cpp:43
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
Geometry is curved or has non-constant factors.
const Array< OneD, const NekDouble > & Nektar::Collections::CoalescedGeomData::GetJacWithStdWeights ( std::vector< StdRegions::StdExpansionSharedPtr > &  pColLExp)

Definition at line 100 of file CoalescedGeomData.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::eJacWithStdWeights, Vmath::Fill(), npts, and Vmath::Vcopy().

102 {
103  if(m_oneDGeomData.count(eJacWithStdWeights) == 0)
104  {
105  LibUtilities::PointsKeyVector ptsKeys = pCollExp[0]->GetPointsKeys();
106  int nElmts = pCollExp.size();
107 
108  // set up Cached Jacobians to be continuous
109  int npts = 1;
110  for (int i = 0; i < ptsKeys.size(); ++i)
111  {
112  npts *= ptsKeys[i].GetNumPoints();
113  }
114 
115 
116  Array<OneD, NekDouble> newjac(npts*nElmts), tmp;
117 
118  //copy Jacobians into a continuous list and set new chatched value
119  int cnt = 0;
120  for(int i = 0; i < nElmts; ++i)
121  {
122  const Array<OneD, const NekDouble> jac =
123  pCollExp[i]->GetMetricInfo()->GetJac(ptsKeys);
124 
125  if (pCollExp[i]->GetMetricInfo()->GetGtype() ==
127  {
128  Vmath::Vcopy(npts, &jac[0], 1, &newjac[cnt], 1);
129  }
130  else
131  {
132  Vmath::Fill(npts, jac[0], &newjac[cnt], 1);
133  }
134 
135  pCollExp[0]->MultiplyByStdQuadratureMetric(newjac + cnt,
136  tmp = newjac + cnt);
137  cnt += npts;
138  }
139 
141  }
142 
144 }
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:242
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:46
std::map< GeomData, Array< OneD, NekDouble > > m_oneDGeomData
static std::string npts
Definition: InputFld.cpp:43
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
Geometry is curved or has non-constant factors.

Member Data Documentation

std::map<GeomData,Array<OneD, NekDouble> > Nektar::Collections::CoalescedGeomData::m_oneDGeomData
private

Definition at line 71 of file CoalescedGeomData.h.

std::map<GeomData,Array<TwoD, NekDouble> > Nektar::Collections::CoalescedGeomData::m_twoDGeomData
private

Definition at line 72 of file CoalescedGeomData.h.