48 namespace LibUtilities
54 bool isVertex(
int i,
int j,
int npts){
55 return (i==0 && j==0) || (i==(npts-1) && j==0) || (i==0 && j==(npts-1));
58 bool isEdge(
int i,
int j,
int npts){
59 return i==0 || j==0 || i+j==npts-1;
62 bool isEdge_1(
int i,
int j,
int npts){
66 bool isEdge_2(
int i,
int j,
int npts){
80 for(
int i=0, index=0; i<
npts; ++i){
81 for(
int j=0; j<npts-i; ++j,++index){
121 boost::shared_ptr<NekMatrix<NekDouble> > mat =
122 m_util->GetInterpolationMatrix(xi);
123 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(),
143 returnval->Initialize();
156 vector<int> interiorPoints;
160 for(
int i=0, index=0; i<
npts; ++i){
161 for(
int j=0; j<npts-i; ++j,++index){
163 if( isVertex(i,j,npts) ) {
165 vertex.push_back(index);
167 }
else if( isEdge(i,j,npts) ) {
169 if(isEdge_1(i,j,npts)){
171 iEdge_1.push_back(index);
173 }
else if(isEdge_2(i,j,npts)){
175 iEdge_2.push_back(index);
180 iEdge_3.insert(iEdge_3.begin(), index);
185 interiorPoints.push_back(index);
192 for(
unsigned int k=0; k<vertex.size(); ++k){
194 map.push_back(vertex[k]);
197 for(
unsigned int k=0; k<iEdge_1.size(); ++k){
199 map.push_back(iEdge_1[k]);
202 for(
unsigned int k=0; k<iEdge_2.size(); ++k){
204 map.push_back(iEdge_2[k]);
207 for(
unsigned int k=0; k<iEdge_3.size(); ++k){
209 map.push_back(iEdge_3[k]);
212 for(
unsigned int k=0; k<interiorPoints.size(); ++k){
214 map.push_back(interiorPoints[k]);
221 for(
unsigned int index=0; index<map.size(); ++index){
222 points[0][index] =
m_points[0][index];
223 points[1][index] =
m_points[1][index];
226 for(
unsigned int index=0; index<map.size(); ++index){
227 m_points[0][index] = points[0][map[index]];
228 m_points[1][index] = points[1][map[index]];
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void CalculatePoints()
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
boost::shared_ptr< NodalUtilTriangle > m_util
MatrixSharedPtrType m_derivmatrix[3]
Array< OneD, DataType > m_points[3]
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, Array< OneD, NekDouble > &interp)
unsigned int GetNumPoints() const
Array< OneD, DataType > m_weights
Defines a specification for a set of points.
virtual void CalculateDerivMatrix()
unsigned int GetRows() const
void CalculateDerivMatrix()
void NodalPointReorder2d()
unsigned int GetTotNumPoints() const
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
static boost::shared_ptr< PointsBaseType > Create(const PointsKey &key)
Array< OneD, DataType > & GetPtr()
virtual void CalculateWeights()