Commit d07ee80d authored by Kenneth Leiter's avatar Kenneth Leiter
Browse files

ENH: Add Hexahedron() to Hexahedron_125() Topology Conversion.

parent 4f65d6c6
...@@ -137,6 +137,12 @@ boost::shared_ptr<const XdmfTopologyType> XdmfTopologyType::Hexahedron_64() ...@@ -137,6 +137,12 @@ boost::shared_ptr<const XdmfTopologyType> XdmfTopologyType::Hexahedron_64()
return p; return p;
} }
boost::shared_ptr<const XdmfTopologyType> XdmfTopologyType::Hexahedron_125()
{
static boost::shared_ptr<const XdmfTopologyType> p(new XdmfTopologyType(125, "Hexahedron_125", Quartic));
return p;
}
boost::shared_ptr<const XdmfTopologyType> XdmfTopologyType::Mixed() boost::shared_ptr<const XdmfTopologyType> XdmfTopologyType::Mixed()
{ {
static boost::shared_ptr<const XdmfTopologyType> p(new XdmfTopologyType(0, "Mixed", Arbitrary)); static boost::shared_ptr<const XdmfTopologyType> p(new XdmfTopologyType(0, "Mixed", Arbitrary));
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
* Pyramid_13 * Pyramid_13
* Wedge_15 * Wedge_15
* Hexahedron_20 * Hexahedron_20
* Hexahedron_24
* Hexahedron_27
* Hexahedron_64
* Hexahedron_125
* Mixed * Mixed
* TwoDSMesh * TwoDSMesh
* TwoDRectMesh * TwoDRectMesh
...@@ -44,7 +48,7 @@ public: ...@@ -44,7 +48,7 @@ public:
friend class XdmfTopology; friend class XdmfTopology;
enum CellType { enum CellType {
NoCellType, Linear, Quadratic, Cubic, Arbitrary, Structured NoCellType, Linear, Quadratic, Cubic, Quartic, Arbitrary, Structured
}; };
// Supported Xdmf Topology Types // Supported Xdmf Topology Types
...@@ -68,6 +72,7 @@ public: ...@@ -68,6 +72,7 @@ public:
static boost::shared_ptr<const XdmfTopologyType> Hexahedron_24(); static boost::shared_ptr<const XdmfTopologyType> Hexahedron_24();
static boost::shared_ptr<const XdmfTopologyType> Hexahedron_27(); static boost::shared_ptr<const XdmfTopologyType> Hexahedron_27();
static boost::shared_ptr<const XdmfTopologyType> Hexahedron_64(); static boost::shared_ptr<const XdmfTopologyType> Hexahedron_64();
static boost::shared_ptr<const XdmfTopologyType> Hexahedron_125();
static boost::shared_ptr<const XdmfTopologyType> Mixed(); static boost::shared_ptr<const XdmfTopologyType> Mixed();
static boost::shared_ptr<const XdmfTopologyType> TwoDSMesh(); static boost::shared_ptr<const XdmfTopologyType> TwoDSMesh();
static boost::shared_ptr<const XdmfTopologyType> TwoDRectMesh(); static boost::shared_ptr<const XdmfTopologyType> TwoDRectMesh();
......
This diff is collapsed.
...@@ -42,15 +42,13 @@ protected: ...@@ -42,15 +42,13 @@ protected:
private: private:
/**
* PIMPL
*/
class XdmfTopologyConverterImpl;
XdmfTopologyConverter(const XdmfTopologyConverter & converter); // Not implemented. XdmfTopologyConverter(const XdmfTopologyConverter & converter); // Not implemented.
void operator=(const XdmfTopologyConverter & converter); // Not implemented. void operator=(const XdmfTopologyConverter & converter); // Not implemented.
// Specific Topology Converters
class HexahedronToHexahedron64;
class Hexahedron64ToHexahedron;
// Point comparator
class PointComparison;
}; };
#endif /* XDMFPARTITIONER_HPP_ */ #endif /* XDMFPARTITIONER_HPP_ */
...@@ -62,6 +62,20 @@ int main(int argc, char* argv[]) ...@@ -62,6 +62,20 @@ int main(int argc, char* argv[])
assert(i == hex64Grid->getTopology()->getArray()->getValueCopy<unsigned int>(i)); assert(i == hex64Grid->getTopology()->getArray()->getValueCopy<unsigned int>(i));
} }
/*
* Hexahedron to Hexahedron_125
*/
boost::shared_ptr<XdmfGrid> hex125Grid = converter->convert(hexGrid, XdmfTopologyType::Hexahedron_125());
assert(hex125Grid->getGeometry()->getType() == XdmfGeometryType::XYZ());
assert(hex125Grid->getGeometry()->getNumberPoints() == 125);
assert(hex125Grid->getTopology()->getType() == XdmfTopologyType::Hexahedron_125());
assert(hex125Grid->getTopology()->getNumberElements() == 1);
for(unsigned int i=0; i<125; ++i)
{
assert(i == hex125Grid->getTopology()->getArray()->getValueCopy<unsigned int>(i));
}
/* /*
* Hexahedron_64 to Hexahedron * Hexahedron_64 to Hexahedron
*/ */
...@@ -74,6 +88,5 @@ int main(int argc, char* argv[]) ...@@ -74,6 +88,5 @@ int main(int argc, char* argv[])
} }
assert(newHexGrid->getTopology()->getType() == XdmfTopologyType::Hexahedron()); assert(newHexGrid->getTopology()->getType() == XdmfTopologyType::Hexahedron());
assert(newHexGrid->getTopology()->getNumberElements() == 27); assert(newHexGrid->getTopology()->getNumberElements() == 27);
return 0; return 0;
} }
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