35 #include <boost/core/ignore_unused.hpp>
49 namespace LibUtilities
59 bool isVertex(
int i,
int j,
int npts){
60 return (i==0 && j==0) || (i==(npts-1) && j==0) || (i==0 && j==(npts-1));
63 bool isEdge(
int i,
int j,
int npts){
64 return i==0 || j==0 || i+j==npts-1;
67 bool isEdge_1(
int i,
int j,
int npts){
68 boost::ignore_unused(j, npts);
72 bool isEdge_2(
int i,
int j,
int npts){
86 for(
int i=0, index=0; i<npts; ++i){
87 for(
int j=0; j<npts-i; ++j,++index){
127 std::shared_ptr<NekMatrix<NekDouble> > mat =
128 m_util->GetInterpolationMatrix(xi);
129 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(),
149 returnval->Initialize();
162 vector<int> interiorPoints;
166 for(
int i=0, index=0; i<npts; ++i){
167 for(
int j=0; j<npts-i; ++j,++index){
169 if( isVertex(i,j,npts) ) {
171 vertex.push_back(index);
173 }
else if( isEdge(i,j,npts) ) {
175 if(isEdge_1(i,j,npts)){
177 iEdge_1.push_back(index);
179 }
else if(isEdge_2(i,j,npts)){
181 iEdge_2.push_back(index);
186 iEdge_3.insert(iEdge_3.begin(), index);
191 interiorPoints.push_back(index);
198 for(
unsigned int k=0; k<vertex.size(); ++k){
200 map.push_back(vertex[k]);
203 for(
unsigned int k=0; k<iEdge_1.size(); ++k){
205 map.push_back(iEdge_1[k]);
208 for(
unsigned int k=0; k<iEdge_2.size(); ++k){
210 map.push_back(iEdge_2[k]);
213 for(
unsigned int k=0; k<iEdge_3.size(); ++k){
215 map.push_back(iEdge_3[k]);
218 for(
unsigned int k=0; k<interiorPoints.size(); ++k){
220 map.push_back(interiorPoints[k]);
227 for(
unsigned int index=0; index<map.size(); ++index){
228 points[0][index] =
m_points[0][index];
229 points[1][index] =
m_points[1][index];
232 for(
unsigned int index=0; index<map.size(); ++index){
233 m_points[0][index] = points[0][map[index]];
234 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...
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)
void CalculateDerivMatrix()
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 CalculateWeights()
virtual void CalculateDerivMatrix()
unsigned int GetNumPoints() const
virtual void CalculatePoints()
unsigned int GetTotNumPoints() const
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
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)