Commit 2b38aea7 authored by Michal Habera's avatar Michal Habera

Add Center=Other definition

parent 2c8a3530
......@@ -68,6 +68,14 @@ XdmfAttributeCenter::Node()
return p;
}
shared_ptr<const XdmfAttributeCenter>
XdmfAttributeCenter::Other()
{
static shared_ptr<const XdmfAttributeCenter>
p(new XdmfAttributeCenter("Other"));
return p;
}
void
XdmfAttributeCenter::InitTypes()
{
......@@ -76,6 +84,7 @@ XdmfAttributeCenter::InitTypes()
mAttributeCenterDefinitions["FACE"] = Face;
mAttributeCenterDefinitions["EDGE"] = Edge;
mAttributeCenterDefinitions["NODE"] = Node;
mAttributeCenterDefinitions["OTHER"] = Other;
}
XdmfAttributeCenter::XdmfAttributeCenter(const std::string & name) :
......@@ -105,16 +114,16 @@ XdmfAttributeCenter::New(const std::map<std::string, std::string> & itemProperti
if (returnType == mAttributeCenterDefinitions.end()) {
XdmfError::message(XdmfError::FATAL,
"Center not of 'Grid','Cell','Face','Edge','Node' "
"in XdmfAttributeCenter::New");
"Center not of 'Grid','Cell','Face','Edge','Node',"
"'Other' in XdmfAttributeCenter::New");
}
else {
return (*(returnType->second))();
}
XdmfError::message(XdmfError::FATAL,
"Center not of 'Grid','Cell','Face','Edge','Node' "
"in XdmfAttributeCenter::New");
"Center not of 'Grid','Cell','Face','Edge','Node',"
"'Other' in XdmfAttributeCenter::New");
// unreachable
return shared_ptr<const XdmfAttributeCenter>();
......@@ -152,3 +161,8 @@ int XdmfAttributeCenterNode()
{
return XDMF_ATTRIBUTE_CENTER_NODE;
}
int XdmfAttributeCenterOther()
{
return XDMF_ATTRIBUTE_CENTER_OTHER;
}
\ No newline at end of file
......@@ -81,6 +81,7 @@ public:
static shared_ptr<const XdmfAttributeCenter> Face();
static shared_ptr<const XdmfAttributeCenter> Edge();
static shared_ptr<const XdmfAttributeCenter> Node();
static shared_ptr<const XdmfAttributeCenter> Other();
void
getProperties(std::map<std::string, std::string> & collectedProperties) const;
......@@ -127,12 +128,14 @@ extern "C" {
#define XDMF_ATTRIBUTE_CENTER_FACE 102
#define XDMF_ATTRIBUTE_CENTER_EDGE 103
#define XDMF_ATTRIBUTE_CENTER_NODE 104
#define XDMF_ATTRIBUTE_CENTER_OTHER 105
XDMF_EXPORT int XdmfAttributeCenterGrid();
XDMF_EXPORT int XdmfAttributeCenterCell();
XDMF_EXPORT int XdmfAttributeCenterFace();
XDMF_EXPORT int XdmfAttributeCenterEdge();
XDMF_EXPORT int XdmfAttributeCenterNode();
XDMF_EXPORT int XdmfAttributeCenterOther();
#ifdef __cplusplus
}
......
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