35 #include <boost/core/ignore_unused.hpp>
47 namespace LibUtilities
57 bool isVertex(
int i,
int j,
int npts)
59 return (i == 0 && j == 0) || (i == (npts - 1) && j == 0) ||
60 (i == 0 && j == (npts - 1));
63 bool isEdge(
int i,
int j,
int npts)
65 return i == 0 || j == 0 || i + j == npts - 1;
68 bool isEdge_1(
int i,
int j,
int npts)
70 boost::ignore_unused(j, npts);
74 bool isEdge_2(
int i,
int j,
int npts)
76 return i + j == npts - 1;
88 for (
int i = 0, index = 0; i < npts; ++i)
90 for (
int j = 0; j < npts - i; ++j, ++index)
128 std::shared_ptr<NekMatrix<NekDouble>> mat =
129 m_util->GetInterpolationMatrix(xi);
130 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
149 std::shared_ptr<PointsBaseType> returnval(
152 returnval->Initialize();
165 vector<int> interiorPoints;
169 for (
int i = 0, index = 0; i < npts; ++i)
171 for (
int j = 0; j < npts - i; ++j, ++index)
174 if (isVertex(i, j, npts))
177 vertex.push_back(index);
179 else if (isEdge(i, j, npts))
182 if (isEdge_1(i, j, npts))
185 iEdge_1.push_back(index);
187 else if (isEdge_2(i, j, npts))
190 iEdge_2.push_back(index);
195 iEdge_3.insert(iEdge_3.begin(), index);
201 interiorPoints.push_back(index);
208 for (
unsigned int k = 0; k < vertex.size(); ++k)
211 map.push_back(vertex[k]);
214 for (
unsigned int k = 0; k < iEdge_1.size(); ++k)
217 map.push_back(iEdge_1[k]);
220 for (
unsigned int k = 0; k < iEdge_2.size(); ++k)
223 map.push_back(iEdge_2[k]);
226 for (
unsigned int k = 0; k < iEdge_3.size(); ++k)
229 map.push_back(iEdge_3[k]);
232 for (
unsigned int k = 0; k < interiorPoints.size(); ++k)
235 map.push_back(interiorPoints[k]);
241 for (
unsigned int index = 0; index < map.size(); ++index)
243 points[0][index] =
m_points[0][index];
244 points[1][index] =
m_points[1][index];
247 for (
unsigned int index = 0; index < map.size(); ++index)
249 m_points[0][index] = points[0][map[index]];
250 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_CalculatePoints() override
virtual void v_CalculateDerivMatrix() override
virtual void v_CalculateWeights() override
static bool initPointsManager[]
std::shared_ptr< NodalUtilTriangle > m_util
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)
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()
unsigned int GetNumPoints() const
unsigned int GetTotNumPoints() const
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
virtual void v_CalculateDerivMatrix()
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.
Array< OneD, DataType > & GetPtr()
unsigned int GetRows() const
PointsManagerT & PointsManager(void)
@ eNodalTriEvenlySpaced
2D Evenly-spaced points on a Triangle
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)