Commit e742494f authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Rename all subclasses of XdmfGrid to more syntactically friendly names:...

ENH: Rename all subclasses of XdmfGrid to more syntactically friendly names: i.e. XdmfGridUnstructured to XdmfUnstructuredGrid.
parent 8f513707
This diff is collapsed.
......@@ -7,15 +7,15 @@
#include <cmath>
#include "XdmfArray.hpp"
#include "XdmfCurvilinearGrid.hpp"
#include "XdmfGeometry.hpp"
#include "XdmfGridCurvilinear.hpp"
#include "XdmfTopology.hpp"
#include "XdmfTopologyType.hpp"
/**
* PIMPL
*/
class XdmfGridCurvilinear::XdmfGridCurvilinearImpl {
class XdmfCurvilinearGrid::XdmfCurvilinearGridImpl {
public:
......@@ -24,7 +24,7 @@ public:
public:
static boost::shared_ptr<XdmfTopologyCurvilinear> New(const XdmfGridCurvilinear * const curvilinearGrid)
static boost::shared_ptr<XdmfTopologyCurvilinear> New(const XdmfCurvilinearGrid * const curvilinearGrid)
{
boost::shared_ptr<XdmfTopologyCurvilinear> p(new XdmfTopologyCurvilinear(curvilinearGrid));
return p;
......@@ -47,13 +47,13 @@ public:
private:
XdmfTopologyCurvilinear(const XdmfGridCurvilinear * const curvilinearGrid) :
XdmfTopologyCurvilinear(const XdmfCurvilinearGrid * const curvilinearGrid) :
mCurvilinearGrid(curvilinearGrid)
{
this->setType(XdmfTopologyTypeCurvilinear::New(curvilinearGrid));
}
const XdmfGridCurvilinear * const mCurvilinearGrid;
const XdmfCurvilinearGrid * const mCurvilinearGrid;
};
class XdmfTopologyTypeCurvilinear : public XdmfTopologyType
......@@ -61,7 +61,7 @@ public:
public:
static boost::shared_ptr<const XdmfTopologyTypeCurvilinear> New(const XdmfGridCurvilinear * const curvilinearGrid)
static boost::shared_ptr<const XdmfTopologyTypeCurvilinear> New(const XdmfCurvilinearGrid * const curvilinearGrid)
{
boost::shared_ptr<const XdmfTopologyTypeCurvilinear> p(new XdmfTopologyTypeCurvilinear(curvilinearGrid));
return p;
......@@ -94,17 +94,17 @@ public:
private:
XdmfTopologyTypeCurvilinear(const XdmfGridCurvilinear * const curvilinearGrid) :
XdmfTopologyTypeCurvilinear(const XdmfCurvilinearGrid * const curvilinearGrid) :
XdmfTopologyType(0, "foo", XdmfTopologyType::Structured, 0x1110),
mCurvilinearGrid(curvilinearGrid)
{
}
const XdmfGridCurvilinear * const mCurvilinearGrid;
const XdmfCurvilinearGrid * const mCurvilinearGrid;
};
XdmfGridCurvilinearImpl(const boost::shared_ptr<XdmfArray> numPoints) :
XdmfCurvilinearGridImpl(const boost::shared_ptr<XdmfArray> numPoints) :
mDimensions(numPoints)
{
}
......@@ -113,17 +113,17 @@ public:
};
boost::shared_ptr<XdmfGridCurvilinear> XdmfGridCurvilinear::New(const unsigned int xNumPoints, const unsigned int yNumPoints)
boost::shared_ptr<XdmfCurvilinearGrid> XdmfCurvilinearGrid::New(const unsigned int xNumPoints, const unsigned int yNumPoints)
{
boost::shared_ptr<XdmfArray> numPoints = XdmfArray::New();
numPoints->resize<unsigned int>(2);
numPoints->insert(0, xNumPoints);
numPoints->insert(1, yNumPoints);
boost::shared_ptr<XdmfGridCurvilinear> p(new XdmfGridCurvilinear(numPoints));
boost::shared_ptr<XdmfCurvilinearGrid> p(new XdmfCurvilinearGrid(numPoints));
return p;
}
boost::shared_ptr<XdmfGridCurvilinear> XdmfGridCurvilinear::New(const unsigned int xNumPoints, const unsigned int yNumPoints,
boost::shared_ptr<XdmfCurvilinearGrid> XdmfCurvilinearGrid::New(const unsigned int xNumPoints, const unsigned int yNumPoints,
const unsigned int zNumPoints)
{
boost::shared_ptr<XdmfArray> numPoints = XdmfArray::New();
......@@ -131,63 +131,63 @@ boost::shared_ptr<XdmfGridCurvilinear> XdmfGridCurvilinear::New(const unsigned i
numPoints->insert(0, xNumPoints);
numPoints->insert(1, yNumPoints);
numPoints->insert(2, zNumPoints);
boost::shared_ptr<XdmfGridCurvilinear> p(new XdmfGridCurvilinear(numPoints));
boost::shared_ptr<XdmfCurvilinearGrid> p(new XdmfCurvilinearGrid(numPoints));
return p;
}
boost::shared_ptr<XdmfGridCurvilinear> XdmfGridCurvilinear::New(const boost::shared_ptr<XdmfArray> numPoints)
boost::shared_ptr<XdmfCurvilinearGrid> XdmfCurvilinearGrid::New(const boost::shared_ptr<XdmfArray> numPoints)
{
boost::shared_ptr<XdmfGridCurvilinear> p(new XdmfGridCurvilinear(numPoints));
boost::shared_ptr<XdmfCurvilinearGrid> p(new XdmfCurvilinearGrid(numPoints));
return p;
}
XdmfGridCurvilinear::XdmfGridCurvilinear(const boost::shared_ptr<XdmfArray> numPoints) :
XdmfGrid(XdmfGeometry::New(), XdmfGridCurvilinearImpl::XdmfTopologyCurvilinear::New(this)),
mImpl(new XdmfGridCurvilinearImpl(numPoints))
XdmfCurvilinearGrid::XdmfCurvilinearGrid(const boost::shared_ptr<XdmfArray> numPoints) :
XdmfGrid(XdmfGeometry::New(), XdmfCurvilinearGridImpl::XdmfTopologyCurvilinear::New(this)),
mImpl(new XdmfCurvilinearGridImpl(numPoints))
{
}
XdmfGridCurvilinear::~XdmfGridCurvilinear()
XdmfCurvilinearGrid::~XdmfCurvilinearGrid()
{
delete mImpl;
}
const std::string XdmfGridCurvilinear::ItemTag = "Grid";
const std::string XdmfCurvilinearGrid::ItemTag = "Grid";
boost::shared_ptr<XdmfArray> XdmfGridCurvilinear::getDimensions()
boost::shared_ptr<XdmfArray> XdmfCurvilinearGrid::getDimensions()
{
return boost::const_pointer_cast<XdmfArray>(static_cast<const XdmfGridCurvilinear &>(*this).getDimensions());
return boost::const_pointer_cast<XdmfArray>(static_cast<const XdmfCurvilinearGrid &>(*this).getDimensions());
}
boost::shared_ptr<const XdmfArray> XdmfGridCurvilinear::getDimensions() const
boost::shared_ptr<const XdmfArray> XdmfCurvilinearGrid::getDimensions() const
{
return mImpl->mDimensions;
}
boost::shared_ptr<XdmfGeometry> XdmfGridCurvilinear::getGeometry()
boost::shared_ptr<XdmfGeometry> XdmfCurvilinearGrid::getGeometry()
{
return boost::const_pointer_cast<XdmfGeometry>(static_cast<const XdmfGrid &>(*this).getGeometry());
}
void XdmfGridCurvilinear::populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader)
void XdmfCurvilinearGrid::populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader)
{
XdmfGrid::populateItem(itemProperties, childItems, reader);
for(std::vector<boost::shared_ptr<XdmfItem> >::const_iterator iter = childItems.begin(); iter != childItems.end(); ++iter)
{
if(boost::shared_ptr<XdmfGridCurvilinear> curvilinearGrid = boost::shared_dynamic_cast<XdmfGridCurvilinear>(*iter))
if(boost::shared_ptr<XdmfCurvilinearGrid> curvilinearGrid = boost::shared_dynamic_cast<XdmfCurvilinearGrid>(*iter))
{
mImpl->mDimensions = curvilinearGrid->getDimensions();
}
}
}
void XdmfGridCurvilinear::setDimensions(const boost::shared_ptr<XdmfArray> dimensions)
void XdmfCurvilinearGrid::setDimensions(const boost::shared_ptr<XdmfArray> dimensions)
{
mImpl->mDimensions = dimensions;
}
void XdmfGridCurvilinear::setGeometry(const boost::shared_ptr<XdmfGeometry> geometry)
void XdmfCurvilinearGrid::setGeometry(const boost::shared_ptr<XdmfGeometry> geometry)
{
mGeometry = geometry;
}
......
#ifndef XDMFGRIDCURVILINEAR_HPP_
#define XDMFGRIDCURVILINEAR_HPP_
#ifndef XDMFCURVILINEARGRID_HPP_
#define XDMFCURVILINEARGRID_HPP_
// Forward Declarations
class XdmfArray;
......@@ -10,14 +10,14 @@ class XdmfArray;
/**
* @brief A curvilinear (or structured) grid consisting of cells and points arranged on a regular lattice in space.
*
* XdmfGridCurvilinear represents a mesh of cells and points arranged with regular topology in space. A curvilinear grid
* XdmfCurvilinearGrid represents a mesh of cells and points arranged with regular topology in space. A curvilinear grid
* contains regular topology but irregular geometry.
*
* In order to define a curvilinear grid, the dimensions of the grid must be supplied and the coordinates of each point
* must be specified.
*
*/
class XdmfGridCurvilinear : public XdmfGrid {
class XdmfCurvilinearGrid : public XdmfGrid {
public:
......@@ -29,7 +29,7 @@ public:
*
* @return constructed curvilinear grid.
*/
static boost::shared_ptr<XdmfGridCurvilinear> New(const unsigned int xNumPoints, const unsigned int yNumPoints);
static boost::shared_ptr<XdmfCurvilinearGrid> New(const unsigned int xNumPoints, const unsigned int yNumPoints);
/**
* Create a new curvilinear grid (Three dimensional).
......@@ -40,7 +40,7 @@ public:
*
* @return constructed curvilinear grid.
*/
static boost::shared_ptr<XdmfGridCurvilinear> New(const unsigned int xNumPoints, const unsigned int yNumPoints,
static boost::shared_ptr<XdmfCurvilinearGrid> New(const unsigned int xNumPoints, const unsigned int yNumPoints,
const unsigned int zNumPounts);
/**
......@@ -50,11 +50,11 @@ public:
*
* @return constructed curvilinear grid.
*/
static boost::shared_ptr<XdmfGridCurvilinear> New(const boost::shared_ptr<XdmfArray> numPoints);
static boost::shared_ptr<XdmfCurvilinearGrid> New(const boost::shared_ptr<XdmfArray> numPoints);
virtual ~XdmfGridCurvilinear();
virtual ~XdmfCurvilinearGrid();
LOKI_DEFINE_VISITABLE(XdmfGridCurvilinear, XdmfGrid)
LOKI_DEFINE_VISITABLE(XdmfCurvilinearGrid, XdmfGrid)
static const std::string ItemTag;
/**
......@@ -94,7 +94,7 @@ public:
protected:
XdmfGridCurvilinear(const boost::shared_ptr<XdmfArray> numPoints);
XdmfCurvilinearGrid(const boost::shared_ptr<XdmfArray> numPoints);
void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
......@@ -103,13 +103,13 @@ private:
/**
* PIMPL
*/
class XdmfGridCurvilinearImpl;
class XdmfCurvilinearGridImpl;
XdmfGridCurvilinear(const XdmfGridCurvilinear & grid); // Not implemented.
void operator=(const XdmfGridCurvilinear & grid); // Not implemented.
XdmfCurvilinearGrid(const XdmfCurvilinearGrid & grid); // Not implemented.
void operator=(const XdmfCurvilinearGrid & grid); // Not implemented.
XdmfGridCurvilinearImpl * mImpl;
XdmfCurvilinearGridImpl * mImpl;
};
#endif /* XDMFGRIDRECTILINEAR_HPP_ */
#endif /* XDMFCURVILINEARGRID_HPP_ */
......@@ -6,17 +6,17 @@
*/
#include "XdmfDomain.hpp"
#include "XdmfCurvilinearGrid.hpp"
#include "XdmfGridCollection.hpp"
#include "XdmfGridCurvilinear.hpp"
#include "XdmfGridRectilinear.hpp"
#include "XdmfGridRegular.hpp"
#include "XdmfGridUnstructured.hpp"
#include "XdmfRectilinearGrid.hpp"
#include "XdmfRegularGrid.hpp"
#include "XdmfUnstructuredGrid.hpp"
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfGridCollection, GridCollection, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfGridCurvilinear, GridCurvilinear, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfGridRectilinear, GridRectilinear, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfGridRegular, GridRegular, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfGridUnstructured, GridUnstructured, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfCurvilinearGrid, CurvilinearGrid, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfRectilinearGrid, RectilinearGrid, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfRegularGrid, RegularGrid, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfDomain, XdmfUnstructuredGrid, UnstructuredGrid, Name)
boost::shared_ptr<XdmfDomain> XdmfDomain::New()
{
......@@ -54,19 +54,19 @@ void XdmfDomain::populateItem(const std::map<std::string, std::string> & itemPro
{
this->insert(gridCollection);
}
else if(boost::shared_ptr<XdmfGridCurvilinear> grid = boost::shared_dynamic_cast<XdmfGridCurvilinear>(*iter))
else if(boost::shared_ptr<XdmfCurvilinearGrid> grid = boost::shared_dynamic_cast<XdmfCurvilinearGrid>(*iter))
{
this->insert(grid);
}
else if(boost::shared_ptr<XdmfGridRectilinear> grid = boost::shared_dynamic_cast<XdmfGridRectilinear>(*iter))
else if(boost::shared_ptr<XdmfRectilinearGrid> grid = boost::shared_dynamic_cast<XdmfRectilinearGrid>(*iter))
{
this->insert(grid);
}
else if(boost::shared_ptr<XdmfGridRegular> grid = boost::shared_dynamic_cast<XdmfGridRegular>(*iter))
else if(boost::shared_ptr<XdmfRegularGrid> grid = boost::shared_dynamic_cast<XdmfRegularGrid>(*iter))
{
this->insert(grid);
}
else if(boost::shared_ptr<XdmfGridUnstructured> grid = boost::shared_dynamic_cast<XdmfGridUnstructured>(*iter))
else if(boost::shared_ptr<XdmfUnstructuredGrid> grid = boost::shared_dynamic_cast<XdmfUnstructuredGrid>(*iter))
{
this->insert(grid);
}
......@@ -80,19 +80,19 @@ void XdmfDomain::traverse(const boost::shared_ptr<XdmfBaseVisitor> visitor)
{
(*iter)->accept(visitor);
}
for(std::vector<boost::shared_ptr<XdmfGridCurvilinear> >::const_iterator iter = mGridCurvilinears.begin(); iter != mGridCurvilinears.end(); ++iter)
for(std::vector<boost::shared_ptr<XdmfCurvilinearGrid> >::const_iterator iter = mCurvilinearGrids.begin(); iter != mCurvilinearGrids.end(); ++iter)
{
(*iter)->accept(visitor);
}
for(std::vector<boost::shared_ptr<XdmfGridRectilinear> >::const_iterator iter = mGridRectilinears.begin(); iter != mGridRectilinears.end(); ++iter)
for(std::vector<boost::shared_ptr<XdmfRectilinearGrid> >::const_iterator iter = mRectilinearGrids.begin(); iter != mRectilinearGrids.end(); ++iter)
{
(*iter)->accept(visitor);
}
for(std::vector<boost::shared_ptr<XdmfGridRegular> >::const_iterator iter = mGridRegulars.begin(); iter != mGridRegulars.end(); ++iter)
for(std::vector<boost::shared_ptr<XdmfRegularGrid> >::const_iterator iter = mRegularGrids.begin(); iter != mRegularGrids.end(); ++iter)
{
(*iter)->accept(visitor);
}
for(std::vector<boost::shared_ptr<XdmfGridUnstructured> >::const_iterator iter = mGridUnstructureds.begin(); iter != mGridUnstructureds.end(); ++iter)
for(std::vector<boost::shared_ptr<XdmfUnstructuredGrid> >::const_iterator iter = mUnstructuredGrids.begin(); iter != mUnstructuredGrids.end(); ++iter)
{
(*iter)->accept(visitor);
}
......
......@@ -2,11 +2,11 @@
#define XDMFDOMAIN_HPP_
// Forward Declarations
class XdmfCurvilinearGrid;
class XdmfGridCollection;
class XdmfGridCurvilinear;
class XdmfGridRectilinear;
class XdmfGridRegular;
class XdmfGridUnstructured;
class XdmfRectilinearGrid;
class XdmfRegularGrid;
class XdmfUnstructuredGrid;
// Includes
#include "XdmfItem.hpp"
......@@ -31,10 +31,10 @@ public:
LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem)
XDMF_CHILDREN(XdmfGridCollection, GridCollection, Name)
XDMF_CHILDREN(XdmfGridCurvilinear, GridCurvilinear, Name)
XDMF_CHILDREN(XdmfGridRectilinear, GridRectilinear, Name)
XDMF_CHILDREN(XdmfGridRegular, GridRegular, Name)
XDMF_CHILDREN(XdmfGridUnstructured, GridUnstructured, Name)
XDMF_CHILDREN(XdmfCurvilinearGrid, CurvilinearGrid, Name)
XDMF_CHILDREN(XdmfRectilinearGrid, RectilinearGrid, Name)
XDMF_CHILDREN(XdmfRegularGrid, RegularGrid, Name)
XDMF_CHILDREN(XdmfUnstructuredGrid, UnstructuredGrid, Name)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
#include <boost/tokenizer.hpp>
#include "XdmfAttribute.hpp"
#include "XdmfCurvilinearGrid.hpp"
#include "XdmfDomain.hpp"
#include "XdmfGeometry.hpp"
#include "XdmfGeometryType.hpp"
#include "XdmfGridCollection.hpp"
#include "XdmfGridCurvilinear.hpp"
#include "XdmfGridRectilinear.hpp"
#include "XdmfGridRegular.hpp"
#include "XdmfGridUnstructured.hpp"
#include "XdmfInformation.hpp"
#include "XdmfItemFactory.hpp"
#include "XdmfMap.hpp"
#include "XdmfRectilinearGrid.hpp"
#include "XdmfRegularGrid.hpp"
#include "XdmfSet.hpp"
#include "XdmfTime.hpp"
#include "XdmfTopology.hpp"
#include "XdmfUnstructuredGrid.hpp"
boost::shared_ptr<XdmfItemFactory> XdmfItemFactory::New()
{
......@@ -78,7 +78,7 @@ boost::shared_ptr<XdmfItem> XdmfItemFactory::createItem(const std::string & item
}
if(origin && brickSize)
{
return XdmfGridRegular::New(brickSize, boost::shared_ptr<XdmfArray>(), origin);
return XdmfRegularGrid::New(brickSize, boost::shared_ptr<XdmfArray>(), origin);
}
return boost::shared_ptr<XdmfItem>();
}
......@@ -92,7 +92,7 @@ boost::shared_ptr<XdmfItem> XdmfItemFactory::createItem(const std::string & item
coordinateValues.push_back(array);
}
}
return XdmfGridRectilinear::New(coordinateValues);
return XdmfRectilinearGrid::New(coordinateValues);
}
}
return XdmfGeometry::New();
......@@ -110,21 +110,21 @@ boost::shared_ptr<XdmfItem> XdmfItemFactory::createItem(const std::string & item
// Find out what kind of grid we have
for(std::vector<boost::shared_ptr<XdmfItem> >::const_iterator iter = childItems.begin(); iter != childItems.end(); ++iter)
{
if(boost::shared_ptr<XdmfGridCurvilinear> curvilinear = boost::shared_dynamic_cast<XdmfGridCurvilinear>(*iter))
if(boost::shared_ptr<XdmfCurvilinearGrid> curvilinear = boost::shared_dynamic_cast<XdmfCurvilinearGrid>(*iter))
{
return XdmfGridCurvilinear::New(0, 0);
return XdmfCurvilinearGrid::New(0, 0);
}
else if(boost::shared_ptr<XdmfGridRegular> regularGrid = boost::shared_dynamic_cast<XdmfGridRegular>(*iter))
else if(boost::shared_ptr<XdmfRegularGrid> regularGrid = boost::shared_dynamic_cast<XdmfRegularGrid>(*iter))
{
return XdmfGridRegular::New(0, 0, 0, 0, 0, 0);
return XdmfRegularGrid::New(0, 0, 0, 0, 0, 0);
}
else if(boost::shared_ptr<XdmfGridRectilinear> rectilinearGrid = boost::shared_dynamic_cast<XdmfGridRectilinear>(*iter))
else if(boost::shared_ptr<XdmfRectilinearGrid> rectilinearGrid = boost::shared_dynamic_cast<XdmfRectilinearGrid>(*iter))
{
std::vector<boost::shared_ptr<XdmfArray> > coordinateValues;
return XdmfGridRectilinear::New(coordinateValues);
return XdmfRectilinearGrid::New(coordinateValues);
}
}
return XdmfGridUnstructured::New();
return XdmfUnstructuredGrid::New();
}
}
else if(itemTag.compare(XdmfInformation::ItemTag) == 0)
......@@ -172,17 +172,17 @@ boost::shared_ptr<XdmfItem> XdmfItemFactory::createItem(const std::string & item
}
if(typeVal.compare("2DCORECTMESH") == 0 || typeVal.compare("3DCORECTMESH") == 0)
{
return XdmfGridRegular::New(boost::shared_ptr<XdmfArray>(), dimensionsArray, boost::shared_ptr<XdmfArray>());
return XdmfRegularGrid::New(boost::shared_ptr<XdmfArray>(), dimensionsArray, boost::shared_ptr<XdmfArray>());
}
else
{
return XdmfGridCurvilinear::New(dimensionsArray);
return XdmfCurvilinearGrid::New(dimensionsArray);
}
}
else if(typeVal.compare("2DRECTMESH") == 0 || typeVal.compare("3DRECTMESH") == 0)
{
std::vector<boost::shared_ptr<XdmfArray> > coordinateValues;
return XdmfGridRectilinear::New(coordinateValues);
return XdmfRectilinearGrid::New(coordinateValues);
}
}
......
#ifndef XDMFGRIDRECTILINEAR_HPP_
#define XDMFGRIDRECTILINEAR_HPP_
#ifndef XDMFRECTILINEARGRID_HPP_
#define XDMFRECTILINEARGRID_HPP_
// Forward Declarations
class XdmfArray;
......@@ -10,14 +10,14 @@ class XdmfArray;
/**
* @brief A rectilinear grid consisting of cells and points arranged on a regular lattice in space.
*
* XdmfGridRectilinear represents a mesh of cells and point arranged on a regular lattice in space.
* XdmfRectilinearGrid represents a mesh of cells and point arranged on a regular lattice in space.
* Points are arranged along coordinate axes, but the spacing between points may vary.
*
* In order to define a rectilinear grid, the coordinates along each axis direction
* must be specified.
*
*/
class XdmfGridRectilinear : public XdmfGrid {
class XdmfRectilinearGrid : public XdmfGrid {
public:
......@@ -29,7 +29,7 @@ public:
*
* @return constructed rectilinear grid.
*/
static boost::shared_ptr<XdmfGridRectilinear> New(const boost::shared_ptr<XdmfArray> xCoordinates, const boost::shared_ptr<XdmfArray> yCoordinates);
static boost::shared_ptr<XdmfRectilinearGrid> New(const boost::shared_ptr<XdmfArray> xCoordinates, const boost::shared_ptr<XdmfArray> yCoordinates);
/**
* Create a new rectilinear grid (Three dimensional).
......@@ -40,7 +40,7 @@ public:
*
* @return constructed rectilinear grid.
*/
static boost::shared_ptr<XdmfGridRectilinear> New(const boost::shared_ptr<XdmfArray> xCoordinates, const boost::shared_ptr<XdmfArray> yCoordinates,
static boost::shared_ptr<XdmfRectilinearGrid> New(const boost::shared_ptr<XdmfArray> xCoordinates, const boost::shared_ptr<XdmfArray> yCoordinates,
const boost::shared_ptr<XdmfArray> zCoordinates);
/**
......@@ -50,11 +50,11 @@ public:
*
* @return constructed rectilinear grid.
*/
static boost::shared_ptr<XdmfGridRectilinear> New(const std::vector<boost::shared_ptr<XdmfArray> > & axesCoordinates);
static boost::shared_ptr<XdmfRectilinearGrid> New(const std::vector<boost::shared_ptr<XdmfArray> > & axesCoordinates);
virtual ~XdmfGridRectilinear();
virtual ~XdmfRectilinearGrid();
LOKI_DEFINE_VISITABLE(XdmfGridRectilinear, XdmfGrid)
LOKI_DEFINE_VISITABLE(XdmfRectilinearGrid, XdmfGrid)
static const std::string ItemTag;
/**
......@@ -120,7 +120,7 @@ public:
protected:
XdmfGridRectilinear(const std::vector<boost::shared_ptr<XdmfArray> > & axesCoordinates);
XdmfRectilinearGrid(const std::vector<boost::shared_ptr<XdmfArray> > & axesCoordinates);
void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
......@@ -129,13 +129,13 @@ private:
/**
* PIMPL
*/
class XdmfGridRectilinearImpl;
class XdmfRectilinearGridImpl;
XdmfGridRectilinear(const XdmfGridRectilinear & grid); // Not implemented.
void operator=(const XdmfGridRectilinear & grid); // Not implemented.
XdmfRectilinearGrid(const XdmfRectilinearGrid & grid); // Not implemented.
void operator=(const XdmfRectilinearGrid & grid); // Not implemented.
XdmfGridRectilinearImpl * mImpl;
XdmfRectilinearGridImpl * mImpl;
};
#endif /* XDMFGRIDRECTILINEAR_HPP_ */
#endif /* XDMFRECTILINEARGRID_HPP_ */
......@@ -9,14 +9,14 @@
#include "XdmfArray.hpp"
#include "XdmfGeometry.hpp"
#include "XdmfGeometryType.hpp"
#include "XdmfGridRegular.hpp"
#include "XdmfRegularGrid.hpp"
#include "XdmfTopology.hpp"
#include "XdmfTopologyType.hpp"
/**
* PIMPL
*/
class XdmfGridRegular::XdmfGridRegularImpl {
class XdmfRegularGrid::XdmfRegularGridImpl {
public:
......@@ -25,7 +25,7 @@ public:
public:
static boost::shared_ptr<XdmfGeometryRegular> New(XdmfGridRegular * const regularGrid)
static boost::shared_ptr<XdmfGeometryRegular> New(XdmfRegularGrid * const regularGrid)
{
boost::shared_ptr<XdmfGeometryRegular> p(new XdmfGeometryRegular(regularGrid));
return p;
......@@ -56,13 +56,13 @@ public:
private:
XdmfGeometryRegular(XdmfGridRegular * const regularGrid) :
XdmfGeometryRegular(XdmfRegularGrid * const regularGrid) :
mRegularGrid(regularGrid)
{
this->setType(XdmfGeometryTypeRegular::New(mRegularGrid));
}
XdmfGridRegular * const mRegularGrid;
XdmfRegularGrid * const mRegularGrid;
};
class XdmfGeometryTypeRegular : public XdmfGeometryType
......@@ -70,7 +70,7 @@ public:
public:
static boost::shared_ptr<const XdmfGeometryTypeRegular> New(const XdmfGridRegular * const regularGrid)
static boost::shared_ptr<const XdmfGeometryTypeRegular> New(const XdmfRegularGrid * const regularGrid)
{
boost::shared_ptr<const XdmfGeometryTypeRegular> p(new XdmfGeometryTypeRegular(regularGrid));
return p;
......@@ -100,13 +100,13 @@ public:
private:
XdmfGeometryTypeRegular(const XdmfGridRegular * const regularGrid) :
XdmfGeometryTypeRegular(const XdmfRegularGrid * const regularGrid) :
XdmfGeometryType("", 0),
mRegularGrid(regularGrid)
{
}
const XdmfGridRegular * const mRegularGrid;
const XdmfRegularGrid * const mRegularGrid;
};
......@@ -115,7 +115,7 @@ public:
public:
static boost::shared_ptr<XdmfTopologyRegular> New(const XdmfGridRegular * const regularGrid)
static boost::shared_ptr<XdmfTopologyRegular> New(const XdmfRegularGrid * const regularGrid)
{
boost::shared_ptr<XdmfTopologyRegular> p(new XdmfTopologyRegular(regularGrid));
return p;
......@@ -138,13 +138,13 @@ public:
private:
XdmfTopologyRegular(const XdmfGridRegular * const regularGrid) :
XdmfTopologyRegular(const XdmfRegularGrid * const regularGrid) :
mRegularGrid(regularGrid)
{
this->setType(XdmfTopologyTypeRegular::New(regularGrid));
}
const XdmfGridRegular * const mRegularGrid;
const XdmfRegularGrid * const mRegularGrid;
};
class XdmfTopologyTypeRegular : public XdmfTopologyType
......@@ -152,7 +152,7 @@ public:
public:
static boost::shared_ptr<const XdmfTopologyTypeRegular> New(const XdmfGridRegular * const regularGrid)
static boost::shared_ptr<const XdmfTopologyTypeRegular> New(const XdmfRegularGrid * const regularGrid)
{
boost::shared_ptr<const XdmfTopologyTypeRegular> p(new XdmfTopologyTypeRegular(regularGrid));
return p;
......@@ -185,17 +185,17 @@ public:
private:
XdmfTopologyTypeRegular(const XdmfGridRegular * const regularGrid) :
XdmfTopologyTypeRegular(const XdmfRegularGrid * const regularGrid) :
XdmfTopologyType(0, "foo", XdmfTopologyType::Structured, 0x1102),
mRegularGrid(regularGrid)
{
}
const XdmfGridRegular * const mRegularGrid;
const XdmfRegularGrid * const mRegularGrid;
};
XdmfGridRegularImpl(const boost::shared_ptr<XdmfArray> brickSize, const boost::shared_ptr<XdmfArray> numPoints, const boost::shared_ptr<XdmfArray> origin) :
XdmfRegularGridImpl(const boost::shared_ptr<XdmfArray> brickSize, const boost::shared_ptr<XdmfArray> numPoints, const boost::shared_ptr<XdmfArray> origin) :
mBrickSize(brickSize),
mDimensions(numPoints),
mOrigin(origin)
......@@ -208,7 +208,7 @@ public:
};
boost::shared_ptr<XdmfGridRegular> XdmfGridRegular::New(const double xBrickSize, const double yBrickSize, const unsigned int xNumPoints,
boost::shared_ptr<XdmfRegularGrid> XdmfRegularGrid::New(const double xBrickSize, const double yBrickSize, const unsigned int xNumPoints,
const unsigned int yNumPoints, const double xOrigin, const double yOrigin)
{
boost::shared_ptr<XdmfArray> brickSize = XdmfArray::New();
......@@ -223,11 +223,11 @@ boost::shared_ptr<XdmfGridRegular> XdmfGridRegular::New(const double xBrickSize,
origin->resize<double>(2);
origin->insert(0, xOrigin);
origin->insert(1, yOrigin);
boost::shared_ptr<XdmfGridRegular> p(new XdmfGridRegular(brickSize, numPoints, origin));
boost::shared_ptr<XdmfRegularGrid> p(new XdmfRegularGrid(brickSize, numPoints, origin));
return p;
}
boost::shared_ptr<XdmfGridRegular> XdmfGridRegular::New(const double xBrickSize, const double yBrickSize, const double zBrickSize,
boost::shared_ptr<XdmfRegularGrid> XdmfRegularGrid::New(const double xBrickSize, const double yBrickSize, const double zBrickSize,
const unsigned int xNumPoints, const unsigned int yNumPoints, const unsigned int zNumPoints,
const double xOrigin, const double yOrigin, const double zOrigin)
{
......@@ -246,68 +246,68 @@ boost::shared_ptr<XdmfGridRegular> XdmfGridRegular::New(const double xBrickSize,
origin->insert(0, xOrigin);
origin->insert(1, yOrigin);
origin->insert(2, zOrigin);
boost::shared_ptr<XdmfGridRegular> p(new XdmfGridRegular(brickSize, numPoints, origin));
boost::shared_ptr<XdmfRegularGrid> p(new XdmfRegularGrid(brickSize, numPoints, origin));
return p;
}
boost::shared_ptr<XdmfGridRegular> XdmfGridRegular::New(const boost::shared_ptr<XdmfArray> brickSize, const boost::shared_ptr<XdmfArray> numPoints,
boost::shared_ptr<XdmfRegularGrid> XdmfRegularGrid::New(const boost::shared_ptr<XdmfArray> brickSize, const boost::shared_ptr<XdmfArray> numPoints,
const boost::shared_ptr<XdmfArray> origin)
{
boost::shared_ptr<XdmfGridRegular> p(new XdmfGridRegular(brickSize, numPoints, origin));
boost::shared_ptr<XdmfRegularGrid> p(new XdmfRegularGrid(brickSize, numPoints, origin));
return p;
}
XdmfGridRegular::XdmfGridRegular(const boost::shared_ptr<XdmfArray> brickSize, const boost::shared_ptr<XdmfArray> numPoints,
XdmfRegularGrid::XdmfRegularGrid(const boost::shared_ptr<XdmfArray> brickSize, const boost::shared_ptr<XdmfArray> numPoints,
const boost::shared_ptr<XdmfArray> origin) :
XdmfGrid(XdmfGridRegularImpl::XdmfGeometryRegular::New(this), XdmfGridRegularImpl::XdmfTopologyRegular::New(this)),
mImpl(new XdmfGridRegularImpl(brickSize, numPoints, origin))
XdmfGrid(XdmfRegularGridImpl::XdmfGeometryRegular::New(this), XdmfRegularGridImpl::XdmfTopologyRegular::New(this)),
mImpl(new XdmfRegularGridImpl(brickSize, numPoints, origin))
{
}
XdmfGridRegular::~