Commit 6d54669c authored by Dave Moxey's avatar Dave Moxey
Browse files

Remove the extra basis generation (seems to not be required)

parent 9b6e4c1b
......@@ -72,19 +72,6 @@ namespace Nektar
"than order in 'c' direction");
}
// Generate extra modes for interior
LibUtilities::BasisKey Bamod(
Ba.GetBasisType(),
Ba.GetNumModes() + 1,
Ba.GetPointsKey());
LibUtilities::BasisKey Bcmod(
Bc.GetBasisType(),
Bc.GetNumModes() + 1,
Bc.GetPointsKey());
m_base_A = LibUtilities::BasisManager()[Bamod];
m_base_C = LibUtilities::BasisManager()[Bcmod];
// Set up mode mapping which takes 0\leq i\leq N_coeffs -> (p,q,r)
// of the 3D tensor product
const int P = Ba.GetNumModes() - 1;
......@@ -93,70 +80,70 @@ namespace Nektar
int cnt = 0;
// Vertices
m_map [cnt ] = triple(0, 0, 0, false);
m_map [cnt ] = triple(0, 0, 0);
m_rmap[cnt++] = 0;
m_map [cnt ] = triple(1, 0, 0, false);
m_map [cnt ] = triple(1, 0, 0);
m_rmap[cnt++] = 0;
m_map [cnt ] = triple(1, 1, 0, false);
m_map [cnt ] = triple(1, 1, 0);
m_rmap[cnt++] = 0;
m_map [cnt ] = triple(0, 1, 0, false);
m_map [cnt ] = triple(0, 1, 0);
m_rmap[cnt++] = 0;
m_map [cnt ] = triple(0, 0, 1, false);
m_map [cnt ] = triple(0, 0, 1);
m_rmap[cnt++] = 1;
// Edge 0
for (int i = 2; i <= P; ++i)
{
m_map [cnt ] = triple (i, 0, 0, false);
m_map [cnt ] = triple (i, 0, 0);
m_rmap[cnt++] = GetTetMode(i, 0, 0);
}
// Edge 1
for (int i = 2; i <= Q; ++i)
{
m_map [cnt ] = triple (1, i, 0, false);
m_map [cnt ] = triple (1, i, 0);
m_rmap[cnt++] = GetTetMode(0, i, 0);
}
// Edge 2
for (int i = 2; i <= P; ++i)
{
m_map [cnt ] = triple (i, 1, 0, false);
m_map [cnt ] = triple (i, 1, 0);
m_rmap[cnt++] = GetTetMode(i, 0, 0);
}
// Edge 3
for (int i = 2; i <= Q; ++i)
{
m_map [cnt ] = triple (0, i, 0, false);
m_map [cnt ] = triple (0, i, 0);
m_rmap[cnt++] = GetTetMode(0, i, 0);
}
// Edge 4
for (int i = 2; i <= R; ++i)
{
m_map [cnt ] = triple(0, 0, i, false);
m_map [cnt ] = triple(0, 0, i);
m_rmap[cnt++] = i;
}
// Edge 5
for (int i = 2; i <= R; ++i)
{
m_map [cnt ] = triple(1, 0, i, false);
m_map [cnt ] = triple(1, 0, i);
m_rmap[cnt++] = i;
}
// Edge 6
for (int i = 2; i <= R; ++i)
{
m_map [cnt ] = triple(1, 1, i, false);
m_map [cnt ] = triple(1, 1, i);
m_rmap[cnt++] = i;
}
// Edge 7
for (int i = 2; i <= R; ++i)
{
m_map [cnt ] = triple(0, 1, i, false);
m_map [cnt ] = triple(0, 1, i);
m_rmap[cnt++] = i;
}
......@@ -165,7 +152,7 @@ namespace Nektar
{
for (int i = 2; i <= P; ++i)
{
m_map [cnt ] = triple (i, j, 0, false);
m_map [cnt ] = triple (i, j, 0);
m_rmap[cnt++] = GetTetMode(2, 0, 0);
}
}
......@@ -175,7 +162,7 @@ namespace Nektar
{
for (int j = 1; j <= R-i; ++j)
{
m_map [cnt ] = triple (i, 0, j, false);
m_map [cnt ] = triple (i, 0, j);
m_rmap[cnt++] = GetTetMode(i, 0, j);
}
}
......@@ -185,7 +172,7 @@ namespace Nektar
{
for (int j = 1; j <= R-i; ++j)
{
m_map [cnt ] = triple (1, i, j, false);
m_map [cnt ] = triple (1, i, j);
m_rmap[cnt++] = GetTetMode(0, i, j);
}
}
......@@ -195,7 +182,7 @@ namespace Nektar
{
for (int j = 1; j <= R-i; ++j)
{
m_map [cnt ] = triple (i, 1, j, false);
m_map [cnt ] = triple (i, 1, j);
m_rmap[cnt++] = GetTetMode(i, 0, j);
}
}
......@@ -205,7 +192,7 @@ namespace Nektar
{
for (int j = 1; j <= R-i; ++j)
{
m_map [cnt ] = triple (0, i, j, false);
m_map [cnt ] = triple (0, i, j);
m_rmap[cnt++] = GetTetMode(0, i, j);
}
}
......@@ -219,8 +206,8 @@ namespace Nektar
{
// need to go to j+1-th mode in the 'b' direction to
// select correct modified_a mode
m_map [cnt ] = triple (i, j+1, k, true);
m_rmap[cnt++] = GetModTetMode(i-1, j, k);
m_map [cnt ] = triple (i, j+1, k);
m_rmap[cnt++] = GetTetMode(i-1, j, k);
}
}
}
......@@ -376,15 +363,14 @@ namespace Nektar
m_base[2]->GetBasisType() != LibUtilities::eModified_C,
"Basis[2] is not a general tensor type");
int Qx = m_base[0]->GetNumPoints();
int Qy = m_base[1]->GetNumPoints();
int Qz = m_base[2]->GetNumPoints();
const int Qx = m_base[0]->GetNumPoints();
const int Qy = m_base[1]->GetNumPoints();
const int Qz = m_base[2]->GetNumPoints();
int s = 0;
Array<OneD, const NekDouble> bx = m_base[0]->GetBdata();
Array<OneD, const NekDouble> by = m_base[1]->GetBdata();
Array<OneD, const NekDouble> bz = m_base[2]->GetBdata();
Array<OneD, const NekDouble> bxc = m_base_A->GetBdata();
Array<OneD, const NekDouble> bzc = m_base_C->GetBdata();
const Array<OneD, const NekDouble> &bx = m_base[0]->GetBdata();
const Array<OneD, const NekDouble> &by = m_base[1]->GetBdata();
const Array<OneD, const NekDouble> &bz = m_base[2]->GetBdata();
int Q = m_base[2]->GetNumModes()-1;
......@@ -392,7 +378,7 @@ namespace Nektar
{
for (int j = 0; j < Qy; ++j)
{
for (int i = 0; i < Qx; ++i)
for (int i = 0; i < Qx; ++i, ++s)
{
NekDouble sum = 0.0;
......@@ -402,23 +388,12 @@ namespace Nektar
const int p = boost::get<0>(idx);
const int q = boost::get<1>(idx);
const int r = boost::get<2>(idx);
const bool in = boost::get<3>(idx);
NekDouble tmp;
if (in)
{
tmp = inarray[cnt]*
bxc[i + Qx*p]*
bxc[j + Qy*q]*
bzc[k + Qz*m_rmap[cnt]];
}
else
{
tmp = inarray[cnt]*
bx[i + Qx*p]*
by[j + Qy*q]*
bz[k + Qz*m_rmap[cnt]];
}
if (r == 0 && p >= 2 && q >= 2)
{
......@@ -428,11 +403,6 @@ namespace Nektar
{
tmp *= bz[k + Qz*GetTetMode(blah-2,0,0)];
}
//int blah = min(p+q-2, Q)-p-1;
//if (blah >= 0)
//{
// tmp *= bz[k + Qz*GetTetMode(q-3,0,0)];
//}
}
sum += tmp;
}
......@@ -443,7 +413,7 @@ namespace Nektar
sum += inarray[m]*bz[k+Qz]*(bx[i+Qx]*by[j+Qy]+
bx[i ]*by[j+Qy]+
bx[i+Qx]*by[j ]);
outarray[i + Qx*(j + Qy*k)] = sum;
outarray[s] = sum;
}
}
}
......@@ -540,8 +510,6 @@ namespace Nektar
const Array<OneD, const NekDouble> &bx = m_base[0]->GetBdata();
const Array<OneD, const NekDouble> &by = m_base[1]->GetBdata();
const Array<OneD, const NekDouble> &bz = m_base[2]->GetBdata();
const Array<OneD, const NekDouble> &bxc = m_base_A ->GetBdata();
const Array<OneD, const NekDouble> &bzc = m_base_C ->GetBdata();
int Q = m_base[1]->GetNumModes()-1;
......@@ -554,7 +522,6 @@ namespace Nektar
const int p = boost::get<0>(idx);
const int q = boost::get<1>(idx);
const int r = boost::get<2>(idx);
const bool in = boost::get<3>(idx);
NekDouble tmp = 0.0;
int s = 0;
......@@ -565,20 +532,10 @@ namespace Nektar
for (int i = 0; i < Qx; ++i, ++s)
{
NekDouble tmp2;
if (in)
{
tmp2 = inarray[s]*
bxc[i + Qx*p]*
bxc[j + Qy*q]*
bzc[k + Qz*m_rmap[cnt]];
}
else
{
tmp2 = inarray[s]*
bx[i + Qx*p]*
by[j + Qy*q]*
bz[k + Qz*m_rmap[cnt]];
}
if (r == 0 && p >= 2 && q >= 2)
{
......@@ -1117,25 +1074,6 @@ namespace Nektar
return cnt + K;
}
int StdPyrExp::GetModTetMode(const int I, const int J, const int K)
{
const int R = m_base[2]->GetNumModes()+1;
int i, j, cnt = 0;
for (i = 0; i < I; ++i)
{
cnt += (R-i)*(R-i+1)/2;
}
i = R-I;
for (j = 0; j < J; ++j)
{
cnt += i;
i--;
}
return cnt + K;
}
void StdPyrExp::v_MultiplyByStdQuadratureMetric(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray)
......
......@@ -48,7 +48,8 @@ namespace Nektar
class StdPyrExp : virtual public StdExpansion3D
{
public:
typedef boost::tuple<unsigned char, unsigned char, unsigned char, bool> triple;
typedef boost::tuple<
unsigned char, unsigned char, unsigned char> triple;
STD_REGIONS_EXPORT StdPyrExp();
......@@ -76,7 +77,6 @@ namespace Nektar
return m_rmap;
}
STD_REGIONS_EXPORT int GetTetMode(int I, int J, int K);
STD_REGIONS_EXPORT int GetModTetMode(int I, int J, int K);
protected:
//---------------------------------------
......@@ -193,7 +193,8 @@ namespace Nektar
Array<OneD, int> &signarray,
int nummodesA=-1,
int nummodesB=-1);
STD_REGIONS_EXPORT virtual int v_GetVertexMap(int localVertexId,
STD_REGIONS_EXPORT virtual int v_GetVertexMap(
int localVertexId,
bool useCoeffPacking = false);
/*
STD_REGIONS_EXPORT virtual void v_GetEdgeInteriorMap(
......@@ -224,8 +225,6 @@ namespace Nektar
//---------------------------------------
vector<triple> m_map;
vector<int> m_rmap;
LibUtilities::BasisSharedPtr m_base_A;
LibUtilities::BasisSharedPtr m_base_C;
};
typedef boost::shared_ptr<StdPyrExp> StdPyrExpSharedPtr;
} //end of namespace
......
Markdown is supported
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