Commit 5978e85b authored by David Moxey's avatar David Moxey
Browse files

Pass over NekMeshUtils, MultiRegions and FieldUtils

parent 1292f718
......@@ -72,7 +72,7 @@ class CoalescedGeomData
std::map<GeomData,Array<TwoD, NekDouble> > m_twoDGeomData;
};
typedef boost::shared_ptr<CoalescedGeomData> CoalescedGeomDataSharedPtr;
typedef std::shared_ptr<CoalescedGeomData> CoalescedGeomDataSharedPtr;
static CoalescedGeomDataSharedPtr GeomDataNull;
......
......@@ -49,6 +49,14 @@
namespace Nektar {
namespace Collections {
struct EnumHash
{
template <typename T>
std::size_t operator()(T t) const
{
return static_cast<std::size_t>(t);
}
};
/**
* @brief Collection
......@@ -88,15 +96,15 @@ class Collection
inline bool HasOperator(const OperatorType &op);
protected:
StdRegions::StdExpansionSharedPtr m_stdExp;
std::vector<SpatialDomains::GeometrySharedPtr> m_geom;
boost::unordered_map<OperatorType, OperatorSharedPtr> m_ops;
CoalescedGeomDataSharedPtr m_geomData;
StdRegions::StdExpansionSharedPtr m_stdExp;
std::vector<SpatialDomains::GeometrySharedPtr> m_geom;
std::unordered_map<OperatorType, OperatorSharedPtr, EnumHash> m_ops;
CoalescedGeomDataSharedPtr m_geomData;
};
typedef std::vector<Collection> CollectionVector;
typedef boost::shared_ptr<CollectionVector> CollectionVectorSharedPtr;
typedef std::shared_ptr<CollectionVector> CollectionVectorSharedPtr;
/**
......
......@@ -44,36 +44,36 @@ namespace Collections {
*/
bool operator< (OperatorKey const &p1, OperatorKey const &p2)
{
if (boost::get<0>(p1) < boost::get<0>(p2))
if (std::get<0>(p1) < std::get<0>(p2))
{
return true;
}
if (boost::get<0>(p1) > boost::get<0>(p2))
if (std::get<0>(p1) > std::get<0>(p2))
{
return false;
}
if (boost::get<1>(p1) < boost::get<1>(p2))
if (std::get<1>(p1) < std::get<1>(p2))
{
return true;
}
if (boost::get<1>(p1) > boost::get<1>(p2))
if (std::get<1>(p1) > std::get<1>(p2))
{
return false;
}
if (boost::get<2>(p1) < boost::get<2>(p2))
if (std::get<2>(p1) < std::get<2>(p2))
{
return true;
}
if (boost::get<2>(p1) > boost::get<2>(p2))
if (std::get<2>(p1) > std::get<2>(p2))
{
return false;
}
if (boost::get<3>(p1) < boost::get<3>(p2))
if (std::get<3>(p1) < std::get<3>(p2))
{
return true;
}
if (boost::get<3>(p1) > boost::get<3>(p2))
if (std::get<3>(p1) > std::get<3>(p2))
{
return false;
}
......@@ -87,10 +87,10 @@ bool operator< (OperatorKey const &p1, OperatorKey const &p2)
*/
std::ostream &operator<<(std::ostream &os, OperatorKey const &p)
{
os << LibUtilities::ShapeTypeMap[boost::get<0>(p)] << ", "
<< OperatorTypeMap [boost::get<1>(p)] << ", "
<< ImplementationTypeMap [boost::get<2>(p)] << ", "
<< (boost::get<3>(p) ? "Nodal" : "Modal");
os << LibUtilities::ShapeTypeMap[std::get<0>(p)] << ", "
<< OperatorTypeMap [std::get<1>(p)] << ", "
<< ImplementationTypeMap [std::get<2>(p)] << ", "
<< (std::get<3>(p) ? "Nodal" : "Modal");
return os;
}
......
......@@ -47,7 +47,7 @@
friend class MemoryManager<cname>; \
static OperatorSharedPtr create( \
std::vector<StdRegions::StdExpansionSharedPtr> pCollExp,\
boost::shared_ptr<CoalescedGeomData> GeomData) \
std::shared_ptr<CoalescedGeomData> GeomData) \
{ \
return MemoryManager<cname> \
::AllocateSharedPtr(pCollExp, GeomData); \
......@@ -59,7 +59,7 @@ namespace Collections
{
class CoalescedGeomData;
typedef boost::shared_ptr<CoalescedGeomData> CoalescedGeomDataSharedPtr;
typedef std::shared_ptr<CoalescedGeomData> CoalescedGeomDataSharedPtr;
enum OperatorType
{
......@@ -111,7 +111,7 @@ class Operator
/// Constructor
Operator(
std::vector<StdRegions::StdExpansionSharedPtr> pCollExp,
boost::shared_ptr<CoalescedGeomData> GeomData)
std::shared_ptr<CoalescedGeomData> GeomData)
: m_stdExp(pCollExp[0]->GetStdExp()),
m_numElmt(pCollExp.size()),
m_wspSize(0)
......@@ -149,10 +149,10 @@ class Operator
};
/// Shared pointer to an Operator object
typedef boost::shared_ptr<Operator> OperatorSharedPtr;
typedef std::shared_ptr<Operator> OperatorSharedPtr;
/// Key for describing an Operator
typedef boost::tuple<
typedef std::tuple<
LibUtilities::ShapeType,
OperatorType,
ImplementationType,
......
......@@ -39,10 +39,10 @@
#include <LibUtilities/Communication/CommMpi.h>
#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
#include <boost/unordered_set.hpp>
#include <unordered_set>
#include <string>
typedef boost::unordered_set<int> IntSet;
typedef std::unordered_set<int> IntSet;
using namespace Nektar;
using namespace LibUtilities;
......@@ -218,8 +218,8 @@ Array<OneD, int> ReadIDsForThisRank(Experiment &exp, FieldIOSharedPtr fio)
std::string infoFile = exp.dataSource + "/Info.xml";
boost::shared_ptr<FieldIOXml> fioXml =
boost::dynamic_pointer_cast<FieldIOXml>(fio);
std::shared_ptr<FieldIOXml> fioXml =
std::dynamic_pointer_cast<FieldIOXml>(fio);
fioXml->ImportMultiFldFileIDs(infoFile, fileNames, elementList,
fieldmetadatamap);
......@@ -328,7 +328,6 @@ void FilterDataForThisRank(const DefVec &inFieldDefs,
if (elOut.size())
{
// create the outFieldDefs
// boost::make_shared only works up to 9 arguments it seems.
FieldDefinitionsSharedPtr defOut =
FieldDefinitionsSharedPtr(new FieldDefinitions(
inDef->m_shapeType,
......
......@@ -165,7 +165,7 @@ int main(int argc, char *argv[])
PointsKey key(nPts, pointsType);
PointsSharedPtr points = PointsManager()[key];
//boost::shared_ptr<Points<NekDouble> > points = PointsManager()[key];
//std::shared_ptr<Points<NekDouble> > points = PointsManager()[key];
//const ptr<Points<NekDouble> > points = PointsManager()[key];
......@@ -192,7 +192,7 @@ int main(int argc, char *argv[])
// Generate a list of interpolating nodes
int nNodes = 2*nPts; // Number of interpolating nodes
boost::shared_ptr<Points<NekDouble> > nodes = PointsManager()[PointsKey(nNodes, pointsType)];
std::shared_ptr<Points<NekDouble> > nodes = PointsManager()[PointsKey(nNodes, pointsType)];
Array<OneD, const NekDouble> zNode = nodes->GetZ();
// Get the interpolation matrix I
......
......@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
for (int i = 0; i < dim; ++i)
{
boost::shared_ptr<NekMatrix<NekDouble> > deriv =
std::shared_ptr<NekMatrix<NekDouble> > deriv =
util->GetDerivMatrix(i);
output = *deriv * input;
NekVector<NekDouble> tmp = output - exact[i];
......@@ -276,7 +276,7 @@ int main(int argc, char *argv[])
exp(r[i]) * exp(s[i]) * exp(t[i]);
}
boost::shared_ptr<NekMatrix<NekDouble> > interp =
std::shared_ptr<NekMatrix<NekDouble> > interp =
util->GetInterpolationMatrix(tmp);
NekVector<NekDouble> output = *interp * input;
......
......@@ -60,8 +60,8 @@ public:
virtual ~FauxComm() {}
void v_SplitComm(int pRows, int pColumns)
{
m_commRow = boost::shared_ptr<FauxComm>(new FauxComm(pColumns));
m_commColumn = boost::shared_ptr<FauxComm>(new FauxComm(pRows));
m_commRow = std::shared_ptr<FauxComm>(new FauxComm(pColumns));
m_commColumn = std::shared_ptr<FauxComm>(new FauxComm(pRows));
}
};
......@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
int nParts = atoi(argv[1]);
vector<string> filenames(argv + 2, argv + argc);
CommSharedPtr vComm = boost::shared_ptr<FauxComm>(
CommSharedPtr vComm = std::shared_ptr<FauxComm>(
new FauxComm(argc, argv, nParts));
char **new_argv = new char*[argc];
......
......@@ -36,7 +36,7 @@
#ifndef FIELDUTILS_FIELD
#define FIELDUTILS_FIELD
#include <boost/shared_ptr.hpp>
#include <memory>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <LibUtilities/BasicUtils/PtsField.h>
......@@ -463,7 +463,7 @@ struct Field
"implemented");
MultiRegions::ExpList2DHomogeneous1DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ExpList2DHomogeneous1D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::ExpList2DHomogeneous1D>::
......@@ -474,7 +474,7 @@ struct Field
if (m_declareExpansionAsContField)
{
MultiRegions::ContField3DHomogeneous2DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ContField3DHomogeneous2D>(
m_exp[0]);
......@@ -485,7 +485,7 @@ struct Field
else if (m_declareExpansionAsDisContField)
{
MultiRegions::DisContField3DHomogeneous2DSharedPtr
tmp2 = boost::dynamic_pointer_cast<
tmp2 = std::dynamic_pointer_cast<
MultiRegions::DisContField3DHomogeneous2D>(
m_exp[0]);
......@@ -496,7 +496,7 @@ struct Field
else
{
MultiRegions::ExpList3DHomogeneous2DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ExpList3DHomogeneous2D>(m_exp[0]);
tmp = MemoryManager<
......@@ -509,7 +509,7 @@ struct Field
if (m_declareExpansionAsContField)
{
MultiRegions::ContField1DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ContField1D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::ContField1D>::
......@@ -518,7 +518,7 @@ struct Field
else if (m_declareExpansionAsDisContField)
{
MultiRegions::DisContField1DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::DisContField1D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::DisContField1D>::
......@@ -527,7 +527,7 @@ struct Field
else
{
MultiRegions::ExpList1DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ExpList1D>(m_exp[0]);
tmp = MemoryManager<
......@@ -558,7 +558,7 @@ struct Field
else
{
MultiRegions::ContField3DHomogeneous1DSharedPtr
tmp2 = boost::dynamic_pointer_cast<
tmp2 = std::dynamic_pointer_cast<
MultiRegions::ContField3DHomogeneous1D>(
m_exp[0]);
......@@ -586,7 +586,7 @@ struct Field
else
{
MultiRegions::DisContField3DHomogeneous1DSharedPtr
tmp2 = boost::dynamic_pointer_cast<
tmp2 = std::dynamic_pointer_cast<
MultiRegions::DisContField3DHomogeneous1D>(
m_exp[0]);
ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
......@@ -614,7 +614,7 @@ struct Field
else
{
MultiRegions::ExpList3DHomogeneous1DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ExpList3DHomogeneous1D>(
m_exp[0]);
ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
......@@ -638,7 +638,7 @@ struct Field
{
MultiRegions::ContField2DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ContField2D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::ContField2D>::
......@@ -655,7 +655,7 @@ struct Field
else // call copy constructor
{
MultiRegions::DisContField2DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::DisContField2D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::DisContField2D>::
......@@ -665,7 +665,7 @@ struct Field
else
{
MultiRegions::ExpList2DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ExpList2D>(m_exp[0]);
tmp = MemoryManager<
......@@ -686,7 +686,7 @@ struct Field
else
{
MultiRegions::ContField3DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::ContField3D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::ContField3D>::
......@@ -705,7 +705,7 @@ struct Field
else
{
MultiRegions::DisContField3DSharedPtr tmp2 =
boost::dynamic_pointer_cast<
std::dynamic_pointer_cast<
MultiRegions::DisContField3D>(m_exp[0]);
tmp = MemoryManager<MultiRegions::DisContField3D>::
......@@ -715,7 +715,7 @@ struct Field
else
{
MultiRegions::ExpList3DSharedPtr tmp2 =
boost::dynamic_pointer_cast<MultiRegions::ExpList3D>(
std::dynamic_pointer_cast<MultiRegions::ExpList3D>(
m_exp[0]);
tmp = MemoryManager<
......@@ -737,7 +737,7 @@ private:
map<string, LibUtilities::FieldIOSharedPtr> m_fld;
};
typedef boost::shared_ptr<Field> FieldSharedPtr;
typedef std::shared_ptr<Field> FieldSharedPtr;
}
}
......
......@@ -39,14 +39,13 @@
#include <vector>
#include <iostream>
#include <functional>
#include <memory>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <MultiRegions/ExpList.h>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
......@@ -155,7 +154,8 @@ public:
template <typename FuncPointerT, typename ObjectPointerT>
void SetProgressCallback(FuncPointerT func, ObjectPointerT obj)
{
m_progressCallback = boost::bind(func, obj, _1, _2);
m_progressCallback = std::bind(
func, obj, std::placeholders::_1, std::placeholders::_2);
}
private:
......@@ -197,7 +197,7 @@ private:
/// A tree structure to speed up the neighbour search.
/// Note that we fill it with an iterator, so instead of rstar, the
/// packing algorithm is used.
boost::shared_ptr<PtsRtree> m_rtree;
std::shared_ptr<PtsRtree> m_rtree;
/// Interpolation weights for each neighbour.
/// Structure: m_weights[physPtIdx][neighbourIdx]
Array<TwoD, float> m_weights;
......@@ -211,7 +211,7 @@ private:
/// coordinate id along which the interpolation should be performed
short int m_coordId;
boost::function<void(const int position, const int goal)>
std::function<void(const int position, const int goal)>
m_progressCallback;
FIELD_UTILS_EXPORT void CalcW_Gauss(const PtsPoint &searchPt,
......@@ -239,7 +239,7 @@ private:
const unsigned int numPts = 1);
};
typedef boost::shared_ptr<Interpolator> InterpolatorSharedPtr;
typedef std::shared_ptr<Interpolator> InterpolatorSharedPtr;
static InterpolatorSharedPtr NullInterpolator;
}
}
......
......@@ -227,7 +227,7 @@ protected:
set<string> m_allowedFiles;
};
typedef boost::shared_ptr<InputModule> InputModuleSharedPtr;
typedef std::shared_ptr<InputModule> InputModuleSharedPtr;
/**
* @brief Abstract base class for processing modules.
......@@ -262,7 +262,7 @@ protected:
typedef pair<ModuleType, string> ModuleKey;
FIELD_UTILS_EXPORT ostream &operator<<(ostream &os, const ModuleKey &rhs);
typedef boost::shared_ptr<Module> ModuleSharedPtr;
typedef std::shared_ptr<Module> ModuleSharedPtr;
typedef LibUtilities::NekFactory<ModuleKey, Module, FieldSharedPtr>
ModuleFactory;
......@@ -290,10 +290,10 @@ public:
void v_SplitComm(int pRows, int pColumns)
{
// Compute row and column in grid.
m_commRow = boost::shared_ptr<FieldConvertComm>(
m_commRow = std::shared_ptr<FieldConvertComm>(
new FieldConvertComm(pColumns, m_rank));
m_commColumn =
boost::shared_ptr<FieldConvertComm>(new FieldConvertComm(pRows, 0));
std::shared_ptr<FieldConvertComm>(new FieldConvertComm(pRows, 0));
}
protected:
......
......@@ -49,7 +49,7 @@ class OutputFld : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputFld>::AllocateSharedPtr(f);
}
......
......@@ -78,7 +78,7 @@ void OutputInfo::Process(po::variables_map &vm)
int nprocs = vm["nprocs"].as<int>();
LibUtilities::CommSharedPtr vComm = boost::shared_ptr<FieldConvertComm>(
LibUtilities::CommSharedPtr vComm = std::shared_ptr<FieldConvertComm>(
new FieldConvertComm(0, NULL, nprocs, 0));
vComm->SplitComm(1, nprocs);
......@@ -100,7 +100,7 @@ void OutputInfo::Process(po::variables_map &vm)
}
LibUtilities::SessionReaderSharedPtr vSession =
boost::shared_ptr<LibUtilities::SessionReader>(
std::shared_ptr<LibUtilities::SessionReader>(
new LibUtilities::SessionReader(0, 0, files, vComm));
vSession->SetUpXmlDoc();
......@@ -150,8 +150,8 @@ void OutputInfo::Process(po::variables_map &vm)
// Write the output file
LibUtilities::CommSharedPtr c = m_f->m_session ? m_f->m_session->GetComm() :
LibUtilities::GetCommFactory().CreateInstance("Serial", 0, 0);
boost::shared_ptr<LibUtilities::FieldIOXml> fldXml =
boost::static_pointer_cast<LibUtilities::FieldIOXml>(
std::shared_ptr<LibUtilities::FieldIOXml> fldXml =
std::static_pointer_cast<LibUtilities::FieldIOXml>(
LibUtilities::GetFieldIOFactory().CreateInstance("Xml", c, true));
fldXml->WriteMultiFldFileIDs(filename, filenames, ElementIDs);
}
......
......@@ -48,7 +48,7 @@ class OutputInfo : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputInfo>::AllocateSharedPtr(f);
}
......
......@@ -49,7 +49,7 @@ class OutputPts : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputPts>::AllocateSharedPtr(f);
}
......
......@@ -48,7 +48,7 @@ class OutputStdOut : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputStdOut>::AllocateSharedPtr(f);
}
......
......@@ -62,7 +62,7 @@ class OutputTecplot : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputTecplot>::AllocateSharedPtr(f);
}
......@@ -119,7 +119,7 @@ class OutputTecplotBinary : public OutputTecplot
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputTecplotBinary>::AllocateSharedPtr(f);
}
......
......@@ -49,7 +49,7 @@ class OutputVtk : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputVtk>::AllocateSharedPtr(f);
}
......
......@@ -48,7 +48,7 @@ class OutputXml : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
static std::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<OutputXml>::AllocateSharedPtr(f);
}
......