Commit e51cfabb authored by Alessandro Bolis's avatar Alessandro Bolis
Browse files

Moved 1D, 2D and 3D orientations to be defined

via a unique enumeration in Stdregions.hpp.
Added a new class to manage index maps. Compiling but not tested


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3821 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 9e2632f2
......@@ -197,7 +197,7 @@ int main(int argc, char *argv[])
QuadGeomSharedPtr faces[nFaces];
for( int i = 0; i < nFaces; ++i ) {
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for( int j = 0; j < 4; ++j ) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
......
......@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
if(f == 1 || f == 3) {
int i = triId[f];
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for(int j = 0; j < 3; ++j){
edgeArray[j] = edges[triEdgeConnectivity[i][j]];
eorientArray[j] = isTriEdgeFlipped[i][j] ? eBackwards : eForwards;
......@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
else {
int i = quadId[f];
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for(int j=0; j < 4; ++j){
edgeArray[j] = edges[quadEdgeConnectivity[i][j]];
eorientArray[j] = isQuadEdgeFlipped[i][j] ? eBackwards : eForwards;
......
......@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
StdRegions::StdExpansion2D *E;
Array<OneD, NekDouble> sol;
Array<OneD, NekDouble> coords(8);
StdRegions::EdgeOrientation edgeDir = StdRegions::eForwards;
StdRegions::Orientation edgeDir = StdRegions::eForwards;
if((argc != 16)&&(argc != 14))
......@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,verts[1],verts[2]);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[0]);
StdRegions::EdgeOrientation eorient[3];
StdRegions::Orientation eorient[3];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
......@@ -258,7 +258,7 @@ int main(int argc, char *argv[])
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[3]);
edges[3] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(three,verts[3],verts[0]);
StdRegions::EdgeOrientation eorient[4];
StdRegions::Orientation eorient[4];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
......
......@@ -460,7 +460,7 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
QuadGeomSharedPtr faces[nFaces];
for( int i = 0; i < nFaces; ++i ) {
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for( int j = 0; j < 4; ++j ) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
......@@ -554,7 +554,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
if (i == 1 || i == 3)
{
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for (int j = 0; j < 3; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
......@@ -567,7 +567,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
else
{
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for (int j = 0; j < 4; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
......@@ -645,7 +645,7 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
TriGeomSharedPtr faces[nFaces];
for(int i=0; i < nFaces; ++i){
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for(int j=0; j < 3; ++j){
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
......
......@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
StdRegions::StdExpansion2D *E;
Array<OneD, NekDouble> sol,x,y,dx,dy;
Array<OneD, NekDouble> coords(8);
StdRegions::EdgeOrientation edgeDir = StdRegions::eForwards;
StdRegions::Orientation edgeDir = StdRegions::eForwards;
if((argc != 16)&&(argc != 14))
......@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,verts[1],verts[2]);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[0]);
StdRegions::EdgeOrientation eorient[3];
StdRegions::Orientation eorient[3];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
......@@ -269,7 +269,7 @@ int main(int argc, char *argv[])
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[3]);
edges[3] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(three,verts[3],verts[0]);
StdRegions::EdgeOrientation eorient[4];
StdRegions::Orientation eorient[4];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
......
......@@ -617,7 +617,7 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
QuadGeomSharedPtr faces[nFaces];
for( int i = 0; i < nFaces; ++i ) {
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for( int j = 0; j < 4; ++j ) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
......@@ -712,7 +712,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
if (i == 1 || i == 3)
{
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for (int j = 0; j < 3; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
......@@ -725,7 +725,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
else
{
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for (int j = 0; j < 4; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
......@@ -803,7 +803,7 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
TriGeomSharedPtr faces[nFaces];
for(int i=0; i < nFaces; ++i){
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for(int j=0; j < 3; ++j){
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
......
......@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
if(f==0){
int i = quadId[f];
SegGeomSharedPtr edgeArray[4];
EdgeOrientation eorientArray[4];
Orientation eorientArray[4];
for(int j=0; j < 4; ++j){
edgeArray[j] = edges[quadEdgeConnectivity[i][j]];
eorientArray[j] = isQuadEdgeFlipped[i][j] ? eBackwards : eForwards;
......@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
else {
int i = triId[f];
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for(int j=0; j < 3; ++j){
edgeArray[j] = edges[triEdgeConnectivity[i][j]];
eorientArray[j] = isTriEdgeFlipped[i][j] ? eBackwards : eForwards;
......
......@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
for(int i=0; i < nFaces; ++i)
{
SegGeomSharedPtr edgeArray[3];
EdgeOrientation eorientArray[3];
Orientation eorientArray[3];
for(int j=0; j < 3; ++j)
{
edgeArray[j] = edges[edgeConnectivity[i][j]];
......
......@@ -100,7 +100,7 @@ namespace Nektar
int i;
Array<OneD,unsigned int> map;
Array<OneD,int> sign;
StdRegions::EdgeOrientation edgedir = GetEorient(edge);
StdRegions::Orientation edgedir = GetEorient(edge);
GetEdgeToElementMap(edge,edgedir,map,sign);
// Order of the element
......@@ -175,7 +175,7 @@ namespace Nektar
// int order_e = EdgeExp->GetNcoeffs();
// Array<OneD,unsigned int> map;
// Array<OneD,int> sign;
// StdRegions::EdgeOrientation edgedir = GetEorient(edge);
// StdRegions::Orientation edgedir = GetEorient(edge);
//
// // ASSERTL1(v_GetCoordim() == 2,"Routine only set up for two-dimensions");
//
......@@ -394,7 +394,7 @@ namespace Nektar
DNekScalMat &invMass = *GetLocMatrix(StdRegions::eInvMass);
StdRegions::EdgeOrientation edgedir = GetEorient(edge);
StdRegions::Orientation edgedir = GetEorient(edge);
DNekVec Coeffs (ncoeffs,outarray,eWrapper);
DNekVec Tmpcoeff(ncoeffs,tmpcoeff,eWrapper);
......@@ -492,7 +492,7 @@ namespace Nektar
// Map to edge
Array<OneD,unsigned int> emap;
Array<OneD, int> sign;
StdRegions::EdgeOrientation edgedir = GetEorient(edge);
StdRegions::Orientation edgedir = GetEorient(edge);
GetEdgeToElementMap(edge,edgedir,emap,sign);
for (unsigned int i = 0; i < EdgeExp->GetNcoeffs(); ++i)
{
......@@ -533,7 +533,7 @@ namespace Nektar
Array<OneD,unsigned int> emap;
Array<OneD,int> sign;
StdRegions::EdgeOrientation edgedir = StdRegions::eForwards;
StdRegions::Orientation edgedir = StdRegions::eForwards;
Expansion1DSharedPtr EdgeExp;
StdRegions::StdExpansion1DSharedPtr EdgeExp2;
......@@ -775,7 +775,7 @@ namespace Nektar
Array<OneD,unsigned int> emap;
Array<OneD, int> sign;
StdRegions::EdgeOrientation edgedir;
StdRegions::Orientation edgedir;
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(nbndry, nbndry);
......
......@@ -109,7 +109,7 @@ namespace Nektar
int i;
Array<OneD, unsigned int> map;
Array<OneD, int> sign;
StdRegions::FaceOrientation facedir = GetFaceOrient(face);
StdRegions::Orientation facedir = GetFaceOrient(face);
GetFaceToElementMap(face,facedir,map,sign);
int order_e = map.num_elements(); // Order of the element
......
......@@ -829,7 +829,7 @@ namespace Nektar
}
StdRegions::FaceOrientation HexExp::v_GetFaceOrient(int face)
StdRegions::Orientation HexExp::v_GetFaceOrient(int face)
{
return m_geom->GetFaceOrient(face);
}
......@@ -837,7 +837,7 @@ namespace Nektar
bool HexExp::v_GetFaceDGForwards(const int i) const
{
StdRegions::FaceOrientation fo = m_geom->GetFaceOrient(i);
StdRegions::Orientation fo = m_geom->GetFaceOrient(i);
return fo == StdRegions::eDir1FwdDir1_Dir2FwdDir2 ||
fo == StdRegions::eDir1BwdDir1_Dir2BwdDir2 ||
......@@ -856,7 +856,7 @@ namespace Nektar
int nquad1 = m_base[1]->GetNumPoints();
int nquad2 = m_base[2]->GetNumPoints();
StdRegions::FaceOrientation facedir = GetFaceOrient(face);
StdRegions::Orientation facedir = GetFaceOrient(face);
switch(face)
{
......
......@@ -172,7 +172,7 @@ namespace Nektar
LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
LOCAL_REGIONS_EXPORT virtual
StdRegions::FaceOrientation v_GetFaceOrient(int face);
StdRegions::Orientation v_GetFaceOrient(int face);
LOCAL_REGIONS_EXPORT virtual
bool v_GetFaceDGForwards(const int i) const;
......
......@@ -595,7 +595,7 @@ namespace Nektar
return m_geom->GetCoordim();
}
StdRegions::FaceOrientation PrismExp::v_GetFaceOrient(int face)
StdRegions::Orientation PrismExp::v_GetFaceOrient(int face)
{
return m_geom->GetFaceOrient(face);
}
......@@ -613,7 +613,7 @@ namespace Nektar
Array<OneD,NekDouble> o_tmp(nquad0*nquad1*nquad2);
StdRegions::FaceOrientation facedir = GetFaceOrient(face);
StdRegions::Orientation facedir = GetFaceOrient(face);
switch(face)
{
......
......@@ -141,7 +141,7 @@ namespace Nektar
LOCAL_REGIONS_EXPORT virtual const SpatialDomains::Geometry3DSharedPtr& v_GetGeom3D() const;
LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
LOCAL_REGIONS_EXPORT virtual
StdRegions::FaceOrientation v_GetFaceOrient(int face);
StdRegions::Orientation v_GetFaceOrient(int face);
LOCAL_REGIONS_EXPORT virtual void v_GetFacePhysVals(
const int face,
const StdRegions::StdExpansion2DSharedPtr &FaceExp,
......
......@@ -285,7 +285,7 @@ namespace Nektar
Array<OneD, NekDouble> physEdge[4];
Array<OneD, NekDouble> coeffEdge[4];
StdRegions::EdgeOrientation orient[4];
StdRegions::Orientation orient[4];
for(i = 0; i < 4; i++)
{
physEdge[i] = Array<OneD, NekDouble>(npoints[i%2]);
......@@ -652,7 +652,7 @@ namespace Nektar
int nquad0 = m_base[0]->GetNumPoints();
int nquad1 = m_base[1]->GetNumPoints();
StdRegions::EdgeOrientation edgedir = GetEorient(edge);
StdRegions::Orientation edgedir = GetEorient(edge);
switch(edge)
{
case 0:
......@@ -1213,13 +1213,13 @@ namespace Nektar
}
StdRegions::EdgeOrientation QuadExp::v_GetEorient(int edge)
StdRegions::Orientation QuadExp::v_GetEorient(int edge)
{
return m_geom->GetEorient(edge);
}
StdRegions::EdgeOrientation QuadExp::v_GetCartesianEorient(int edge)
StdRegions::Orientation QuadExp::v_GetCartesianEorient(int edge)
{
return m_geom->GetCartesianEorient(edge);
}
......
......@@ -185,9 +185,9 @@ namespace Nektar
const int nmode_offset,
Array<OneD, NekDouble> &coeffs);
LOCAL_REGIONS_EXPORT virtual
StdRegions::EdgeOrientation v_GetEorient(int edge);
StdRegions::Orientation v_GetEorient(int edge);
LOCAL_REGIONS_EXPORT virtual
StdRegions::EdgeOrientation v_GetCartesianEorient(int edge);
StdRegions::Orientation v_GetCartesianEorient(int edge);
LOCAL_REGIONS_EXPORT virtual const
LibUtilities::BasisSharedPtr& v_GetBasis(int dir) const;
LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
......
......@@ -810,13 +810,13 @@ cout<<"deps/dx ="<<inarray_d0[i]<<" deps/dy="<<inarray_d1[i]<<endl;
}
}
void SegExp::v_SetCoeffsToOrientation(StdRegions::EdgeOrientation dir)
void SegExp::v_SetCoeffsToOrientation(StdRegions::Orientation dir)
{
v_SetCoeffsToOrientation(dir,m_coeffs,m_coeffs);
}
void SegExp::v_SetCoeffsToOrientation(
StdRegions::EdgeOrientation dir,
StdRegions::Orientation dir,
Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray)
{
......@@ -835,7 +835,7 @@ cout<<"deps/dx ="<<inarray_d0[i]<<" deps/dy="<<inarray_d1[i]<<endl;
}
}
StdRegions::PointOrientation SegExp::v_GetPorient(int point)
StdRegions::Orientation SegExp::v_GetPorient(int point)
{
return m_geom->GetPorient(point);
}
......
......@@ -168,10 +168,10 @@ namespace Nektar
SpatialDomains::Geometry1DSharedPtr& v_GetGeom1D() const;
LOCAL_REGIONS_EXPORT virtual void
v_SetCoeffsToOrientation(StdRegions::EdgeOrientation dir);
v_SetCoeffsToOrientation(StdRegions::Orientation dir);
LOCAL_REGIONS_EXPORT virtual void v_SetCoeffsToOrientation(
StdRegions::EdgeOrientation dir,
StdRegions::Orientation dir,
Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray);
......@@ -188,7 +188,7 @@ namespace Nektar
LOCAL_REGIONS_EXPORT virtual void v_ComputeVertexNormal(const int vertex);
LOCAL_REGIONS_EXPORT virtual StdRegions::PointOrientation v_GetPorient(int point);
LOCAL_REGIONS_EXPORT virtual StdRegions::Orientation v_GetPorient(int point);
LOCAL_REGIONS_EXPORT virtual SpatialDomains::GeomType v_MetricInfoType();
......
......@@ -696,7 +696,7 @@ namespace Nektar
}
StdRegions::FaceOrientation TetExp::v_GetFaceOrient(int face)
StdRegions::Orientation TetExp::v_GetFaceOrient(int face)
{
return m_geom->GetFaceOrient(face);
}
......@@ -718,7 +718,7 @@ namespace Nektar
Array<OneD,NekDouble> o_tmp (GetFaceNumPoints(face));
Array<OneD,NekDouble> o_tmp2(FaceExp->GetTotPoints());
Array<OneD,NekDouble> o_tmp3;
StdRegions::FaceOrientation facedir = GetFaceOrient(face);
StdRegions::Orientation facedir = GetFaceOrient(face);
switch(face)
{
......@@ -769,7 +769,7 @@ namespace Nektar
int nq1 = FaceExp->GetNumPoints(0);
int nq2 = FaceExp->GetNumPoints(1);
if ((int)facedir == 2)
if ((int)facedir == 7)
{
for (int j = 0; j < nq2; ++j)
{
......@@ -2039,7 +2039,7 @@ namespace Nektar
for(i=0; i < nFaces; ++i)
{
SpatialDomains::SegGeomSharedPtr edgeArray[3];
StdRegions::EdgeOrientation eorientArray[3];
StdRegions::Orientation eorientArray[3];
for(j=0; j < 3; ++j)
{
edgeArray[j] = edges[edgeConnectivity[i][j]];
......
......@@ -144,7 +144,7 @@ namespace Nektar
LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
LOCAL_REGIONS_EXPORT virtual
StdRegions::FaceOrientation v_GetFaceOrient(int face);
StdRegions::Orientation v_GetFaceOrient(int face);
LOCAL_REGIONS_EXPORT virtual void v_GetFacePhysVals(
const int face,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment