Commit e29fb6f5 authored by Dave Moxey's avatar Dave Moxey

Remove some ifdefs, fix some formatting in StdRegions

parent 60b6a86d
......@@ -574,8 +574,8 @@ class BwdTrans_SumFac_Hex : public Operator
//loop over elements and do bwd trans wrt c
for(int n = 0; n < m_numElmt; ++n)
{
Blas::Dgemm('N', 'T', m_nquad2, m_nmodes0*m_nmodes1, m_nmodes2,
1.0, m_base2.get(), m_nquad2,
Blas::Dgemm('N', 'T', m_nquad2, m_nmodes0*m_nmodes1,
m_nmodes2, 1.0, m_base2.get(), m_nquad2,
&input[n*totmodes], m_nmodes0*m_nmodes1, 0.0,
&wsp[n*m_nquad2], m_nquad2*m_numElmt);
}
......
......@@ -32,6 +32,7 @@
// Description: IProduct operators for multiple calls in different operators
//
///////////////////////////////////////////////////////////////////////////////
#include <Collections/Collection.h>
#include <Collections/IProduct.h>
......
......@@ -352,7 +352,8 @@ OperatorKey IProductWRTDerivBase_IterPerExp::m_typeArr[] = {
/**
* @brief Inner product WRT deriv base operator using LocalRegions implementation.
* @brief Inner product WRT deriv base operator using LocalRegions
* implementation.
*/
class IProductWRTDerivBase_NoCollection : public Operator
{
......@@ -463,7 +464,8 @@ OperatorKey IProductWRTDerivBase_NoCollection::m_typeArr[] = {
/**
* @brief Inner product WRT deriv base operator using sum-factorisation (Segment)
* @brief Inner product WRT deriv base operator using sum-factorisation
* (Segment)
*/
class IProductWRTDerivBase_SumFac_Seg : public Operator
{
......@@ -671,8 +673,10 @@ class IProductWRTDerivBase_SumFac_Tri : public Operator
wsp1 = wsp + 2*nmax;
// calculate (dphi/dx,in[0]) = ((dphi/dxi_0 dxi_0/dx + dphi/dxi_1 dxi_1/dx),in[0])
// + (dphi/dy,in[1]) = ((dphi/dxi_0 dxi_0/dy + dphi/dxi_1 dxi_1/dy),in[1])
// calculate (dphi/dx,in[0]) = ((dphi/dxi_0 dxi_0/dx +
// dphi/dxi_1 dxi_1/dx),in[0])
// + (dphi/dy,in[1]) = ((dphi/dxi_0 dxi_0/dy +
// dphi/dxi_1 dxi_1/dy),in[1])
//
// Note dphi/dxi_0 =
// dphi/deta_0 deta_0/dxi_0 = dphi/deta_0 2/(1-eta_1)
......@@ -684,8 +688,8 @@ class IProductWRTDerivBase_SumFac_Tri : public Operator
// and so the full inner products are
//
// (dphi/dx,in[0]) + (dphi/dy,in[1])
// = (dphi/deta_0, ((2/(1-eta_1) (dxi_0/dx in[0] + dxi_0/dy in[1])
// + (1_eta_0)/(1-eta_1) (dxi_1/dx in[0] + dxi_1/dy in[1]))
// = (dphi/deta_0, ((2/(1-eta_1) (dxi_0/dx in[0]+dxi_0/dy in[1])
// + (1_eta_0)/(1-eta_1) (dxi_1/dx in[0]+dxi_1/dy in[1]))
// + (dphi/deta_1, (dxi_1/dx in[0] + dxi_1/dy in[1]))
for(int i = 0; i < 2; ++i)
......@@ -974,18 +978,26 @@ class IProductWRTDerivBase_SumFac_Tet : public Operator
}
// calculate (dphi/dx,in[0]) = ((dphi/dxi_0 dxi_0/dx + dphi/dxi_1 dxi_1/dx + dphi/dxi_2 dxi_2/dx),in[0])
// + (dphi/dy,in[1]) = ((dphi/dxi_0 dxi_0/dy + dphi/dxi_1 dxi_1/dy + dphi/dxi_2 dxi_2/dy),in[1])
// + (dphi/dz,in[2]) = ((dphi/dxi_0 dxi_0/dz + dphi/dxi_1 dxi_1/dz + dphi/dxi_2 dxi_2/dz),in[1])
// calculate (dphi/dx,in[0]) = ((dphi/dxi_0 dxi_0/dx +
// dphi/dxi_1 dxi_1/dx +
// dphi/dxi_2 dxi_2/dx),in[0])
// + (dphi/dy,in[1]) = ((dphi/dxi_0 dxi_0/dy +
// dphi/dxi_1 dxi_1/dy +
// dphi/dxi_2 dxi_2/dy),in[1])
// + (dphi/dz,in[2]) = ((dphi/dxi_0 dxi_0/dz +
// dphi/dxi_1 dxi_1/dz +
// dphi/dxi_2 dxi_2/dz),in[1])
//
// Note dphi/dxi_0 =
// dphi/deta_0 4/((1-eta_1)(1-eta2))
//
// dphi/dxi_1 =
// dphi/deta_0 2(1+eta_0)/((1-eta_1)(1-eta_2)) + dphi/deta_1 2/(1-eta_2)
// dphi/deta_0 2(1+eta_0)/((1-eta_1)(1-eta_2)) +
// dphi/deta_1 2/(1-eta_2)
//
// dphi/dxi_2 =
// dphi/deta_0 2(1+eta_0)/((1-eta_1)(1-eta_2)) + dphi/deta_1 (1+eta_1)/(1-eta_2) + dphi/deta_2
// dphi/deta_0 2(1+eta_0)/((1-eta_1)(1-eta_2)) +
// dphi/deta_1 (1+eta_1)/(1-eta_2) + dphi/deta_2
//
// and so the full inner products are
//
......@@ -1198,9 +1210,12 @@ class IProductWRTDerivBase_SumFac_Prism : public Operator
tmp[i] = wsp + i*nmax;
}
// calculate (dphi/dx,in[0]) = ((dphi/dxi_0 dxi_0/dx + dphi/dxi_1 dxi_1/dx),in[0])
// + (dphi/dy,in[1]) = ((dphi/dxi_0 dxi_0/dy + dphi/dxi_1 dxi_1/dy),in[1])
// + (dphi/dz,in[2]) = ((dphi/dxi_0 dxi_0/dz + dphi/dxi_1 dxi_1/dz),in[2])
// calculate (dphi/dx,in[0]) = ((dphi/dxi_0 dxi_0/dx +
// dphi/dxi_1 dxi_1/dx),in[0])
// + (dphi/dy,in[1]) = ((dphi/dxi_0 dxi_0/dy +
// dphi/dxi_1 dxi_1/dy),in[1])
// + (dphi/dz,in[2]) = ((dphi/dxi_0 dxi_0/dz +
// dphi/dxi_1 dxi_1/dz),in[2])
//
// Note dphi/dxi_0 =
// dphi/deta_0 deta_0/dxi_0 = dphi/deta_0 2/(1-eta_2)
......@@ -1212,12 +1227,14 @@ class IProductWRTDerivBase_SumFac_Prism : public Operator
// and so the full inner products are
//
// (dphi/dx,in[0]) + (dphi/dy,in[1]) + (dphi/dz,in[2])
// = (dphi/deta_0, ((2/(1-eta_2) (dxi_0/dx in[0] + dxi_0/dy in[1] + dxi_0/dz in[2] )
// + (1_eta_0)/(1-eta_2) (dxi_2/dx in[0] + dxi_2/dy in[1] + dxi_2/dz in[2] ))
// + (dphi/deta_1, (dxi_1/dx in[0] + dxi_1/dy in[1] + dxi_1/dz in[2]))
// + (dphi/deta_2, (dxi_2/dx in[0] + dxi_2/dy in[1] + dxi_2/dz in[2]))
// = (dphi/deta_0, ((2/(1-eta_2) (dxi_0/dx in[0] + dxi_0/dy in[1]
// + dxi_0/dz in[2])
// + (1_eta_0)/(1-eta_2) (dxi_2/dx in[0] + dxi_2/dy in[1]
// + dxi_2/dz in[2] ))
// + (dphi/deta_1, (dxi_1/dx in[0] + dxi_1/dy in[1]
// + dxi_1/dz in[2]))
// + (dphi/deta_2, (dxi_2/dx in[0] + dxi_2/dy in[1]
// + dxi_2/dz in[2]))
for(int i = 0; i < 3; ++i)
{
......
///////////////////////////////////////////////////////////////////////////////
//
// File: CollectionTiming.cpp
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Small demo to run timings of various operators.
//
///////////////////////////////////////////////////////////////////////////////
#include <cstdio>
#include <cstdlib>
#include <iomanip>
......
......@@ -2820,38 +2820,6 @@ namespace Nektar
}
}
}
int NoCaseStringCompare( const string & s1, const string& s2)
{
string::const_iterator it1=s1.begin();
string::const_iterator it2=s2.begin();
// Stop when either string's end has been reached
while ( (it1!=s1.end()) && (it2!=s2.end()) )
{
if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
{
// Return -1 to indicate smaller than, 1 otherwise
return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1;
}
// Proceed to the next character in each string
++it1;
++it2;
}
size_t size1=s1.size();
size_t size2=s2.size();// cache lengths
// Return -1, 0 or 1 according to strings' lengths
if (size1==size2)
{
return 0;
}
return (size1 < size2) ? -1 : 1;
}
} //end of namespace
} //end of namespace
......@@ -97,8 +97,6 @@ namespace Nektar
typedef boost::shared_ptr<BlockMatrixMap> BlockMatrixMapShPtr;
int NoCaseStringCompare( const string & s1, const string& s2);
/// Base class for all multi-elemental spectral/hp expansions.
class ExpList: public boost::enable_shared_from_this<ExpList>
{
......
......@@ -112,16 +112,7 @@ namespace Nektar
{
tmp[i] = Array<OneD, NekDouble>(nCoeffs, 0.0);
#if 0
for (j = 0; j < nDim; ++j)
{
fields[i]->IProductWRTDerivBase(j, fluxvector[i][j],
outarray[i]);
Vmath::Vadd(nCoeffs, outarray[i], 1, tmp[i], 1, tmp[i], 1);
}
#else
fields[i]->IProductWRTDerivBase(fluxvector[i],tmp[i]);
#endif
}
// Store forwards/backwards space along trace space
......
......@@ -197,13 +197,11 @@ namespace Nektar
}
}
#if 1
Array<OneD, NekDouble> tmp = Array<OneD, NekDouble>(nCoeffs, 0.0);
Array<OneD, Array<OneD, NekDouble> > qdbase(nDim);
for (i = 0; i < nConvectiveFields; ++i)
{
for (j = 0; j < nDim; ++j)
{
qdbase[j] = qfield[j][i];
......@@ -217,28 +215,6 @@ namespace Nektar
fields[i]->MultiplyByElmtInvMass(tmp, tmp);
fields[i]->BwdTrans (tmp, outarray[i]);
}
#else
Array<OneD, Array<OneD, NekDouble> > tmp(nConvectiveFields);
for (i = 0; i < nConvectiveFields; ++i)
{
tmp[i] = Array<OneD, NekDouble>(nCoeffs, 0.0);
for (j = 0; j < nDim; ++j)
{
Vmath::Vcopy(nPts, qfield[j][i], 1, fluxvector[j], 1);
fields[i]->IProductWRTDerivBase(j, fluxvector[j], qcoeffs);
Vmath::Vadd(nCoeffs, qcoeffs, 1, tmp[i], 1, tmp[i], 1);
}
// Evaulate <\phi, \hat{F}\cdot n> - outarray[i]
Vmath::Neg (nCoeffs, tmp[i], 1);
fields[i]->AddTraceIntegral (flux[0][i], tmp[i]);
fields[i]->SetPhysState (false);
fields[i]->MultiplyByElmtInvMass(tmp[i], tmp[i]);
fields[i]->BwdTrans (tmp[i], outarray[i]);
}
#endif
}
void DiffusionLDG::v_NumFluxforScalar(
......
......@@ -629,8 +629,5 @@ namespace Nektar
}
}
}
}; //end of namespace
}; //end of namespace
......@@ -1441,7 +1441,7 @@ namespace Nektar
}
void StdExpansion::v_MultiplyByStdQuadratureMetric(
const Array<OneD, const NekDouble> &inarray,
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray)
{
NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape or library");
......
......@@ -396,8 +396,8 @@ namespace Nektar
*/
void StdHexExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble> &outarray,
bool multiplybyweights)
Array<OneD, NekDouble> &outarray,
bool multiplybyweights)
{
int nquad0 = m_base[0]->GetNumPoints();
int nquad1 = m_base[1]->GetNumPoints();
......@@ -405,7 +405,7 @@ namespace Nektar
int order0 = m_base[0]->GetNumModes();
int order1 = m_base[1]->GetNumModes();
Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
order0*order1*nquad2);
if(multiplybyweights)
......
......@@ -127,8 +127,8 @@ namespace Nektar
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble> &outarray,
bool multbyweights = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFacKernel(
const Array<OneD, const NekDouble>& base0,
......
......@@ -106,8 +106,8 @@ namespace Nektar
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble>& outarray,
bool mult = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTDerivBase(
const int dir,
const Array<OneD, const NekDouble>& inarray,
......
......@@ -230,8 +230,8 @@ namespace Nektar
void StdNodalTetExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
{
StdTetExp::v_IProductWRTBase_SumFac(inarray,outarray,multiplybyweights);
NodalToModalTranspose(outarray,outarray);
......
......@@ -105,8 +105,8 @@ namespace Nektar
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble>& outarray,
bool mult = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTDerivBase(
const int dir,
const Array<OneD, const NekDouble>& inarray,
......
......@@ -224,8 +224,8 @@ namespace Nektar
void StdNodalTriExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
{
StdTriExp::v_IProductWRTBase_SumFac(inarray,outarray,multiplybyweights);
NodalToModalTranspose(outarray,outarray);
......
......@@ -106,8 +106,8 @@ namespace Nektar
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTDerivBase(
const int dir,
const Array<OneD, const NekDouble>& inarray,
......
......@@ -431,8 +431,8 @@ namespace Nektar
void StdPrismExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
{
int nquad1 = m_base[1]->GetNumPoints();
int nquad2 = m_base[2]->GetNumPoints();
......
......@@ -126,8 +126,8 @@ namespace Nektar
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFacKernel(
const Array<OneD, const NekDouble>& base0,
const Array<OneD, const NekDouble>& base1,
......
......@@ -549,8 +549,8 @@ namespace Nektar
void StdPyrExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
{
Array<OneD, NekDouble> wsp;
......
......@@ -157,9 +157,8 @@ namespace Nektar
Array<OneD, NekDouble> &outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble> &outarray,
bool multiplybyweights = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFacKernel(
const Array<OneD, const NekDouble> &base0,
const Array<OneD, const NekDouble> &base1,
......
......@@ -391,9 +391,9 @@ namespace Nektar
}
void StdQuadExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble> &outarray,
bool multiplybyweights)
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble> &outarray,
bool multiplybyweights)
{
int nquad0 = m_base[0]->GetNumPoints();
int nquad1 = m_base[1]->GetNumPoints();
......@@ -402,9 +402,9 @@ namespace Nektar
if(multiplybyweights)
{
Array<OneD,NekDouble> tmp(nquad0*nquad1+nquad1*order0);
Array<OneD,NekDouble> wsp(tmp+nquad0*nquad1);
Array<OneD,NekDouble> wsp(tmp+nquad0*nquad1);
// multiply by integration constants
// multiply by integration constants
MultiplyByQuadratureMetric(inarray,tmp);
IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
m_base[1]->GetBdata(),
......
......@@ -453,7 +453,7 @@ namespace Nektar
Array<OneD, NekDouble> tmp(nquad);
Array<OneD, const NekDouble> w = m_base[0]->GetW();
Array<OneD, const NekDouble> base = m_base[0]->GetBdata();
if(multiplybyweights)
{
Vmath::Vmul(nquad, inarray, 1, w, 1, tmp, 1);
......
......@@ -544,8 +544,8 @@ namespace Nektar
*/
void StdTetExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
{
int nquad0 = m_base[0]->GetNumPoints();
int nquad1 = m_base[1]->GetNumPoints();
......
......@@ -128,14 +128,14 @@ namespace Nektar
//---------------------------------------
STD_REGIONS_EXPORT virtual void v_IProductWRTBase(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray);
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_MatOp(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFacKernel (
const Array<OneD, const NekDouble>& base0,
const Array<OneD, const NekDouble>& base1,
......
......@@ -483,7 +483,7 @@ namespace Nektar
void StdTriExp::v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights)
bool multiplybyweights)
{
int nquad0 = m_base[0]->GetNumPoints();
int nquad1 = m_base[1]->GetNumPoints();
......@@ -492,9 +492,9 @@ namespace Nektar
if(multiplybyweights)
{
Array<OneD,NekDouble> tmp(nquad0*nquad1+nquad1*order0);
Array<OneD,NekDouble> wsp(tmp+nquad0*nquad1);
Array<OneD,NekDouble> wsp(tmp+nquad0*nquad1);
// multiply by integration constants
// multiply by integration constants
MultiplyByQuadratureMetric(inarray,tmp);
IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
m_base[1]->GetBdata(),
......
......@@ -124,8 +124,8 @@ namespace Nektar
Array<OneD, NekDouble>& outarray);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFac(
const Array<OneD, const NekDouble>& inarray,
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
Array<OneD, NekDouble>& outarray,
bool multiplybyweights = true);
STD_REGIONS_EXPORT virtual void v_IProductWRTBase_SumFacKernel(
const Array<OneD, const NekDouble>& base0,
const Array<OneD, const NekDouble>& base1,
......
SET(Sources
main.cpp
TestHexCollection.cpp
......
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