Commit b71d08cb authored by Kenneth Leiter's avatar Kenneth Leiter

Remove boost::tokenizer

Replace with std::stringstream implementation put for convenience
in XdmfStringUtils.hpp. Added a test as well.
parent 75b8639b
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <numeric> #include <numeric>
#include <functional> #include <functional>
#include <boost/tokenizer.hpp>
#include "XdmfArray.hpp" #include "XdmfArray.hpp"
#include "XdmfError.hpp" #include "XdmfError.hpp"
#include "XdmfAggregate.hpp" #include "XdmfAggregate.hpp"
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
/* */ /* */
/*****************************************************************************/ /*****************************************************************************/
#include "XdmfGeometry.hpp"
#include "XdmfGeometryType.hpp"
#include "XdmfError.hpp" #include "XdmfError.hpp"
#include "XdmfFunction.hpp" #include "XdmfFunction.hpp"
#include <boost/tokenizer.hpp> #include "XdmfGeometry.hpp"
#include "XdmfGeometryType.hpp"
#include "XdmfStringUtils.hpp"
shared_ptr<XdmfGeometry> XdmfGeometry::New() shared_ptr<XdmfGeometry> XdmfGeometry::New()
{ {
...@@ -188,12 +188,7 @@ XdmfGeometry::populateItem(const std::map<std::string, std::string> & itemProper ...@@ -188,12 +188,7 @@ XdmfGeometry::populateItem(const std::map<std::string, std::string> & itemProper
std::map<std::string, std::string>::const_iterator origin = std::map<std::string, std::string>::const_iterator origin =
itemProperties.find("Origin"); itemProperties.find("Origin");
if (origin != itemProperties.end()) { if (origin != itemProperties.end()) {
boost::tokenizer<> tokens(origin->second); XdmfStringUtils::split(origin->second, mOrigin);
for(boost::tokenizer<>::const_iterator iter = tokens.begin();
iter != tokens.end();
++iter) {
mOrigin.push_back(atof((*iter).c_str()));
}
} }
} }
......
...@@ -42,8 +42,6 @@ ...@@ -42,8 +42,6 @@
#include "XdmfSystemUtils.hpp" #include "XdmfSystemUtils.hpp"
#include <boost/tokenizer.hpp>
#include <stdio.h> #include <stdio.h>
shared_ptr<XdmfGridTemplate> shared_ptr<XdmfGridTemplate>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
/*****************************************************************************/ /*****************************************************************************/
#include <cctype> #include <cctype>
#include <boost/tokenizer.hpp>
#include "XdmfAttribute.hpp" #include "XdmfAttribute.hpp"
#include "XdmfCurvilinearGrid.hpp" #include "XdmfCurvilinearGrid.hpp"
#include "XdmfDomain.hpp" #include "XdmfDomain.hpp"
...@@ -41,6 +40,7 @@ ...@@ -41,6 +40,7 @@
#include "XdmfRegularGrid.hpp" #include "XdmfRegularGrid.hpp"
#include "XdmfSet.hpp" #include "XdmfSet.hpp"
#include "XdmfSparseMatrix.hpp" #include "XdmfSparseMatrix.hpp"
#include "XdmfStringUtils.hpp"
#include "XdmfTemplate.hpp" #include "XdmfTemplate.hpp"
#include "XdmfTime.hpp" #include "XdmfTime.hpp"
#include "XdmfTopology.hpp" #include "XdmfTopology.hpp"
...@@ -277,12 +277,11 @@ XdmfItemFactory::createItem(const std::string & itemTag, ...@@ -277,12 +277,11 @@ XdmfItemFactory::createItem(const std::string & itemTag,
if(dimensions != itemProperties.end()) { if(dimensions != itemProperties.end()) {
dimensionsString = dimensions->second; dimensionsString = dimensions->second;
} }
boost::tokenizer<> tokens(dimensionsString); std::vector<unsigned int> dimensionsVector;
for(boost::tokenizer<>::const_iterator iter = tokens.begin(); XdmfStringUtils::split(dimensionsString, dimensionsVector);
iter != tokens.end(); dimensionsArray->insert(0,
++iter) { &(dimensionsVector[0]),
dimensionsArray->pushBack<unsigned int>(atoi((*iter).c_str())); dimensionsVector.size());
}
if(typeVal.compare("2DCORECTMESH") == 0 || if(typeVal.compare("2DCORECTMESH") == 0 ||
typeVal.compare("3DCORECTMESH") == 0 || typeVal.compare("3DCORECTMESH") == 0 ||
typeVal.compare("CORECTMESH") == 0) { typeVal.compare("CORECTMESH") == 0) {
......
...@@ -26,20 +26,18 @@ ...@@ -26,20 +26,18 @@
#include <climits> #include <climits>
#include <set> #include <set>
#include "XdmfArray.hpp" #include "XdmfArray.hpp"
#include "XdmfHDF5Controller.hpp"
#include "XdmfBinaryController.hpp" #include "XdmfBinaryController.hpp"
#include "XdmfError.hpp"
#include "XdmfHDF5Controller.hpp"
#include "XdmfItem.hpp" #include "XdmfItem.hpp"
#include "XdmfItemFactory.hpp" #include "XdmfItemFactory.hpp"
#include "XdmfReader.hpp" #include "XdmfReader.hpp"
#include "XdmfTemplate.hpp" #include "XdmfTemplate.hpp"
#include "XdmfError.hpp" #include "XdmfStringUtils.hpp"
#include "XdmfSystemUtils.hpp"
#include "XdmfVisitor.hpp" #include "XdmfVisitor.hpp"
#include "XdmfWriter.hpp" #include "XdmfWriter.hpp"
#include "XdmfSystemUtils.hpp"
#include <boost/tokenizer.hpp>
#include <stdio.h> #include <stdio.h>
std::vector<shared_ptr<XdmfHeavyDataController> > std::vector<shared_ptr<XdmfHeavyDataController> >
...@@ -1102,33 +1100,26 @@ XdmfTemplate::setStep(unsigned int stepId) ...@@ -1102,33 +1100,26 @@ XdmfTemplate::setStep(unsigned int stepId)
// Data is contained in the content // Data is contained in the content
std::string content = mDataDescriptions[i+(stepId*mTrackedArrays.size())]; std::string content = mDataDescriptions[i+(stepId*mTrackedArrays.size())];
mTrackedArrays[i]->initialize(mTrackedArrayTypes[i], mTrackedArrayDims[i]); mTrackedArrays[i]->initialize(mTrackedArrayTypes[i],
mTrackedArrayDims[i]);
unsigned int index = 0;
boost::char_separator<char> sep(" \t\n");
boost::tokenizer<boost::char_separator<char> > valtokens(content, sep);
if(mTrackedArrayTypes[i] == XdmfArrayType::String()) { if(mTrackedArrayTypes[i] == XdmfArrayType::String()) {
for(boost::tokenizer<boost::char_separator<char> >::const_iterator std::vector<std::string> tokens;
iter = valtokens.begin(); XdmfStringUtils::split(content, tokens);
iter != valtokens.end(); mTrackedArrays[i]->insert(0, &(tokens[0]), tokens.size());
++iter, ++index) { }
mTrackedArrays[i]->insert(index, *iter);
}
}
else { else {
for(boost::tokenizer<boost::char_separator<char> >::const_iterator std::vector<double> tokens;
iter = valtokens.begin(); XdmfStringUtils::split(content, tokens);
iter != valtokens.end(); mTrackedArrays[i]->insert(0, &(tokens[0]), tokens.size());
++iter, ++index) {
mTrackedArrays[i]->insert(index, atof((*iter).c_str()));
}
} }
} }
} }
} }
} }
else { else {
XdmfError::message(XdmfError::FATAL, "Error: Template attempting to load invalid step"); XdmfError::message(XdmfError::FATAL,
"Error: Template attempting to load invalid step");
} }
mCurrentStep = stepId; mCurrentStep = stepId;
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
/* */ /* */
/*****************************************************************************/ /*****************************************************************************/
#include <boost/tokenizer.hpp>
#include <limits> #include <limits>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
...@@ -33,11 +32,12 @@ ...@@ -33,11 +32,12 @@
#include "XdmfArrayReference.hpp" #include "XdmfArrayReference.hpp"
#include "XdmfBinaryController.hpp" #include "XdmfBinaryController.hpp"
#include "XdmfCoreReader.hpp" #include "XdmfCoreReader.hpp"
#include "XdmfError.hpp"
#include "XdmfFunction.hpp" #include "XdmfFunction.hpp"
#include "XdmfSubset.hpp"
#include "XdmfHeavyDataController.hpp" #include "XdmfHeavyDataController.hpp"
#include "XdmfSubset.hpp"
#include "XdmfStringUtils.hpp"
#include "XdmfVisitor.hpp" #include "XdmfVisitor.hpp"
#include "XdmfError.hpp"
XDMF_CHILDREN_IMPLEMENTATION(XdmfArray, XDMF_CHILDREN_IMPLEMENTATION(XdmfArray,
XdmfHeavyDataController, XdmfHeavyDataController,
...@@ -1092,20 +1092,17 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie ...@@ -1092,20 +1092,17 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie
unsigned int i = 0; unsigned int i = 0;
while (i < dimArray->getSize() / 3) while (i < dimArray->getSize() / 3) {
{
start.push_back(dimArray->getValue<unsigned int>(i)); start.push_back(dimArray->getValue<unsigned int>(i));
++i; ++i;
} }
while (i < 2 * (dimArray->getSize() / 3)) while (i < 2 * (dimArray->getSize() / 3)) {
{
stride.push_back(dimArray->getValue<unsigned int>(i)); stride.push_back(dimArray->getValue<unsigned int>(i));
++i; ++i;
} }
while (i < dimArray->getSize()) while (i < dimArray->getSize()) {
{
dimensions.push_back(dimArray->getValue<unsigned int>(i)); dimensions.push_back(dimArray->getValue<unsigned int>(i));
++i; ++i;
} }
...@@ -1173,12 +1170,7 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie ...@@ -1173,12 +1170,7 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie
"XdmfArray::populateItem"); "XdmfArray::populateItem");
} }
boost::tokenizer<> tokens(dimensions->second); XdmfStringUtils::split(dimensions->second, mDimensions);
for(boost::tokenizer<>::const_iterator iter = tokens.begin();
iter != tokens.end();
++iter) {
mDimensions.push_back(atoi((*iter).c_str()));
}
std::map<std::string, std::string>::const_iterator format = std::map<std::string, std::string>::const_iterator format =
itemProperties.find("Format"); itemProperties.find("Format");
...@@ -1193,26 +1185,17 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie ...@@ -1193,26 +1185,17 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie
if(formatVal.compare("XML") == 0) { if(formatVal.compare("XML") == 0) {
this->initialize(arrayType, this->initialize(arrayType,
mDimensions); mDimensions);
unsigned int index = 0; for (contentIndex = 0; contentIndex < contentVals.size();
boost::char_separator<char> sep(" \t\n"); ++contentIndex) {
for (contentIndex = 0; contentIndex < contentVals.size(); ++contentIndex)
{
boost::tokenizer<boost::char_separator<char> > tokens(contentVals[contentIndex], sep);
if(arrayType == XdmfArrayType::String()) { if(arrayType == XdmfArrayType::String()) {
for(boost::tokenizer<boost::char_separator<char> >::const_iterator std::vector<std::string> tokens;
iter = tokens.begin(); XdmfStringUtils::split(contentVals[contentIndex], tokens);
iter != tokens.end(); this->insert(0, &(tokens[0]), tokens.size());
++iter, ++index) {
this->insert(index, *iter);
}
} }
else { else {
for(boost::tokenizer<boost::char_separator<char> >::const_iterator std::vector<double> tokens;
iter = tokens.begin(); XdmfStringUtils::split(contentVals[contentIndex], tokens);
iter != tokens.end(); this->insert(0, &(tokens[0]), tokens.size());
++iter, ++index) {
this->insert(index, atof((*iter).c_str()));
}
} }
} }
} }
......
This diff is collapsed.
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include "XdmfCoreItemFactory.hpp" #include "XdmfCoreItemFactory.hpp"
#include "XdmfCoreReader.hpp" #include "XdmfCoreReader.hpp"
#include "XdmfError.hpp" #include "XdmfError.hpp"
#include "XdmfFunction.hpp"
#include "XdmfSubset.hpp"
#include "XdmfItem.hpp" #include "XdmfItem.hpp"
#include "XdmfSystemUtils.hpp" #include "XdmfSystemUtils.hpp"
......
/*****************************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : XdmfStringUtils.hpp */
/* */
/* Author: */
/* Kenneth Leiter */
/* kenneth.leiter@arl.army.mil */
/* US Army Research Laboratory */
/* Aberdeen Proving Ground, MD */
/* */
/* Copyright @ 2011 US Army Research Laboratory */
/* All Rights Reserved */
/* See Copyright.txt for details */
/* */
/* This software is distributed WITHOUT ANY WARRANTY; without */
/* even the implied warranty of MERCHANTABILITY or FITNESS */
/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
/* for more information. */
/* */
/*****************************************************************************/
#ifndef XDMFSTRINGUTILS_HPP_
#define XDMFSTRINGUTILS_HPP_
#include "XdmfCore.hpp"
#ifdef __cplusplus
#include <algorithm>
#include <iterator>
#include <sstream>
#include <vector>
/**
* @brief String parsing utilities
*
* Collects all string parsing utilities used by Xdmf
*/
class XDMFCORE_EXPORT XdmfStringUtils {
public:
/**
* Split a string by whitespace and insert into container
*
* @param stringToSplit a string to split by spaces.
* @param containerToInsert a container to insert the split string into.
*/
template <typename T>
static void split(const std::string & stringToSplit,
std::vector<T> & containerToInsert);
protected:
XdmfStringUtils();
~XdmfStringUtils();
private:
XdmfStringUtils(const XdmfStringUtils &); // Not implemented.
void operator=(const XdmfStringUtils &); // Not implemented.
};
template <typename T>
void
XdmfStringUtils::split(const std::string & stringToSplit,
std::vector<T> & containerToInsert)
{
std::istringstream stream(stringToSplit);
std::copy(std::istream_iterator<T>(stream),
std::istream_iterator<T>(),
std::back_inserter(containerToInsert));
}
#endif
#endif /* XDMFSTRINGUTILS_HPP_ */
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <numeric> #include <numeric>
#include <functional> #include <functional>
#include <boost/tokenizer.hpp>
#include "string.h" #include "string.h"
#include "XdmfArray.hpp" #include "XdmfArray.hpp"
#include "XdmfError.hpp" #include "XdmfError.hpp"
...@@ -31,9 +30,9 @@ ...@@ -31,9 +30,9 @@
#include "XdmfWriter.hpp" #include "XdmfWriter.hpp"
XdmfSubset::XdmfSubset(shared_ptr<XdmfArray> referenceArray, XdmfSubset::XdmfSubset(shared_ptr<XdmfArray> referenceArray,
std::vector<unsigned int> & start, const std::vector<unsigned int> & start,
std::vector<unsigned int> & stride, const std::vector<unsigned int> & stride,
std::vector<unsigned int> & dimensions) : const std::vector<unsigned int> & dimensions) :
mParent(referenceArray), mParent(referenceArray),
mDimensions(dimensions), mDimensions(dimensions),
mStart(start), mStart(start),
...@@ -55,11 +54,14 @@ const std::string XdmfSubset::ItemTag = "Subset"; ...@@ -55,11 +54,14 @@ const std::string XdmfSubset::ItemTag = "Subset";
shared_ptr<XdmfSubset> shared_ptr<XdmfSubset>
XdmfSubset::New(shared_ptr<XdmfArray> referenceArray, XdmfSubset::New(shared_ptr<XdmfArray> referenceArray,
std::vector<unsigned int> & start, const std::vector<unsigned int> & start,
std::vector<unsigned int> & stride, const std::vector<unsigned int> & stride,
std::vector<unsigned int> & dimensions) const std::vector<unsigned int> & dimensions)
{ {
shared_ptr<XdmfSubset> p(new XdmfSubset(referenceArray, start, stride, dimensions)); shared_ptr<XdmfSubset> p(new XdmfSubset(referenceArray,
start,
stride,
dimensions));
return p; return p;
} }
...@@ -88,36 +90,28 @@ XdmfSubset::getItemProperties() const ...@@ -88,36 +90,28 @@ XdmfSubset::getItemProperties() const
"one value contained within"); "one value contained within");
} }
std::map<std::string, std::string> subsetMap = XdmfArrayReference::getItemProperties(); std::map<std::string, std::string> subsetMap =
XdmfArrayReference::getItemProperties();
std::stringstream vectorStream; std::stringstream vectorStream;
vectorStream << mStart[0]; vectorStream << mStart[0];
for (unsigned int i = 1; i < mStart.size(); ++i) { for (unsigned int i = 1; i < mStart.size(); ++i) {
vectorStream << " " << mStart[i]; vectorStream << " " << mStart[i];
} }
subsetMap["SubsetStarts"] = vectorStream.str(); subsetMap["SubsetStarts"] = vectorStream.str();
vectorStream.str(std::string()); vectorStream.str(std::string());
vectorStream << mStride[0]; vectorStream << mStride[0];
for (unsigned int i = 1; i < mStride.size(); ++i) { for (unsigned int i = 1; i < mStride.size(); ++i) {
vectorStream << " " << mStride[i]; vectorStream << " " << mStride[i];
} }
subsetMap["SubsetStrides"] = vectorStream.str(); subsetMap["SubsetStrides"] = vectorStream.str();
vectorStream.str(std::string()); vectorStream.str(std::string());
vectorStream << mDimensions[0]; vectorStream << mDimensions[0];
for (unsigned int i = 1; i < mDimensions.size(); ++i) { for (unsigned int i = 1; i < mDimensions.size(); ++i) {
vectorStream << " " << mDimensions[i]; vectorStream << " " << mDimensions[i];
} }
subsetMap["SubsetDimensions"] = vectorStream.str(); subsetMap["SubsetDimensions"] = vectorStream.str();
return subsetMap; return subsetMap;
...@@ -161,44 +155,6 @@ XdmfSubset::getStride() const ...@@ -161,44 +155,6 @@ XdmfSubset::getStride() const
return mStride; return mStride;
} }
void
XdmfSubset::populateItem(const std::map<std::string, std::string> & itemProperties,
const std::vector<shared_ptr<XdmfItem> > & childItems,
const XdmfCoreReader * const reader)
{
std::map<std::string, std::string>::const_iterator starts =
itemProperties.find("SubsetStarts");
boost::tokenizer<> tokens(starts->second);
for(boost::tokenizer<>::const_iterator iter = tokens.begin();
iter != tokens.end();
++iter) {
mStart.push_back(atoi((*iter).c_str()));
}
std::map<std::string, std::string>::const_iterator strides =
itemProperties.find("SubsetStrides");
boost::tokenizer<> stridetokens(strides->second);
for(boost::tokenizer<>::const_iterator iter = stridetokens.begin();
iter != stridetokens.end();
++iter) {
mStride.push_back(atoi((*iter).c_str()));
}
std::map<std::string, std::string>::const_iterator dimensions =
itemProperties.find("SubsetDimensions");
boost::tokenizer<> dimtokens(dimensions->second);
for(boost::tokenizer<>::const_iterator iter = dimtokens.begin();
iter != dimtokens.end();
++iter) {
mDimensions.push_back(atoi((*iter).c_str()));
}
mParent = shared_dynamic_cast<XdmfArray>(childItems[0]);
}
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfSubset::read() const XdmfSubset::read() const
{ {
......
...@@ -75,9 +75,9 @@ public: ...@@ -75,9 +75,9 @@ public:
*/ */
static shared_ptr<XdmfSubset> static shared_ptr<XdmfSubset>
New(shared_ptr<XdmfArray> referenceArray, New(shared_ptr<XdmfArray> referenceArray,
std::vector<unsigned int> & start, const std::vector<unsigned int> & start,
std::vector<unsigned int> & stride, const std::vector<unsigned int> & stride,
std::vector<unsigned int> & dimensions); const std::vector<unsigned int> & dimensions);
virtual ~XdmfSubset(); virtual ~XdmfSubset();
...@@ -369,14 +369,9 @@ public: ...@@ -369,14 +369,9 @@ public:
protected: protected:
XdmfSubset(shared_ptr<XdmfArray> referenceArray, XdmfSubset(shared_ptr<XdmfArray> referenceArray,
std::vector<unsigned int> & start, const std::vector<unsigned int> & start,
std::vector<unsigned int> & stride, const std::vector<unsigned int> & stride,
std::vector<unsigned int> & dimensions); const std::vector<unsigned int> & dimensions);
void
populateItem(const std::map<std::string, std::string> & itemProperties,
const std::vector<shared_ptr<XdmfItem> > & childItems,
const XdmfCoreReader * const reader);
shared_ptr<XdmfArray> mParent; shared_ptr<XdmfArray> mParent;
std::vector<unsigned int> mDimensions; std::vector<unsigned int> mDimensions;
......
...@@ -30,6 +30,7 @@ ADD_TEST_CXX(TestXdmfHDF5Writer) ...@@ -30,6 +30,7 @@ ADD_TEST_CXX(TestXdmfHDF5Writer)
ADD_TEST_CXX(TestXdmfHDF5WriterTree) ADD_TEST_CXX(TestXdmfHDF5WriterTree)
ADD_TEST_CXX(TestXdmfInformation) ADD_TEST_CXX(TestXdmfInformation)
ADD_TEST_CXX(TestXdmfSparseMatrix) ADD_TEST_CXX(TestXdmfSparseMatrix)
ADD_TEST_CXX(TestXdmfStringUtils)
ADD_TEST_CXX(TestXdmfVersion) ADD_TEST_CXX(TestXdmfVersion)
# Add any cxx cleanup here: # Add any cxx cleanup here:
...@@ -56,4 +57,5 @@ CLEAN_TEST_CXX(TestXdmfHDF5WriterTree ...@@ -56,4 +57,5 @@ CLEAN_TEST_CXX(TestXdmfHDF5WriterTree
CLEAN_TEST_CXX(TestXdmfInformation) CLEAN_TEST_CXX(TestXdmfInformation)
CLEAN_TEST_CXX(TestXdmfSparseMatrix CLEAN_TEST_CXX(TestXdmfSparseMatrix
TestXdmfSparseMatrix.xmf) TestXdmfSparseMatrix.xmf)
CLEAN_TEST_CXX(TestXdmfStringUtils)
CLEAN_TEST_CXX(TestXdmfVersion) CLEAN_TEST_CXX(TestXdmfVersion)
#include "XdmfStringUtils.hpp"
#include <cassert>
#include <vector>
int main() {
std::vector<int> split;
XdmfStringUtils::split("1 2 3", split);
assert(split.size() == 3);
assert(split[0] == 1);
assert(split[1] == 2);
assert(split[2] == 3);
split.clear();
XdmfStringUtils::split(" 1 2 3 ", split);
assert(split.size() == 3);
assert(split[0] == 1);
assert(split[1] == 2);
assert(split[2] == 3);
split.clear();
XdmfStringUtils::split("1\t2\t3", split);
assert(split.size() == 3);
assert(split[0] == 1);
assert(split[1] == 2);
assert(split[2] == 3);
split.clear();
XdmfStringUtils::split("1\n2\n3", split);
assert(split.size() == 3);
assert(split[0] == 1);
assert(split[1] == 2);
assert(split[2] == 3);
split.clear();
XdmfStringUtils::split("1\n\t 2\n\t 3", split);
assert(split.size() == 3);
assert(split[0] == 1);
assert(split[1] == 2);
assert(split[2] == 3);
return 0;
}
...@@ -9,123 +9,105 @@ ...@@ -9,123 +9,105 @@
int main(int, char **) int main(int, char **)
{ {
shared_ptr<XdmfArray> referenceArray = XdmfArray::New(); shared_ptr<XdmfArray> referenceArray = XdmfArray::New();
for (unsigned int i = 0; i < 27; ++i) for (unsigned int i = 0; i < 27; ++i){
{ referenceArray->pushBack(i);
referenceArray->pushBack(i); }
}
std::vector<unsigned int> initDimensions; std::vector<unsigned int> initDimensions;
initDimensions.push_back(3); initDimensions.push_back(3);
initDimensions.push_back(3); initDimensions.push_back(3);
initDimensions.push_back(3); initDimensions.push_back(3);
referenceArray->resize(initDimensions, 0); referenceArray->resize(initDimensions, 0);
std::vector<unsigned int> newStarts; std::vector<unsigned int> newStarts;
newStarts.push_back(0); newStarts.push_back(0);
newStarts.push_back(0); newStarts.push_back(0);
newStarts.push_back(0); newStarts.push_back(0);