Commit 8d398644 authored by Dave Moxey's avatar Dave Moxey

Fix ICC bug, bug with default implementation not being read

parent 64b4092a
......@@ -34,6 +34,7 @@
///////////////////////////////////////////////////////////////////////////////
#include <Collections/Collection.h>
#include <sstream>
namespace Nektar {
namespace Collections {
......@@ -62,8 +63,10 @@ Collection::Collection(
OperatorKey opKey(pCollExp[0]->DetShapeType(), opType, impType,
pCollExp[0]->IsNodalNonTensorialExp());
stringstream ss;
ss << opKey;
ASSERTL0(GetOperatorFactory().ModuleExists(opKey),
"Requested unknown operator");
"Requested unknown operator "+ss.str());
m_ops[opType] = GetOperatorFactory().CreateInstance(
opKey, pCollExp, m_geomData);
......
......@@ -60,16 +60,6 @@ CollectionOptimisation::CollectionOptimisation(
m_maxCollSize = 0;
m_defaultType = defaultType;
// Default all elements to eStdMat
defaults[ElmtOrder(LibUtilities::eSegment, -1)] = defaultType;
defaults[ElmtOrder(LibUtilities::eTriangle, -1)] = defaultType;
defaults[ElmtOrder(LibUtilities::eQuadrilateral, -1)] = defaultType;
defaults[ElmtOrder(LibUtilities::eTetrahedron, -1)] = defaultType;
defaults[ElmtOrder(LibUtilities::ePyramid, -1)] = defaultType;
defaults[ElmtOrder(LibUtilities::ePrism, -1)] = defaultType;
defaults[ElmtOrder(LibUtilities::eHexahedron, -1)] = defaultType;
map<string, LibUtilities::ShapeType> elTypes;
map<string, LibUtilities::ShapeType>::iterator it2;
elTypes["S"] = LibUtilities::eSegment;
......@@ -80,6 +70,12 @@ CollectionOptimisation::CollectionOptimisation(
elTypes["R"] = LibUtilities::ePrism;
elTypes["H"] = LibUtilities::eHexahedron;
// Set defaults for all element types.
for (it2 = elTypes.begin(); it2 != elTypes.end(); ++it2)
{
defaults[ElmtOrder(it2->second, -1)] = defaultType;
}
map<string, OperatorType> opTypes;
for (i = 0; i < SIZE_OperatorType; ++i)
{
......@@ -124,6 +120,20 @@ CollectionOptimisation::CollectionOptimisation(
break;
}
}
ASSERTL0(i != Collections::SIZE_ImplementationType,
"Unknown default collection scheme: "+collinfo);
// Override default types
for (it2 = elTypes.begin(); it2 != elTypes.end(); ++it2)
{
defaults[ElmtOrder(it2->second, -1)] = m_defaultType;
}
for (i = 0; i < SIZE_OperatorType; ++i)
{
m_global[(OperatorType)i] = defaults;
}
}
}
......
......@@ -2626,7 +2626,7 @@ namespace Nektar
case LibUtilities::eTriangle:
{
StdRegions::StdNodalTriExpSharedPtr nexp;
if((nexp = boost::dynamic_pointer_cast<StdRegions::StdNodalTriExp>(exp)))
if((nexp = exp->as<StdRegions::StdNodalTriExp>()))
{
stdExp = MemoryManager<StdRegions::StdNodalTriExp>
::AllocateSharedPtr(exp->GetBasis(0)->GetBasisKey(),
......@@ -2634,11 +2634,11 @@ namespace Nektar
nexp->GetNodalPointsKey().GetPointsType());
}
else
{
stdExp = MemoryManager<StdRegions::StdTriExp>
::AllocateSharedPtr(exp->GetBasis(0)->GetBasisKey(),
exp->GetBasis(1)->GetBasisKey());
}
{
stdExp = MemoryManager<StdRegions::StdTriExp>
::AllocateSharedPtr(exp->GetBasis(0)->GetBasisKey(),
exp->GetBasis(1)->GetBasisKey());
}
}
break;
case LibUtilities::eQuadrilateral:
......
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