Nektar++
Public Member Functions | Private Attributes | List of all members
Nektar::Collections::CoalescedGeomData Class Reference

#include <CoalescedGeomData.h>

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

Constructor & Destructor Documentation

◆ CoalescedGeomData()

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

Definition at line 45 of file CoalescedGeomData.cpp.

46 {
47 }

◆ ~CoalescedGeomData()

Nektar::Collections::CoalescedGeomData::~CoalescedGeomData ( void  )
virtual

Definition at line 49 of file CoalescedGeomData.cpp.

50 {
51 }

Member Function Documentation

◆ GetDerivFactors()

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

Definition at line 150 of file CoalescedGeomData.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::eDerivFactors, Vmath::Fill(), Nektar::LocalRegions::Expansion::GetMetricInfo(), and Vmath::Vcopy().

152 {
153  if(m_twoDGeomData.count(eDerivFactors) == 0)
154  {
155  LibUtilities::PointsKeyVector ptsKeys = pCollExp[0]->GetPointsKeys();
156 
157  int nElmts = pCollExp.size();
158  const int coordim = pCollExp[0]->GetCoordim();
159  int dim = ptsKeys.size();
160 
161  // set up Cached Jacobians to be continuous
162  int npts = 1;
163  for (int i = 0; i < dim; ++i)
164  {
165  npts *= ptsKeys[i].GetNumPoints();
166  }
167 
168 
169  Array<TwoD, NekDouble> newDFac(dim*coordim,npts*nElmts);
170 
171  //copy Jacobians into a continuous list and set new chatched value
172  int cnt = 0;
173  for(int i = 0; i < nElmts; ++i)
174  {
175  const StdRegions::StdExpansion * sep = &(*pCollExp[i]);
176  const LocalRegions::Expansion * lep = dynamic_cast<const LocalRegions::Expansion*>( sep );
177 
178  const Array<TwoD, const NekDouble> Dfac = lep->GetMetricInfo()->GetDerivFactors( ptsKeys );
179 
180  if( lep->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed)
181  {
182  for (int j = 0; j < dim*coordim; ++j)
183  {
184  Vmath::Vcopy(npts, &Dfac[j][0], 1, &newDFac[j][cnt], 1);
185  }
186  }
187  else
188  {
189  for (int j = 0; j < dim*coordim; ++j)
190  {
191  Vmath::Fill(npts, Dfac[j][0], &newDFac[j][cnt], 1);
192  }
193  }
194  cnt += npts;
195  }
196 
197  m_twoDGeomData[eDerivFactors] = newDFac;
198  }
199 
201 }
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:246
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
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:1064
Geometry is curved or has non-constant factors.

◆ GetJac()

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

Definition at line 53 of file CoalescedGeomData.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::eJac, Vmath::Fill(), Nektar::LocalRegions::Expansion::GetMetricInfo(), and Vmath::Vcopy().

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

◆ GetJacWithStdWeights()

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

Definition at line 102 of file CoalescedGeomData.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::eJacWithStdWeights, Vmath::Fill(), Nektar::LocalRegions::Expansion::GetMetricInfo(), and Vmath::Vcopy().

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

Member Data Documentation

◆ m_oneDGeomData

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

Definition at line 70 of file CoalescedGeomData.h.

◆ m_twoDGeomData

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

Definition at line 71 of file CoalescedGeomData.h.