Commit 19d96e0c authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Modify reading of XdmfArray dimensions to correctly calculate size for...

ENH: Modify reading of XdmfArray dimensions to correctly calculate size for multidimensional arrays.
parent a34a25cb
......@@ -546,7 +546,7 @@ void XdmfArray::internalizeArrayPointer()
void XdmfArray::populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems)
{
std::string contentVal;
unsigned int sizeVal;
unsigned int sizeVal = 1;
const boost::shared_ptr<const XdmfArrayType> arrayType = XdmfArrayType::New(itemProperties);
std::map<std::string, std::string>::const_iterator content = itemProperties.find("Content");
......@@ -561,7 +561,11 @@ void XdmfArray::populateItem(const std::map<std::string, std::string> & itemProp
std::map<std::string, std::string>::const_iterator size = itemProperties.find("Dimensions");
if(size != itemProperties.end())
{
sizeVal = atoi(size->second.c_str());
boost::tokenizer<> tokens(size->second);
for(boost::tokenizer<>::const_iterator iter = tokens.begin(); iter != tokens.end(); ++iter)
{
sizeVal *= atoi((*iter).c_str());
}
}
else
{
......
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