48bool isVertex(
size_t i,
size_t j,
size_t npts)
50 return (i == 0 && j == 0) || (i == (npts - 1) && j == 0) ||
51 (i == 0 && j == (npts - 1));
54bool isEdge(
size_t i,
size_t j,
size_t npts)
56 return i == 0 || j == 0 || i + j == npts - 1;
59bool isEdge_1(
size_t i, [[maybe_unused]]
size_t j, [[maybe_unused]]
size_t npts)
64bool isEdge_2(
size_t i,
size_t j,
size_t npts)
66 return i + j == npts - 1;
78 for (
size_t i = 0, index = 0; i < npts; ++i)
80 for (
size_t j = 0; j < npts - i; ++j, ++index)
118 std::shared_ptr<NekMatrix<NekDouble>> mat =
119 m_util->GetInterpolationMatrix(xi);
120 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
130 PointsBaseType::v_CalculateDerivMatrix();
139 std::shared_ptr<PointsBaseType> returnval(
142 returnval->Initialize();
155 vector<int> interiorPoints;
159 for (
size_t i = 0, index = 0; i < npts; ++i)
161 for (
size_t j = 0; j < npts - i; ++j, ++index)
164 if (isVertex(i, j, npts))
167 vertex.push_back(index);
169 else if (isEdge(i, j, npts))
172 if (isEdge_1(i, j, npts))
175 iEdge_1.push_back(index);
177 else if (isEdge_2(i, j, npts))
180 iEdge_2.push_back(index);
185 iEdge_3.insert(iEdge_3.begin(), index);
191 interiorPoints.push_back(index);
198 for (
size_t k = 0; k < vertex.size(); ++k)
201 map.push_back(vertex[k]);
204 for (
size_t k = 0; k < iEdge_1.size(); ++k)
207 map.push_back(iEdge_1[k]);
210 for (
size_t k = 0; k < iEdge_2.size(); ++k)
213 map.push_back(iEdge_2[k]);
216 for (
size_t k = 0; k < iEdge_3.size(); ++k)
219 map.push_back(iEdge_3[k]);
222 for (
size_t k = 0; k < interiorPoints.size(); ++k)
225 map.push_back(interiorPoints[k]);
231 for (
size_t index = 0; index < map.size(); ++index)
233 points[0][index] =
m_points[0][index];
234 points[1][index] =
m_points[1][index];
237 for (
size_t index = 0; index < map.size(); ++index)
239 m_points[0][index] = points[0][map[index]];
240 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...
void v_CalculateWeights() final
static bool initPointsManager[]
std::shared_ptr< NodalUtilTriangle > m_util
void v_CalculatePoints() 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)
void v_CalculateDerivMatrix() 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)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)