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

Adding fixes for library.

parent 2ce55cf9
......@@ -98,8 +98,13 @@ MACRO(SET_COMMON_PROPERTIES name)
ENDIF( NEKTAR_FULL_DEBUG)
IF( NOT MSVC )
SET(CMAKE_CXX_FLAGS_DEBUG
IF (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -fpermissive -Wno-deprecated")
ELSE ()
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wno-deprecated")
ENDIF()
SET(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -Wno-deprecated")
......
......@@ -33,8 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
using namespace std;
#include <LibUtilities/Communication/CommMpi.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
......@@ -42,7 +40,7 @@ namespace Nektar
{
namespace LibUtilities
{
string CommMpi::className
std::string CommMpi::className
= GetCommFactory().RegisterCreatorFunction(
"ParallelMPI",
CommMpi::create,
......
......@@ -964,10 +964,10 @@ namespace Nektar
*/
bool BasisKey::Collocation() const
{
return ( m_basistype == eGLL_Lagrange &&
GetPointsType() == eGaussLobattoLegendre &&
GetNumModes() == GetNumPoints() ||
m_basistype == eGauss_Lagrange);
return (m_basistype == eGLL_Lagrange &&
GetPointsType() == eGaussLobattoLegendre &&
GetNumModes() == GetNumPoints()) ||
m_basistype == eGauss_Lagrange;
}
// BasisKey compared to BasisKey
......
......@@ -481,6 +481,8 @@ namespace Nektar
EvaluationStep(rgt rn, ci i, ci l, ci r, vr s, cvr c, cvr p, cvr v):
rng(rn), storeIdx(i), argIdx1(l), argIdx2(r), state(s), consts(c), params(p), vars(v) {};
virtual ~EvaluationStep() {}
/// declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n) = 0;
virtual void run_once() = 0;
......
......@@ -2056,15 +2056,17 @@ namespace Nektar
switch(mkey.GetMatrixType())
{
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
default:
break;
}
MatrixKey deriv0key(StdRegions::eWeakDeriv0,
......
......@@ -162,18 +162,25 @@ namespace Nektar
switch(m_base[1]->GetPointsType())
{
case LibUtilities::eGaussLobattoLegendre: // Legendre inner product
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*(1-z1[i])*w1[i], outarray.get()+i*nquad0,1);
}
break;
case LibUtilities::eGaussRadauMAlpha1Beta0: // (1,0) Jacobi Inner product
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*w1[i], outarray.get()+i*nquad0,1);
}
break;
// Legendre inner product
case LibUtilities::eGaussLobattoLegendre:
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*(1-z1[i])*w1[i],
outarray.get()+i*nquad0,1);
}
break;
// (1,0) Jacobi Inner product
case LibUtilities::eGaussRadauMAlpha1Beta0:
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*w1[i],
outarray.get()+i*nquad0,1);
}
break;
default:
ASSERTL0(false, "Unsupported quadrature points type.");
break;
}
}
}
......
......@@ -1463,6 +1463,8 @@ namespace Nektar
case StdRegions::eWeakDeriv2:
dir = 2;
break;
default:
break;
}
MatrixKey deriv0key(StdRegions::eWeakDeriv0,
......
......@@ -1338,15 +1338,17 @@ namespace Nektar
switch(mkey.GetMatrixType())
{
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
default:
break;
}
MatrixKey deriv0key(StdRegions::eWeakDeriv0,
......@@ -1489,15 +1491,17 @@ namespace Nektar
switch(mkey.GetMatrixType())
{
case StdRegions::eIProductWRTDerivBase0:
dir = 0;
break;
case StdRegions::eIProductWRTDerivBase1:
dir = 1;
break;
case StdRegions::eIProductWRTDerivBase2:
dir = 2;
break;
case StdRegions::eIProductWRTDerivBase0:
dir = 0;
break;
case StdRegions::eIProductWRTDerivBase1:
dir = 1;
break;
case StdRegions::eIProductWRTDerivBase2:
dir = 2;
break;
default:
break;
}
MatrixKey iProdDeriv0Key(StdRegions::eIProductWRTDerivBase0,
......
......@@ -1331,7 +1331,8 @@ cout<<"deps/dx ="<<inarray_d0[i]<<" deps/dy="<<inarray_d1[i]<<endl;
case StdRegions::eWeakDeriv1:
case StdRegions::eWeakDeriv2:
{
if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed || mkey.GetNVarCoeff())
if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed ||
mkey.GetNVarCoeff())
{
fac = 1.0;
goto UseLocRegionsMatrix;
......@@ -1341,19 +1342,25 @@ cout<<"deps/dx ="<<inarray_d0[i]<<" deps/dy="<<inarray_d1[i]<<endl;
int dir;
switch(mkey.GetMatrixType())
{
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
ASSERTL1(m_geom->GetCoordim() >= 2,
"Cannot call eWeakDeriv2 in a coordinate system which is not at least two-dimensional");
dir = 1;
break;
case StdRegions::eWeakDeriv2:
ASSERTL1(m_geom->GetCoordim() == 3,
"Cannot call eWeakDeriv2 in a coordinate system which is not three-dimensional");
dir = 2;
break;
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
ASSERTL1(m_geom->GetCoordim() >= 2,
"Cannot call eWeakDeriv2 in a "
"coordinate system which is not at "
"least two-dimensional");
dir = 1;
break;
case StdRegions::eWeakDeriv2:
ASSERTL1(m_geom->GetCoordim() == 3,
"Cannot call eWeakDeriv2 in a "
"coordinate system which is not "
"three-dimensional");
dir = 2;
break;
default:
break;
}
MatrixKey deriv0key(StdRegions::eWeakDeriv0,
......
......@@ -1419,15 +1419,17 @@ namespace Nektar
switch(mkey.GetMatrixType())
{
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
default:
break;
}
MatrixKey deriv0key(StdRegions::eWeakDeriv0,
......@@ -1833,49 +1835,56 @@ namespace Nektar
switch(m_base[1]->GetPointsType())
{
// Legendre inner product.
case LibUtilities::eGaussLobattoLegendre:
// Legendre inner product.
case LibUtilities::eGaussLobattoLegendre:
for(j = 0; j < nquad2; ++j)
{
for(i = 0; i < nquad1; ++i)
for(j = 0; j < nquad2; ++j)
{
Blas::Dscal(nquad0,
0.5*(1-z1[i])*w1[i],
&outarray[0]+i*nquad0 + j*nquad0*nquad1,
1 );
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,
0.5*(1-z1[i])*w1[i],
&outarray[0]+i*nquad0 + j*nquad0*nquad1,
1 );
}
}
}
break;
break;
// (1,0) Jacobi Inner product.
case LibUtilities::eGaussRadauMAlpha1Beta0:
for(i = 0; i < nquad1*nquad2; ++i)
{
Vmath::Smul(nquad0, 0.5*w1[i%nquad2], outarray.get()+i*nquad0, 1,
outarray.get()+i*nquad0, 1);
}
break;
// (1,0) Jacobi Inner product.
case LibUtilities::eGaussRadauMAlpha1Beta0:
for(i = 0; i < nquad1*nquad2; ++i)
{
Vmath::Smul(nquad0, 0.5*w1[i%nquad2], outarray.get()+i*nquad0, 1,
outarray.get()+i*nquad0, 1);
}
break;
default:
ASSERTL0(false, "Unsupported quadrature points type.");
break;
}
switch(m_base[2]->GetPointsType())
{
// Legendre inner product.
case LibUtilities::eGaussLobattoLegendre:
for(i = 0; i < nquad2; ++i)
{
Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
&outarray[0]+i*nquad0*nquad1,1);
}
break;
// (2,0) Jacobi inner product.
case LibUtilities::eGaussRadauMAlpha2Beta0:
for(i = 0; i < nquad2; ++i)
{
Vmath::Smul(nquad0*nquad1, 0.25*w2[i], outarray.get()+i*nquad0*nquad1, 1,
outarray.get()+i*nquad0*nquad1, 1);
}
break;
// Legendre inner product.
case LibUtilities::eGaussLobattoLegendre:
for(i = 0; i < nquad2; ++i)
{
Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
&outarray[0]+i*nquad0*nquad1,1);
}
break;
// (2,0) Jacobi inner product.
case LibUtilities::eGaussRadauMAlpha2Beta0:
for(i = 0; i < nquad2; ++i)
{
Vmath::Smul(nquad0*nquad1, 0.25*w2[i], outarray.get()+i*nquad0*nquad1, 1,
outarray.get()+i*nquad0*nquad1, 1);
}
break;
default:
ASSERTL0(false, "Unsupported quadrature points type.");
break;
}
}
......
......@@ -1284,15 +1284,17 @@ namespace Nektar
Array<OneD, NekDouble> &varcoeffs = NullNekDouble1DArray;
switch(mkey.GetMatrixType())
{
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
case StdRegions::eWeakDeriv0:
dir = 0;
break;
case StdRegions::eWeakDeriv1:
dir = 1;
break;
case StdRegions::eWeakDeriv2:
dir = 2;
break;
default:
break;
}
MatrixKey deriv0key(StdRegions::eWeakDeriv0,
......@@ -1436,15 +1438,17 @@ namespace Nektar
switch(mkey.GetMatrixType())
{
case StdRegions::eIProductWRTDerivBase0:
dir = 0;
break;
case StdRegions::eIProductWRTDerivBase1:
dir = 1;
break;
case StdRegions::eIProductWRTDerivBase2:
dir = 2;
break;
case StdRegions::eIProductWRTDerivBase0:
dir = 0;
break;
case StdRegions::eIProductWRTDerivBase1:
dir = 1;
break;
case StdRegions::eIProductWRTDerivBase2:
dir = 2;
break;
default:
break;
}
MatrixKey iProdDeriv0Key(StdRegions::eIProductWRTDerivBase0,
......@@ -2132,18 +2136,23 @@ namespace Nektar
switch(m_base[1]->GetPointsType())
{
case LibUtilities::eGaussLobattoLegendre: // Legendre inner product
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*(1-z1[i])*w1[i], outarray.get()+i*nquad0,1);
}
break;
case LibUtilities::eGaussRadauMAlpha1Beta0: // (1,0) Jacobi Inner product
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*w1[i], outarray.get()+i*nquad0,1);
}
break;
// Legendre inner product
case LibUtilities::eGaussLobattoLegendre:
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*(1-z1[i])*w1[i], outarray.get()+i*nquad0,1);
}
break;
// (1,0) Jacobi Inner product
case LibUtilities::eGaussRadauMAlpha1Beta0:
for(i = 0; i < nquad1; ++i)
{
Blas::Dscal(nquad0,0.5*w1[i], outarray.get()+i*nquad0,1);
}
break;
default:
ASSERTL0(false, "Unsupported quadrature points type.");
break;
}
}
}
......
......@@ -232,7 +232,7 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
cnt = locExp.GetCoeff_Offset(i);
if(locSegExp = boost::dynamic_pointer_cast<LocalRegions::SegExp>(locExpVector[i]))
if((locSegExp = boost::dynamic_pointer_cast<LocalRegions::SegExp>(locExpVector[i])))
{
for(j = 0; j < locSegExp->GetNverts(); ++j)
{
......
......@@ -824,8 +824,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
elmtid = locExp.GetOffset_Elmt_Id(i);
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid])))
{
m_numLocalBndCoeffs += locExpansion->NumBndryCoeffs();
......@@ -843,8 +843,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
elmtid = locExp.GetOffset_Elmt_Id(i);
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid])))
{
vertCnt = 0;
nVerts = locExpansion->GetNverts();
......@@ -873,8 +873,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
elmtid = locExp.GetOffset_Elmt_Id(i);
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid])))
{
edgeCnt = 0;
nVerts = locExpansion->GetNverts();
......@@ -902,8 +902,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
elmtid = locExp.GetOffset_Elmt_Id(i);
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid])))
{
boost::add_vertex(boostGraphObj);
......@@ -917,8 +917,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
elmtid = locExp.GetOffset_Elmt_Id(i);
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D>(
locExpVector[elmtid])))
{
nVerts = locExpansion->GetNverts();
// Now loop over all local edges and vertices
......
......@@ -465,8 +465,8 @@ namespace Nektar
/// - All other vertices and edges
for(i = 0; i < locExpVector.size(); ++i)
{
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)])))
{
nTotalVerts += locExpansion->GetNverts();
nTotalEdges += locExpansion->GetNedges();
......@@ -483,8 +483,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)])))
{
vertCnt = 0;
nVerts = locExpansion->GetNverts();
......@@ -515,8 +515,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)])))
{
edgeCnt = 0;
nEdges = locExpansion->GetNedges();
......@@ -547,8 +547,8 @@ namespace Nektar
for(i = 0; i < locExpVector.size(); ++i)
{
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)])))
{
nFaces = locExpansion->GetNfaces();
faceCnt = 0;
......@@ -582,8 +582,8 @@ namespace Nektar
localFaceOffset=0;
for(i = 0; i < locExpVector.size(); ++i)
{
if(locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)]))
if((locExpansion = boost::dynamic_pointer_cast<StdRegions::StdExpansion3D>(
locExpVector[locExp.GetOffset_Elmt_Id(i)])))
{
nVerts = locExpansion->GetNverts();
nEdges = locExpansion->GetNedges();
......
......@@ -124,7 +124,7 @@ namespace Nektar
cnt = 0;
for(i = 0; i < exp1D->size(); ++i)
{
if(locSegExp = boost::dynamic_pointer_cast<LocalRegions::SegExp>((*exp1D)[i]))
if((locSegExp = boost::dynamic_pointer_cast<LocalRegions::SegExp>((*exp1D)[i])))
{
locSegExp->GetBoundaryMap(vmap);
......@@ -205,7 +205,7 @@ namespace Nektar
// determine mapping from geometry edges to trace
for(i = 0; i < ntrace_exp; ++i)
{
if(locSegExp = boost::dynamic_pointer_cast<LocalRegions::SegExp>(trace->GetExp(i)))
if((locSegExp = boost::dynamic_pointer_cast<LocalRegions::SegExp>(trace->GetExp(i))))
{
id = (locSegExp->GetGeom1D())->GetEid();
......@@ -249,7 +249,7 @@ namespace Nektar
{
m_elmtToTrace[i] = edgemap + cnt;
if(locQuadExp = boost::dynamic_pointer_cast<LocalRegions::QuadExp>((*exp2D)[i]))
if((locQuadExp = boost::dynamic_pointer_cast<LocalRegions::QuadExp>((*exp2D)[i])))
<