35#include <boost/core/ignore_unused.hpp>
52bool isVertex(
size_t i,
size_t j,
size_t npts)
54 return (i == 0 && j == 0) || (i == (npts - 1) && j == 0) ||
55 (i == 0 && j == (npts - 1));
58bool isEdge(
size_t i,
size_t j,
size_t npts)
60 return i == 0 || j == 0 || i + j == npts - 1;
63bool isEdge_1(
size_t i,
size_t j,
size_t npts)
65 boost::ignore_unused(j, npts);
69bool isEdge_2(
size_t i,
size_t j,
size_t npts)
71 return i + j == npts - 1;
83 for (
size_t i = 0, index = 0; i < npts; ++i)
85 for (
size_t j = 0; j < npts - i; ++j, ++index)
123 std::shared_ptr<NekMatrix<NekDouble>> mat =
124 m_util->GetInterpolationMatrix(xi);
125 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
135 PointsBaseType::v_CalculateDerivMatrix();
144 std::shared_ptr<PointsBaseType> returnval(
147 returnval->Initialize();
160 vector<int> interiorPoints;
164 for (
size_t i = 0, index = 0; i < npts; ++i)
166 for (
size_t j = 0; j < npts - i; ++j, ++index)
169 if (isVertex(i, j, npts))
172 vertex.push_back(index);
174 else if (isEdge(i, j, npts))
177 if (isEdge_1(i, j, npts))
180 iEdge_1.push_back(index);
182 else if (isEdge_2(i, j, npts))
185 iEdge_2.push_back(index);
190 iEdge_3.insert(iEdge_3.begin(), index);
196 interiorPoints.push_back(index);
203 for (
size_t k = 0; k < vertex.size(); ++k)
206 map.push_back(vertex[k]);
209 for (
size_t k = 0; k < iEdge_1.size(); ++k)
212 map.push_back(iEdge_1[k]);
215 for (
size_t k = 0; k < iEdge_2.size(); ++k)
218 map.push_back(iEdge_2[k]);
221 for (
size_t k = 0; k < iEdge_3.size(); ++k)
224 map.push_back(iEdge_3[k]);
227 for (
size_t k = 0; k < interiorPoints.size(); ++k)
230 map.push_back(interiorPoints[k]);
236 for (
size_t index = 0; index < map.size(); ++index)
238 points[0][index] =
m_points[0][index];
239 points[1][index] =
m_points[1][index];
242 for (
size_t index = 0; index < map.size(); ++index)
244 m_points[0][index] = points[0][map[index]];
245 m_points[1][index] = points[1][map[index]];
bool RegisterCreator(const KeyType &key, const CreateFuncType &createFunc)
Register the given function and associate it with the key. The return value is just to facilitate cal...
virtual void v_CalculateDerivMatrix() override final
static bool initPointsManager[]
std::shared_ptr< NodalUtilTriangle > m_util
virtual void v_CalculateWeights() override final
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
void NodalPointReorder2d()
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, Array< OneD, NekDouble > &interp)
virtual void v_CalculatePoints() override final
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
MatrixSharedPtrType m_derivmatrix[3]
Derivative matrices.
virtual void v_CalculatePoints()
size_t GetNumPoints() const
size_t GetTotNumPoints() const
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
virtual void v_CalculateWeights()
Defines a specification for a set of points.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
PointsManagerT & PointsManager(void)
@ eNodalTriEvenlySpaced
2D Evenly-spaced points on a Triangle
std::vector< double > w(NPUPPER)
The above copyright notice and this permission notice shall be included.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)