Commit 81ebb9b4 authored by Chris Richardson's avatar Chris Richardson

Add 'X' geometry for 1D

parent 1819d6ae
......@@ -47,6 +47,13 @@ XdmfGeometryType::XY()
return p;
}
shared_ptr<const XdmfGeometryType>
XdmfGeometryType::X()
{
static shared_ptr<const XdmfGeometryType> p(new XdmfGeometryType("X", 1));
return p;
}
XdmfGeometryType::XdmfGeometryType(const std::string& name,
const int& dimensions) :
mDimensions(dimensions),
......@@ -67,7 +74,7 @@ XdmfGeometryType::New(const std::map<std::string, std::string> & itemProperties)
type = itemProperties.find("GeometryType");
}
if(type == itemProperties.end()) {
XdmfError::message(XdmfError::FATAL,
XdmfError::message(XdmfError::FATAL,
"Neither 'Type' nor 'GeometryType' in itemProperties "
"in XdmfGeometryType::New");
}
......@@ -82,8 +89,11 @@ XdmfGeometryType::New(const std::map<std::string, std::string> & itemProperties)
else if(typeVal.compare("XY") == 0) {
return XY();
}
else if(typeVal.compare("X") == 0) {
return X();
}
XdmfError::message(XdmfError::FATAL, "Type not 'None', 'XYZ', or 'XY' "
XdmfError::message(XdmfError::FATAL, "Type not 'None', 'XYZ', 'XY' or 'X' "
"in XdmfGeometryType::New");
return shared_ptr<const XdmfGeometryType>();
......
......@@ -57,6 +57,7 @@
* NoGeometryType
* XYZ
* XY
* X
*/
class XDMF_EXPORT XdmfGeometryType : public XdmfItemProperty {
......@@ -70,12 +71,13 @@ public:
static shared_ptr<const XdmfGeometryType> NoGeometryType();
static shared_ptr<const XdmfGeometryType> XYZ();
static shared_ptr<const XdmfGeometryType> XY();
static shared_ptr<const XdmfGeometryType> X();
/**
* Get the dimensions of this geometry type - i.e. XYZ = 3.
*
* Example of use:
*
*
* C++
*
* @dontinclude ExampleXdmfGeometryType.cpp
......
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