47 CoalescedGeomData::CoalescedGeomData(
void)
51 CoalescedGeomData::~CoalescedGeomData(
void)
56 vector<StdRegions::StdExpansionSharedPtr> &pCollExp)
59 if (m_oneDGeomData.count(
eJac) == 0)
63 int nElmts = pCollExp.size();
67 for (
int i = 0; i < ptsKeys.size(); ++i)
69 npts *= ptsKeys[i].GetNumPoints();
72 if (IsDeformed(pCollExp))
78 for (
int i = 0; i < nElmts; ++i)
92 m_oneDGeomData[
eJac] = newjac;
98 for (
int i = 0; i < nElmts; ++i)
109 m_oneDGeomData[
eJac] = newjac;
113 return m_oneDGeomData[
eJac];
116 const std::shared_ptr<VecVec_t> CoalescedGeomData::GetJacInterLeave(
117 vector<StdRegions::StdExpansionSharedPtr> &pCollExp,
int nElmt)
120 if (m_oneDGeomDataInterLeave.count(
eJac) == 0)
123 int jacsize = jac.size();
126 "Number of elements not divisible by vector "
127 "width, padding not yet implemented.");
128 int nBlocks = nElmt / vec_t::width;
136 for (
int i = 0; i < ptsKeys.size(); ++i)
138 nq *= ptsKeys[i].GetNumPoints();
141 if (IsDeformed(pCollExp))
144 newjac.resize(nBlocks * nq);
146 alignas(vec_t::alignment)
NekDouble tmp[vec_t::width];
148 for (
size_t block = 0; block < nBlocks; ++block)
150 size_t nblock_width = block * nq * vec_t::width;
151 for (
size_t q = 0; q < nq; q++)
153 for (
int j = 0; j < vec_t::width; ++j)
155 if (nblock_width + nq * j + q < jacsize)
157 tmp[j] = jac[nblock_width + nq * j + q];
166 newjac[block * nq + q].load(&tmp[0]);
172 newjac.resize(nBlocks);
174 alignas(vec_t::alignment)
NekDouble tmp[vec_t::width];
175 for (
size_t i = 0; i < nBlocks; ++i)
177 for (
int j = 0; j < vec_t::width; ++j)
179 if (vec_t::width * i + j < jacsize)
181 tmp[j] = jac[vec_t::width * i + j];
189 newjac[i].load(&tmp[0]);
193 m_oneDGeomDataInterLeave[
eJac] =
197 return m_oneDGeomDataInterLeave[
eJac];
201 vector<StdRegions::StdExpansionSharedPtr> &pCollExp)
206 int nElmts = pCollExp.size();
210 for (
int i = 0; i < ptsKeys.size(); ++i)
212 npts *= ptsKeys[i].GetNumPoints();
219 for (
int i = 0; i < nElmts; ++i)
237 pCollExp[0]->MultiplyByStdQuadratureMetric(newjac + cnt,
249 vector<StdRegions::StdExpansionSharedPtr> &pCollExp)
255 int nElmts = pCollExp.size();
256 const int coordim = pCollExp[0]->GetCoordim();
257 int dim = ptsKeys.size();
261 for (
int i = 0; i < dim; ++i)
263 npts *= ptsKeys[i].GetNumPoints();
268 if (IsDeformed(pCollExp))
279 for (
int i = 0; i < nElmts; ++i)
288 if (IsDeformed(pCollExp))
290 for (
int j = 0; j < dim * coordim; ++j)
292 Vmath::Vcopy(npts, &Dfac[j][0], 1, &newDFac[j][cnt], 1);
297 for (
int j = 0; j < dim * coordim; ++j)
299 newDFac[j][i] = Dfac[j][0];
311 const std::shared_ptr<VecVec_t> CoalescedGeomData::GetDerivFactorsInterLeave(
312 vector<StdRegions::StdExpansionSharedPtr> &pCollExp,
int nElmt)
317 "Number of elements not divisible by vector "
318 "width, padding not yet implemented.");
320 int nBlocks = nElmt / vec_t::width;
323 const int coordim = pCollExp[0]->GetCoordim();
324 int dim = ptsKeys.size();
326 unsigned int n_df = coordim * dim;
327 alignas(vec_t::alignment)
NekDouble vec[vec_t::width];
330 int dfsize = df.GetColumns();
335 for (
int i = 0; i < dim; ++i)
337 nq *= ptsKeys[i].GetNumPoints();
340 if (IsDeformed(pCollExp))
342 newdf.resize(nBlocks * n_df * nq);
343 auto *df_ptr = &newdf[0];
344 for (
int e = 0; e < nBlocks; ++e)
346 for (
int q = 0; q < nq; q++)
348 for (
int dir = 0; dir < n_df; ++dir, ++df_ptr)
350 for (
int j = 0; j < vec_t::width; ++j)
353 if ((vec_t::width * e + j) * nq + q < dfsize)
356 df[dir][(vec_t::width * e + j) * nq + q];
363 (*df_ptr).load(&vec[0]);
370 newdf.resize(nBlocks * n_df);
371 for (
int e = 0; e < nBlocks; ++e)
373 for (
int dir = 0; dir < n_df; ++dir)
375 for (
int j = 0; j < vec_t::width; ++j)
378 if (vec_t::width * e + j < dfsize)
380 vec[j] = df[dir][vec_t::width * e + j];
388 newdf[e * n_df + dir].load(&vec[0]);
400 bool CoalescedGeomData::IsDeformed(
401 vector<StdRegions::StdExpansionSharedPtr> &pCollExp)
403 if (!m_isDeformedSet)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
const SpatialDomains::GeomFactorsSharedPtr & GetMetricInfo() const
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
The base class for all shapes.
std::vector< vec_t, tinysimd::allocator< vec_t > > VecVec_t
std::vector< PointsKey > PointsKeyVector
@ eDeformed
Geometry is curved or has non-constant factors.
The above copyright notice and this permission notice shall be included.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)