Commit cf8f263f authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Cleanup comments and inheritance syntax a bit. Remove unnecessary...

ENH: Cleanup comments and inheritance syntax a bit.  Remove unnecessary Geometry Types not needed since splitting structured and unstructured grids
into separate hierarchies.
parent d6c61374
......@@ -26,30 +26,6 @@ boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::XY()
return p;
}
boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::X_Y_Z()
{
static boost::shared_ptr<const XdmfGeometryType> p(new XdmfGeometryType("X_Y_Z", 3));
return p;
}
boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::X_Y()
{
static boost::shared_ptr<const XdmfGeometryType> p(new XdmfGeometryType("X_Y", 2));
return p;
}
boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::VXVYVZ()
{
static boost::shared_ptr<const XdmfGeometryType> p(new XdmfGeometryType("VXVYVZ", 3));
return p;
}
boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::VXVY()
{
static boost::shared_ptr<const XdmfGeometryType> p(new XdmfGeometryType("VXVY", 2));
return p;
}
XdmfGeometryType::XdmfGeometryType(const std::string& name, const int& dimensions) :
mDimensions(dimensions),
mName(name)
......@@ -83,22 +59,6 @@ boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::New(const std::map<s
{
return XY();
}
else if(typeVal.compare("X_Y_Z") == 0)
{
return X_Y_Z();
}
else if(typeVal.compare("X_Y") == 0)
{
return X_Y();
}
else if(typeVal.compare("VXVYVZ") == 0)
{
return VXVYVZ();
}
else if(typeVal.compare("VXVY") == 0)
{
return VXVY();
}
else
{
assert(false);
......
......@@ -15,12 +15,6 @@
* NoGeometryType
* XYZ
* XY
* X_Y_Z
* X_Y
* VXVYVZ
* Origin_DXDYDZ
* VXVY
* Origin_DXDY
*/
class XdmfGeometryType : public XdmfItemProperty {
......@@ -34,10 +28,6 @@ public:
static boost::shared_ptr<const XdmfGeometryType> NoGeometryType();
static boost::shared_ptr<const XdmfGeometryType> XYZ();
static boost::shared_ptr<const XdmfGeometryType> XY();
static boost::shared_ptr<const XdmfGeometryType> X_Y_Z();
static boost::shared_ptr<const XdmfGeometryType> X_Y();
static boost::shared_ptr<const XdmfGeometryType> VXVYVZ();
static boost::shared_ptr<const XdmfGeometryType> VXVY();
/**
* Get the dimensions of this geometry type - i.e. XYZ = 3.
......
......@@ -16,9 +16,9 @@
XDMF_CHILDREN_IMPLEMENTATION(XdmfGrid, XdmfAttribute, Attribute, Name)
XDMF_CHILDREN_IMPLEMENTATION(XdmfGrid, XdmfSet, Set, Name)
XdmfGrid::XdmfGrid(const std::string & name) :
mGeometry(XdmfGeometry::New()),
mTopology(XdmfTopology::New()),
XdmfGrid::XdmfGrid(const boost::shared_ptr<XdmfGeometry> geometry, const boost::shared_ptr<XdmfTopology> topology, const std::string & name) :
mGeometry(geometry),
mTopology(topology),
mMap(boost::shared_ptr<XdmfMap>()),
mName(name),
mTime(boost::shared_ptr<XdmfTime>())
......
......@@ -19,6 +19,8 @@ class XdmfTopology;
* that stores point locations and an XdmfTopology that store connectivity information. XdmfAttributes can be inserted
* into the XdmfGrid to specify fields centered on various parts of the mesh. XdmfSets can be inserted into XdmfGrids
* to specify collections of mesh elements.
*
* XdmfGrid is an abstract base class. There are several implementations for representing both structured and unstructured grids.
*/
class XdmfGrid : public virtual XdmfItem {
......@@ -111,7 +113,8 @@ public:
protected:
XdmfGrid(const std::string & name = "Grid");
XdmfGrid(const boost::shared_ptr<XdmfGeometry> geometry, const boost::shared_ptr<XdmfTopology> topology, const std::string & name = "Grid");
virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
boost::shared_ptr<XdmfGeometry> mGeometry;
......
......@@ -5,6 +5,8 @@
* Author: kleiter
*/
#include "XdmfGeometry.hpp"
#include "XdmfTopology.hpp"
#include "XdmfGridCollection.hpp"
#include "XdmfGridCollectionType.hpp"
......@@ -16,7 +18,7 @@ boost::shared_ptr<XdmfGridCollection> XdmfGridCollection::New()
XdmfGridCollection::XdmfGridCollection() :
XdmfDomain(),
XdmfGrid("Collection"),
XdmfGrid(XdmfGeometry::New(), XdmfTopology::New(), "Collection"),
mType(XdmfGridCollectionType::NoCollectionType())
{
}
......
......@@ -7,6 +7,7 @@
#include <cmath>
#include "XdmfArray.hpp"
#include "XdmfGeometry.hpp"
#include "XdmfGridCurvilinear.hpp"
#include "XdmfTopology.hpp"
#include "XdmfTopologyType.hpp"
......@@ -141,9 +142,9 @@ boost::shared_ptr<XdmfGridCurvilinear> XdmfGridCurvilinear::New(const boost::sha
}
XdmfGridCurvilinear::XdmfGridCurvilinear(const boost::shared_ptr<XdmfArray> numPoints) :
XdmfGrid(XdmfGeometry::New(), XdmfGridCurvilinearImpl::XdmfTopologyCurvilinear::New(this)),
mImpl(new XdmfGridCurvilinearImpl(numPoints))
{
mTopology = XdmfGridCurvilinearImpl::XdmfTopologyCurvilinear::New(this);
}
XdmfGridCurvilinear::~XdmfGridCurvilinear()
......
......@@ -235,10 +235,9 @@ boost::shared_ptr<XdmfGridRectilinear> XdmfGridRectilinear::New(const std::vecto
}
XdmfGridRectilinear::XdmfGridRectilinear(const std::vector<boost::shared_ptr<XdmfArray> > & axesCoordinates) :
XdmfGrid(XdmfGridRectilinearImpl::XdmfGeometryRectilinear::New(this), XdmfGridRectilinearImpl::XdmfTopologyRectilinear::New(this)),
mImpl(new XdmfGridRectilinearImpl(axesCoordinates))
{
mGeometry = XdmfGridRectilinearImpl::XdmfGeometryRectilinear::New(this);
mTopology = XdmfGridRectilinearImpl::XdmfTopologyRectilinear::New(this);
}
XdmfGridRectilinear::~XdmfGridRectilinear()
......
......@@ -259,10 +259,9 @@ boost::shared_ptr<XdmfGridRegular> XdmfGridRegular::New(const boost::shared_ptr<
XdmfGridRegular::XdmfGridRegular(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))
{
mGeometry = XdmfGridRegularImpl::XdmfGeometryRegular::New(this);
mTopology = XdmfGridRegularImpl::XdmfTopologyRegular::New(this);
}
XdmfGridRegular::~XdmfGridRegular()
......
......@@ -5,7 +5,9 @@
* Author: kleiter
*/
#include "XdmfGeometry.hpp"
#include "XdmfGridUnstructured.hpp"
#include "XdmfTopology.hpp"
boost::shared_ptr<XdmfGridUnstructured> XdmfGridUnstructured::New()
{
......@@ -14,7 +16,7 @@ boost::shared_ptr<XdmfGridUnstructured> XdmfGridUnstructured::New()
}
XdmfGridUnstructured::XdmfGridUnstructured() :
XdmfGrid()
XdmfGrid(XdmfGeometry::New(), XdmfTopology::New())
{
}
......
......@@ -5,12 +5,11 @@
#include "XdmfGrid.hpp"
/**
* @brief A mesh containing elements, points, and fields attached to the mesh.
* @brief An unstructured grid consisting of elements, points, and fields attached to the mesh.
*
* XdmfGrid represents a mesh. It is required to contain two other Xdmf data structures, an XdmfGeometry
* that stores point locations and an XdmfTopology that store connectivity information. XdmfAttributes can be inserted
* into the XdmfGrid to specify fields centered on various parts of the mesh. XdmfSets can be inserted into XdmfGrids
* to specify collections of mesh elements.
* After creating an unstructured grid, the XdmfGeometry and XdmfTopology must be set. The XdmfTopology
* describes the element types contained in the grid and their connectivity. The XdmfGeometry describes the
* location of nodes.
*/
class XdmfGridUnstructured : public XdmfGrid {
......
......@@ -36,12 +36,6 @@
* Hexahedron_125 - 125 Node Tri-Quartic Hexahedron
* Hexahedron_125_GLL - 125 Node Spectral Tri-Quartic Hexahedron with Gauss-Lobatto-Legendre points.
* Mixed - Mixture of Unstructured Topologies
* TwoDSMesh
* TwoDRectMesh
* TwoDCoRectMesh
* ThreeDSMesh
* ThreeDRectMesh
* ThreeDCoRectMesh
*/
class XdmfTopologyType : public XdmfItemProperty {
......
......@@ -15,6 +15,8 @@ class XdmfItem;
*
* Reads an Xdmf structured file stored on disk into an Xdmf structure in memory. All light data is parsed in order to create appropriate
* Xdmf objects. Heavy data controllers are created and attached to XdmfArrays but no heavy data is read into memory.
*
* XdmfCoreReader is an abstract base class.
*/
class XdmfCoreReader {
......
......@@ -146,25 +146,13 @@ void XdmfExodusWriter::write(const std::string & filePath, const boost::shared_p
double * y = new double[num_nodes];
double * z = new double[num_nodes];
// Write nodal coordinate values to exodus
if(currGrid->getGeometry()->getType() == XdmfGeometryType::XYZ() || currGrid->getGeometry()->getType() == XdmfGeometryType::XY())
currGrid->getGeometry()->getValues(0, x, num_nodes, 3);
currGrid->getGeometry()->getValues(1, y, num_nodes, 3);
if(currGrid->getGeometry()->getType() == XdmfGeometryType::XYZ())
{
currGrid->getGeometry()->getValues(0, x, num_nodes, 3);
currGrid->getGeometry()->getValues(1, y, num_nodes, 3);
if(currGrid->getGeometry()->getType() == XdmfGeometryType::XYZ())
{
currGrid->getGeometry()->getValues(2, z, num_nodes, 3);
}
ex_put_coord(exodusHandle, x ,y ,z);
}
else if(currGrid->getGeometry()->getType() == XdmfGeometryType::X_Y_Z() || currGrid->getGeometry()->getType() == XdmfGeometryType::X_Y())
{
currGrid->getGeometry()->getValues(0, x, num_nodes);
currGrid->getGeometry()->getValues(num_nodes, y, num_nodes);
if(currGrid->getGeometry()->getType() == XdmfGeometryType::X_Y_Z())
{
currGrid->getGeometry()->getValues(num_nodes * 2, z, num_nodes);
}
currGrid->getGeometry()->getValues(2, z, num_nodes, 3);
}
ex_put_coord(exodusHandle, x ,y ,z);
delete [] x;
delete [] y;
delete [] z;
......
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