Commit 3e4a11fe authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Support default attribute values for ArrayType (Float32) and

AttributeType (Scalar). Also enable parsing of deprecated DataStructure
tag, synonym of DataItem.
parent 39a4f8ee
......@@ -100,14 +100,8 @@ XdmfAttributeType::New(const std::map<std::string, std::string> & itemProperties
type = itemProperties.find("AttributeType");
}
if(type == itemProperties.end()) {
try {
XdmfError::message(XdmfError::FATAL,
"Neither 'Type' nor 'AttributeType' found in "
"itemProperties in XdmfAttributeType::New");
}
catch (XdmfError e) {
throw e;
}
// to support old xdmf defaults, return Scalar()
return Scalar();
}
const std::string & typeVal = type->second;
......
......@@ -127,15 +127,8 @@ XdmfArrayType::New(const std::map<std::string, std::string> & itemProperties)
type = itemProperties.find("NumberType");
}
if(type == itemProperties.end()) {
try {
XdmfError::message(XdmfError::FATAL,
"Type unset because neither 'DataType' nor "
"'NumberType' found in itemProperties in "
"XdmfArrayType::New");
}
catch (XdmfError e) {
throw e;
}
// to support old xdmf defaults, return Float32()
return Float32();
}
const std::string & typeVal = type->second;
......
......@@ -44,6 +44,10 @@ XdmfCoreItemFactory::createItem(const std::string & itemTag,
if(itemTag.compare(XdmfArray::ItemTag) == 0) {
return XdmfArray::New();
}
else if(itemTag.compare("DataStructure") == 0) {
// to support old xdmf DataStructure tag
return XdmfArray::New();
}
else if (itemTag.compare(XdmfFunction::ItemTag) == 0) {
std::map<std::string, std::string>::const_iterator type =
itemProperties.find("ConstructedType");
......
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