Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
Nektar::LibUtilities::NodalPrismEvenlySpaced Class Reference

#include <NodalPrismEvenlySpaced.h>

Inheritance diagram for Nektar::LibUtilities::NodalPrismEvenlySpaced:
Inheritance graph
[legend]
Collaboration diagram for Nektar::LibUtilities::NodalPrismEvenlySpaced:
Collaboration graph
[legend]

Public Member Functions

virtual ~NodalPrismEvenlySpaced ()
 NodalPrismEvenlySpaced (const PointsKey &key)
const MatrixSharedPtrType GetI (const PointsKey &pkey)
const MatrixSharedPtrType GetI (const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z)
- Public Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual ~Points ()
virtual void Initialize (void)
unsigned int GetPointsDim () const
unsigned int GetNumPoints () const
unsigned int GetTotNumPoints () const
PointsType GetPointsType () const
const Array< OneD, const
DataType > & 
GetZ () const
const Array< OneD, const
DataType > & 
GetW () const
void GetZW (Array< OneD, const DataType > &z, Array< OneD, const DataType > &w) const
void GetPoints (Array< OneD, const DataType > &x) const
void GetPoints (Array< OneD, const DataType > &x, Array< OneD, const DataType > &y) const
void GetPoints (Array< OneD, const DataType > &x, Array< OneD, const DataType > &y, Array< OneD, const DataType > &z) const
const MatrixSharedPtrTypeGetD (Direction dir=xDir) const
virtual const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x)
virtual const MatrixSharedPtrType GetI (unsigned int numpoints, const Array< OneD, const DataType > &x)
virtual const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y)
virtual const MatrixSharedPtrType GetGalerkinProjection (const PointsKey &pkey)

Static Public Member Functions

static boost::shared_ptr
< PointsBaseType
Create (const PointsKey &key)

Private Member Functions

 NodalPrismEvenlySpaced ()
 Default constructor should not be called except by Create matrix.
void CalculatePoints ()
void CalculateWeights ()
void CalculateDerivMatrix ()
void NodalPointReorder3d ()
void CalculateInterpMatrix (const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)

Additional Inherited Members

- Public Types inherited from Nektar::LibUtilities::Points< NekDouble >
typedef NekDouble DataType
typedef boost::shared_ptr
< NekMatrix< DataType > > 
MatrixSharedPtrType
- Protected Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual void CalculatePoints ()
virtual void CalculateWeights ()
virtual void CalculateDerivMatrix ()
 Points (const PointsKey &key)
- Protected Attributes inherited from Nektar::LibUtilities::Points< NekDouble >
PointsKey m_pointsKey
Array< OneD, DataTypem_points [3]
Array< OneD, DataTypem_weights
MatrixSharedPtrType m_derivmatrix [3]
NekManager< PointsKey,
NekMatrix< DataType >
, PointsKey::opLess
m_InterpManager
NekManager< PointsKey,
NekMatrix< DataType >
, PointsKey::opLess
m_GalerkinProjectionManager

Detailed Description

Definition at line 52 of file NodalPrismEvenlySpaced.h.

Constructor & Destructor Documentation

virtual Nektar::LibUtilities::NodalPrismEvenlySpaced::~NodalPrismEvenlySpaced ( )
inlinevirtual

Definition at line 55 of file NodalPrismEvenlySpaced.h.

{
}
Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( const PointsKey key)
inline

Definition at line 60 of file NodalPrismEvenlySpaced.h.

{
}
Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( )
inlineprivate

Default constructor should not be called except by Create matrix.

Definition at line 96 of file NodalPrismEvenlySpaced.h.

Member Function Documentation

void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateDerivMatrix ( )
private

Definition at line 388 of file NodalPrismEvenlySpaced.cpp.

{
}
void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateInterpMatrix ( const Array< OneD, const NekDouble > &  xi,
const Array< OneD, const NekDouble > &  yi,
const Array< OneD, const NekDouble > &  zi,
Array< OneD, NekDouble > &  interp 
)
private

Definition at line 378 of file NodalPrismEvenlySpaced.cpp.

References ASSERTL0.

Referenced by GetI().

{
ASSERTL0(false, "Not yet implemented");
}
void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculatePoints ( )
private

Definition at line 145 of file NodalPrismEvenlySpaced.cpp.

References Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, NodalPointReorder3d(), and npts.

{
// Allocate the storage for points
// Populate m_points
unsigned int npts = GetNumPoints();
NekDouble delta = 2.0/(npts - 1.0);
for(unsigned int z=0, index=0; z<npts; ++z){
for(int y=0; y<npts; ++y){
for(int x=0; x<npts-z; ++x, ++index){
NekDouble xi = -1.0 + x*delta;
NekDouble yi = -1.0 + y*delta;
NekDouble zi = -1.0 + z*delta;
m_points[0][index] = xi;
m_points[1][index] = yi;
m_points[2][index] = zi;
}
}
}
}
void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateWeights ( )
private

Definition at line 370 of file NodalPrismEvenlySpaced.cpp.

{
}
boost::shared_ptr< PointsBaseType > Nektar::LibUtilities::NodalPrismEvenlySpaced::Create ( const PointsKey key)
static

Definition at line 393 of file NodalPrismEvenlySpaced.cpp.

{
boost::shared_ptr<PointsBaseType> returnval(MemoryManager<NodalPrismEvenlySpaced>::AllocateSharedPtr(key));
returnval->Initialize();
return returnval;
}
const MatrixSharedPtrType Nektar::LibUtilities::NodalPrismEvenlySpaced::GetI ( const PointsKey pkey)
inlinevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 68 of file NodalPrismEvenlySpaced.h.

References ASSERTL0, Nektar::LibUtilities::PointsKey::GetPointsDim(), and Nektar::LibUtilities::PointsManager().

{
ASSERTL0(pkey.GetPointsDim() == 3,
"NodalPrismEvenlySpaced Points can only interp to "
"other 3d point distributions");
Array<OneD, const NekDouble> x, y, z;
PointsManager()[pkey]->GetPoints(x, y, z);
return GetI(x, y, z);
}
const MatrixSharedPtrType Nektar::LibUtilities::NodalPrismEvenlySpaced::GetI ( const Array< OneD, const NekDouble > &  x,
const Array< OneD, const NekDouble > &  y,
const Array< OneD, const NekDouble > &  z 
)
inlinevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 78 of file NodalPrismEvenlySpaced.h.

References CalculateInterpMatrix(), and Nektar::LibUtilities::Points< NekDouble >::GetTotNumPoints().

{
int numpoints = x.num_elements();
unsigned int np = GetTotNumPoints();
Array<OneD, NekDouble> interp(GetTotNumPoints()*numpoints);
CalculateInterpMatrix(x, y, z, interp);
NekDouble* d = interp.data();
return MemoryManager<NekMatrix<NekDouble> >
::AllocateSharedPtr(numpoints, np, d);
}
void Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPointReorder3d ( )
private

Definition at line 170 of file NodalPrismEvenlySpaced.cpp.

References Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::GetTotNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, and npts.

Referenced by CalculatePoints().

{
unsigned int npts = GetNumPoints();
using std::vector;
vector<int> vertex;
vector<int> iEdge_01; // interior edge 0
vector<int> iEdge_12; // interior edge 1
vector<int> iEdge_23; // interior edge 2
vector<int> iEdge_30; // interior edge 3
vector<int> iEdge_04; // interior edge 4
vector<int> iEdge_14; // interior edge 5
vector<int> iEdge_25; // interior edge 6
vector<int> iEdge_35; // interior edge 7
vector<int> iEdge_45; // interior edge 8
vector<int> iFace_0123; // interior face 0
vector<int> iFace_014; // interior face 1
vector<int> iFace_1254; // interior face 2
vector<int> iFace_325; // interior face 3
vector<int> iFace_0354; // interior face 4
vector<int> interiorVolumePoints; // interior volume points
vector<int> map;
// Build the lattice prism left to right - bottom to top
for(int z=0, index=0; z<npts; ++z){
for(int y=0; y<npts; ++y){
for(int x=0; x<npts-z; ++x, ++index){
if (isVertex(x,y,z,npts))
{
vertex.push_back(index);
}
else if (isEdge(x,y,z,npts))
{
if (isEdge_01(x,y,z,npts))
{
iEdge_01.push_back(index);
}
else if (isEdge_12(x,y,z,npts))
{
iEdge_12.push_back(index);
}
else if (isEdge_23(x,y,z,npts))
{
iEdge_23.push_back(index);
}
else if (isEdge_30(x,y,z,npts))
{
iEdge_30.push_back(index);
}
else if (isEdge_04(x,y,z,npts))
{
iEdge_04.push_back(index);
}
else if (isEdge_14(x,y,z,npts))
{
iEdge_14.push_back(index);
}
else if (isEdge_25(x,y,z,npts))
{
iEdge_25.push_back(index);
}
else if (isEdge_35(x,y,z,npts))
{
iEdge_35.push_back(index);
}
else if (isEdge_45(x,y,z,npts))
{
iEdge_45.push_back(index);
}
}
else if (isFace(x,y,z,npts))
{
if (isFace_0123(x,y,z,npts))
{
iFace_0123.push_back(index);
}
else if (isFace_014(x,y,z,npts))
{
iFace_014.push_back(index);
}
else if (isFace_1254(x,y,z,npts))
{
iFace_1254.push_back(index);
}
else if (isFace_325(x,y,z,npts))
{
iFace_325.push_back(index);
}
else if (isFace_0354(x,y,z,npts))
{
iFace_0354.push_back(index);
}
}
else
{
interiorVolumePoints.push_back(index);
}
}
}
}
for (unsigned int n=0; n<vertex.size(); ++n)
{
map.push_back(vertex[n]);
}
for (unsigned int n=0; n<iEdge_01.size(); ++n)
{
map.push_back(iEdge_01[n]);
}
for (unsigned int n=0; n<iEdge_12.size(); ++n)
{
map.push_back(iEdge_12[n]);
}
for (unsigned int n=0; n<iEdge_23.size(); ++n)
{
map.push_back(iEdge_23[n]);
}
for (unsigned int n=0; n<iEdge_30.size(); ++n)
{
map.push_back(iEdge_30[n]);
}
for (unsigned int n=0; n<iEdge_04.size(); ++n)
{
map.push_back(iEdge_04[n]);
}
for (unsigned int n=0; n<iEdge_14.size(); ++n)
{
map.push_back(iEdge_14[n]);
}
for (unsigned int n=0; n<iEdge_25.size(); ++n)
{
map.push_back(iEdge_25[n]);
}
for (unsigned int n=0; n<iEdge_35.size(); ++n)
{
map.push_back(iEdge_35[n]);
}
for (unsigned int n=0; n<iEdge_45.size(); ++n)
{
map.push_back(iEdge_45[n]);
}
for (unsigned int n=0; n<iFace_0123.size(); ++n)
{
map.push_back(iFace_0123[n]);
}
for (unsigned int n=0; n<iFace_014.size(); ++n)
{
map.push_back(iFace_014[n]);
}
for(unsigned int n=0; n<iFace_1254.size(); ++n)
{
map.push_back(iFace_1254[n]);
}
for(unsigned int n=0; n<iFace_325.size(); ++n)
{
map.push_back(iFace_325[n]);
}
for(unsigned int n=0; n<iFace_0354.size(); ++n)
{
map.push_back(iFace_0354[n]);
}
for(unsigned int n=0; n<interiorVolumePoints.size(); ++n)
{
map.push_back(interiorVolumePoints[n]);
}
Array<OneD, NekDouble> points[3];
points[0] = Array<OneD, NekDouble>(GetTotNumPoints());
points[1] = Array<OneD, NekDouble>(GetTotNumPoints());
points[2] = Array<OneD, NekDouble>(GetTotNumPoints());
for(unsigned int index=0; index<map.size(); ++index)
{
points[0][index] = m_points[0][index];
points[1][index] = m_points[1][index];
points[2][index] = m_points[2][index];
}
for(unsigned int index=0; index<map.size(); ++index)
{
m_points[0][index] = points[0][map[index]];
m_points[1][index] = points[1][map[index]];
m_points[2][index] = points[2][map[index]];
}
}