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
......@@ -29,24 +29,24 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
#include <XdmfAttribute.hpp>
#include <XdmfAttributeCenter.hpp>
#include <XdmfAttributeType.hpp>
#include <XdmfCurvilinearGrid.hpp>
#include <XdmfDomain.hpp>
#include <XdmfGeometry.hpp>
#include <XdmfGeometryType.hpp>
#include <XdmfGrid.hpp>
#include <XdmfGridCollection.hpp>
#include <XdmfGridCollectionType.hpp>
#include <XdmfGridCurvilinear.hpp>
#include <XdmfGridRectilinear.hpp>
#include <XdmfGridRegular.hpp>
#include <XdmfGridUnstructured.hpp>
#include <XdmfItemFactory.hpp>
#include <XdmfMap.hpp>
#include <XdmfReader.hpp>
#include <XdmfRectilinearGrid.hpp>
#include <XdmfRegularGrid.hpp>
#include <XdmfSet.hpp>
#include <XdmfSetType.hpp>
#include <XdmfTime.hpp>
#include <XdmfTopology.hpp>
#include <XdmfTopologyType.hpp>
#include <XdmfUnstructuredGrid.hpp>
%}
%import XdmfCore.i
......@@ -60,6 +60,10 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
*(boost::shared_ptr< XdmfAttribute > **)&($result) = value ? new boost::shared_ptr< XdmfAttribute >(value) : 0;
}
else if(boost::shared_ptr<XdmfCurvilinearGrid> value = boost::shared_dynamic_cast<XdmfCurvilinearGrid>($1))
{
*(boost::shared_ptr< XdmfCurvilinearGrid > **)&($result) = value ? new boost::shared_ptr< XdmfCurvilinearGrid >(value) : 0;
}
else if(boost::shared_ptr<XdmfDomain> value = boost::shared_dynamic_cast<XdmfDomain>($1))
{
*(boost::shared_ptr< XdmfDomain > **)&($result) = value ? new boost::shared_ptr< XdmfDomain >(value) : 0;
......@@ -72,25 +76,17 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
*(boost::shared_ptr< XdmfGridCollection > **)&($result) = value ? new boost::shared_ptr< XdmfGridCollection >(value) : 0;
}
else if(boost::shared_ptr<XdmfGridCurvilinear> value = boost::shared_dynamic_cast<XdmfGridCurvilinear>($1))
{
*(boost::shared_ptr< XdmfGridCurvilinear > **)&($result) = value ? new boost::shared_ptr< XdmfGridCurvilinear >(value) : 0;
}
else if(boost::shared_ptr<XdmfGridRectilinear> value = boost::shared_dynamic_cast<XdmfGridRectilinear>($1))
{
*(boost::shared_ptr< XdmfGridRectilinear > **)&($result) = value ? new boost::shared_ptr< XdmfGridRectilinear >(value) : 0;
}
else if(boost::shared_ptr<XdmfGridRegular> value = boost::shared_dynamic_cast<XdmfGridRegular>($1))
else if(boost::shared_ptr<XdmfInformation> value = boost::shared_dynamic_cast<XdmfInformation>($1))
{
*(boost::shared_ptr< XdmfGridRegular > **)&($result) = value ? new boost::shared_ptr< XdmfGridRegular >(value) : 0;
*(boost::shared_ptr< XdmfInformation > **)&($result) = value ? new boost::shared_ptr< XdmfInformation >(value) : 0;
}
else if(boost::shared_ptr<XdmfGridUnstructured> value = boost::shared_dynamic_cast<XdmfGridUnstructured>($1))
else if(boost::shared_ptr<XdmfRectilinearGrid> value = boost::shared_dynamic_cast<XdmfRectilinearGrid>($1))
{
*(boost::shared_ptr< XdmfGridUnstructured > **)&($result) = value ? new boost::shared_ptr< XdmfGridUnstructured >(value) : 0;
*(boost::shared_ptr< XdmfRectilinearGrid > **)&($result) = value ? new boost::shared_ptr< XdmfRectilinearGrid >(value) : 0;
}
else if(boost::shared_ptr<XdmfInformation> value = boost::shared_dynamic_cast<XdmfInformation>($1))
else if(boost::shared_ptr<XdmfRegularGrid> value = boost::shared_dynamic_cast<XdmfRegularGrid>($1))
{
*(boost::shared_ptr< XdmfInformation > **)&($result) = value ? new boost::shared_ptr< XdmfInformation >(value) : 0;
*(boost::shared_ptr< XdmfRegularGrid > **)&($result) = value ? new boost::shared_ptr< XdmfRegularGrid >(value) : 0;
}
else if(boost::shared_ptr<XdmfSet> value = boost::shared_dynamic_cast<XdmfSet>($1))
{
......@@ -104,6 +100,10 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
*(boost::shared_ptr< XdmfTopology > **)&($result) = value ? new boost::shared_ptr< XdmfTopology >(value) : 0;
}
else if(boost::shared_ptr<XdmfUnstructuredGrid> value = boost::shared_dynamic_cast<XdmfUnstructuredGrid>($1))
{
*(boost::shared_ptr< XdmfUnstructuredGrid > **)&($result) = value ? new boost::shared_ptr< XdmfUnstructuredGrid >(value) : 0;
}
else
{
*(boost::shared_ptr< XdmfItem > **)&($result) = &($1);
......@@ -111,45 +111,46 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
}
// Ignore const overloaded methods
%ignore XdmfCurvilinearGrid::getDimensions() const;
%ignore XdmfDomain::getCurvilinearGrid(const unsigned int) const;
%ignore XdmfDomain::getCurvilinearGrid(const std::string &) const;
%ignore XdmfDomain::getGridCollection(const unsigned int) const;
%ignore XdmfDomain::getGridCollection(const std::string &) const;
%ignore XdmfDomain::getGridCurvilinear(const unsigned int) const;
%ignore XdmfDomain::getGridCurvilinear(const std::string &) const;
%ignore XdmfDomain::getGridRectilinear(const unsigned int) const;
%ignore XdmfDomain::getGridRectilinear(const std::string &) const;
%ignore XdmfDomain::getGridRegular(const unsigned int) const;
%ignore XdmfDomain::getGridRegular(const std::string &) const;
%ignore XdmfDomain::getGridUnstructured(const unsigned int) const;
%ignore XdmfDomain::getGridUnstructured(const std::string &) const;
%ignore XdmfDomain::getRectilinearGrid(const unsigned int) const;
%ignore XdmfDomain::getRectilinearGrid(const std::string &) const;
%ignore XdmfDomain::getRegularGrid(const unsigned int) const;
%ignore XdmfDomain::getRegularGrid(const std::string &) const;
%ignore XdmfDomain::getUnstructuredGrid(const unsigned int) const;
%ignore XdmfDomain::getUnstructuredGrid(const std::string &) const;
%ignore XdmfGrid::getAttribute(const unsigned int) const;
%ignore XdmfGrid::getAttribute(const std::string &) const;
%ignore XdmfGrid::getMap() const;
%ignore XdmfGrid::getSet(const unsigned int) const;
%ignore XdmfGrid::getSet(const std::string &) const;
%ignore XdmfGrid::getTime() const;
%ignore XdmfGridCurvilinear::getDimensions() const;
%ignore XdmfGridRectilinear::getCoordinates(const unsigned int) const;
%ignore XdmfGridRectilinear::getCoordinates() const;
%ignore XdmfGridRectilinear::getDimensions() const;
%ignore XdmfGridRegular::getBrickSize() const;
%ignore XdmfGridRegular::getDimensions() const;
%ignore XdmfGridRegular::getOrigin() const;
%ignore XdmfRectilinearGrid::getCoordinates(const unsigned int) const;
%ignore XdmfRectilinearGrid::getCoordinates() const;
%ignore XdmfRectilinearGrid::getDimensions() const;
%ignore XdmfRegularGrid::getBrickSize() const;
%ignore XdmfRegularGrid::getDimensions() const;
%ignore XdmfRegularGrid::getOrigin() const;
%ignore XdmfSet::getAttribute(const unsigned int) const;
%ignore XdmfSet::getAttribute(const std::string &) const;
// Ignore ItemTags
%ignore XdmfAttribute::ItemTag;
%ignore XdmfCurvilinearGrid::ItemTag;
%ignore XdmfDomain::ItemTag;
%ignore XdmfGeometry::ItemTag;
%ignore XdmfGrid::ItemTag;
%ignore XdmfGridCollection::ItemTag;
%ignore XdmfGridCurvilinear::ItemTag;
%ignore XdmfGridRegular::ItemTag;
%ignore XdmfGridRectilinear::ItemTag;
%ignore XdmfMap::ItemTag;
%ignore XdmfRectilinearGrid::ItemTag;
%ignore XdmfRegularGrid::ItemTag;
%ignore XdmfSet::ItemTag;
%ignore XdmfTime::ItemTag;
%ignore XdmfTopology::ItemTag;
%ignore XdmfUnstructuredGrid::ItemTag;
%pragma(java) jniclasscode=%{
static
......@@ -188,6 +189,10 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfAttribute>(attribute)), SWIGTYPE_p_boost__shared_ptrT_XdmfAttribute_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfCurvilinearGrid> gridCurvilinear = boost::shared_dynamic_cast<XdmfCurvilinearGrid>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfCurvilinearGrid>(gridCurvilinear)), SWIGTYPE_p_boost__shared_ptrT_XdmfCurvilinearGrid_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfDomain> domain = boost::shared_dynamic_cast<XdmfDomain>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfDomain>(domain)), SWIGTYPE_p_boost__shared_ptrT_XdmfDomain_t, SWIG_POINTER_OWN);
......@@ -200,22 +205,6 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridCollection>(gridCollection)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridCollection_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridCurvilinear> gridCurvilinear = boost::shared_dynamic_cast<XdmfGridCurvilinear>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridCurvilinear>(gridCurvilinear)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridCurvilinear_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridRectilinear> gridRectilinear = boost::shared_dynamic_cast<XdmfGridRectilinear>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridRectilinear>(gridRectilinear)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridRectilinear_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridRegular> gridRegular = boost::shared_dynamic_cast<XdmfGridRegular>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridRegular>(gridRegular)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridRegular_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridUnstructured> gridUnstructured = boost::shared_dynamic_cast<XdmfGridUnstructured>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridUnstructured>(gridUnstructured)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridUnstructured_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfInformation> information = boost::shared_dynamic_cast<XdmfInformation>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfInformation>(information)), SWIGTYPE_p_boost__shared_ptrT_XdmfInformation_t, SWIG_POINTER_OWN);
......@@ -224,6 +213,14 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfMap>(map)), SWIGTYPE_p_boost__shared_ptrT_XdmfMap_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfRectilinearGrid> gridRectilinear = boost::shared_dynamic_cast<XdmfRectilinearGrid>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfRectilinearGrid>(gridRectilinear)), SWIGTYPE_p_boost__shared_ptrT_XdmfRectilinearGrid_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfRegularGrid> gridRegular = boost::shared_dynamic_cast<XdmfRegularGrid>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfRegularGrid>(gridRegular)), SWIGTYPE_p_boost__shared_ptrT_XdmfRegularGrid_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfSet> set = boost::shared_dynamic_cast<XdmfSet>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfSet>(set)), SWIGTYPE_p_boost__shared_ptrT_XdmfSet_t, SWIG_POINTER_OWN);
......@@ -236,6 +233,10 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfTopology>(topology)), SWIGTYPE_p_boost__shared_ptrT_XdmfTopology_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfUnstructuredGrid> gridUnstructured = boost::shared_dynamic_cast<XdmfUnstructuredGrid>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfUnstructuredGrid>(gridUnstructured)), SWIGTYPE_p_boost__shared_ptrT_XdmfUnstructuredGrid_t, SWIG_POINTER_OWN);
}
else
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfItem>($1)), SWIGTYPE_p_boost__shared_ptrT_XdmfItem_t, SWIG_POINTER_OWN);
......@@ -248,43 +249,44 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%shared_ptr(XdmfAttribute)
%shared_ptr(XdmfAttributeCenter)
%shared_ptr(XdmfAttributeType)
%shared_ptr(XdmfCurvilinearGrid)
%shared_ptr(XdmfDomain)
%shared_ptr(XdmfGeometry)
%shared_ptr(XdmfGeometryType)
%shared_ptr(XdmfGrid)
%shared_ptr(XdmfGridCollection)
%shared_ptr(XdmfGridCollectionType)
%shared_ptr(XdmfGridCurvilinear)
%shared_ptr(XdmfGridRectilinear)
%shared_ptr(XdmfGridRegular)
%shared_ptr(XdmfGridUnstructured)
%shared_ptr(XdmfItemFactory)
%shared_ptr(XdmfMap)
%shared_ptr(XdmfReader)
%shared_ptr(XdmfRectilinearGrid)
%shared_ptr(XdmfRegularGrid)
%shared_ptr(XdmfSet)
%shared_ptr(XdmfSetType)
%shared_ptr(XdmfTime)
%shared_ptr(XdmfTopology)
%shared_ptr(XdmfTopologyType)
%shared_ptr(XdmfUnstructuredGrid)
%include XdmfGrid.hpp
%include XdmfAttribute.hpp
%include XdmfAttributeCenter.hpp
%include XdmfAttributeType.hpp
%include XdmfCurvilinearGrid.hpp
%include XdmfDomain.hpp
%include XdmfGeometry.hpp
%include XdmfGeometryType.hpp
%include XdmfGrid.hpp
%include XdmfGridCollection.hpp
%include XdmfGridCollectionType.hpp
%include XdmfGridCurvilinear.hpp
%include XdmfGridRectilinear.hpp
%include XdmfGridRegular.hpp
%include XdmfGridUnstructured.hpp
%include XdmfItemFactory.hpp
%include XdmfMap.hpp
%include XdmfReader.hpp
%include XdmfRectilinearGrid.hpp
%include XdmfRegularGrid.hpp
%include XdmfSet.hpp
%include XdmfSetType.hpp
%include XdmfTime.hpp
%include XdmfTopology.hpp
%include XdmfTopologyType.hpp
%include XdmfUnstructuredGrid.hpp
......@@ -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_