Commit a72f4007 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

Formatting changes and removing warnings

parent 03e031e0
......@@ -54,7 +54,7 @@ XdmfGraph::getItemTag() const
unsigned int
XdmfGraph::getNumberNodes() const
{
//The number of nodes is equal to the number of rows or columns. Either will work.
// The number of nodes is equal to the number of rows or columns. Either will work.
return this->getNumberRows();
}
......
......@@ -219,19 +219,18 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties,
}
else {
//this needs to be changed to account for controllers being a vector now
mRemoteTaskIdsControllers.clear();
for (unsigned int i = 0; i < arrayVector[0]->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < arrayVector[0]->getNumberHeavyDataControllers(); ++i)
{
mRemoteTaskIdsControllers.push_back(arrayVector[0]->getHeavyDataController(i));
}
mLocalNodeIdsControllers.clear();
for (unsigned int i = 0; i < arrayVector[1]->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < arrayVector[1]->getNumberHeavyDataControllers(); ++i)
{
mLocalNodeIdsControllers.push_back(arrayVector[1]->getHeavyDataController(i));
}
mRemoteLocalNodeIdsControllers.clear();
for (unsigned int i = 0; i < arrayVector[2]->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < arrayVector[2]->getNumberHeavyDataControllers(); ++i)
{
mRemoteLocalNodeIdsControllers.push_back(arrayVector[2]->getHeavyDataController(i));
}
......@@ -247,17 +246,17 @@ XdmfMap::read()
mRemoteLocalNodeIdsControllers.size() > 0) {
unsigned int localNodeCount = 0;
for (unsigned int i = 0; i< mLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i< mLocalNodeIdsControllers.size(); ++i)
{
localNodeCount += mLocalNodeIdsControllers[i]->getSize();
}
unsigned int remoteTaskCount = 0;
for (unsigned int i = 0; i< mRemoteTaskIdsControllers.size(); i++)
for (unsigned int i = 0; i< mRemoteTaskIdsControllers.size(); ++i)
{
remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize();
}
unsigned int remoteNodeCount = 0;
for (unsigned int i = 0; i< mRemoteLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i< mRemoteLocalNodeIdsControllers.size(); ++i)
{
remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize();
}
......@@ -280,21 +279,21 @@ XdmfMap::read()
shared_ptr<XdmfArray> remoteLocalNodeIds = XdmfArray::New();
mRemoteTaskIdsControllers[0]->read(remoteTaskIds.get());
for (unsigned int i = 1; i < mRemoteTaskIdsControllers.size(); i++)
for (unsigned int i = 1; i < mRemoteTaskIdsControllers.size(); ++i)
{
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteTaskIdsControllers[i]->read(tempArray.get());
remoteTaskIds->insert(remoteTaskIds->getSize(), tempArray, 0, tempArray->getSize());
}
mLocalNodeIdsControllers[0]->read(localNodeIds.get());
for (unsigned int i = 1; i < mLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 1; i < mLocalNodeIdsControllers.size(); ++i)
{
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mLocalNodeIdsControllers[i]->read(tempArray.get());
localNodeIds->insert(localNodeIds->getSize(), tempArray, 0, tempArray->getSize());
}
mRemoteLocalNodeIdsControllers[0]->read(remoteLocalNodeIds.get());
for (unsigned int i = 1; i < mRemoteLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 1; i < mRemoteLocalNodeIdsControllers.size(); ++i)
{
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteLocalNodeIdsControllers[i]->read(tempArray.get());
......@@ -324,17 +323,17 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController>
std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers)
{
unsigned int localNodeCount = 0;
for (unsigned int i = 0; i< localNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i< localNodeIdsControllers.size(); ++i)
{
localNodeCount += localNodeIdsControllers[i]->getSize();
}
unsigned int remoteTaskCount = 0;
for (unsigned int i = 0; i< remoteTaskIdsControllers.size(); i++)
for (unsigned int i = 0; i< remoteTaskIdsControllers.size(); ++i)
{
remoteTaskCount += remoteTaskIdsControllers[i]->getSize();
}
unsigned int remoteNodeCount = 0;
for (unsigned int i = 0; i< remoteLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i< remoteLocalNodeIdsControllers.size(); ++i)
{
remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize();
}
......@@ -396,15 +395,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
}
}
for (unsigned int i = 0; i < mRemoteTaskIdsControllers.size(); i++)
for (unsigned int i = 0; i < mRemoteTaskIdsControllers.size(); ++i)
{
remoteTaskIds->insert(mRemoteTaskIdsControllers[i]);
}
for (unsigned int i = 0; i < mLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i < mLocalNodeIdsControllers.size(); ++i)
{
localNodeIds->insert(mLocalNodeIdsControllers[i]);
}
for (unsigned int i = 0; i < mRemoteLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i < mRemoteLocalNodeIdsControllers.size(); ++i)
{
remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]);
}
......@@ -417,15 +416,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
mRemoteTaskIdsControllers.clear();
mRemoteLocalNodeIdsControllers.clear();
for (unsigned int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); ++i)
{
mRemoteTaskIdsControllers.push_back(remoteTaskIds->getHeavyDataController(i));
}
for (unsigned int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); ++i)
{
mLocalNodeIdsControllers.push_back(localNodeIds->getHeavyDataController(i));
}
for (unsigned int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); ++i)
{
mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i));
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -950,6 +950,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%include XdmfItem.hpp
%include XdmfItemProperty.hpp
%include XdmfSparseMatrix.hpp
%include XdmfSystemUtils.hpp
%include XdmfVisitor.hpp
%include XdmfHeavyDataController.hpp
%include XdmfHeavyDataWriter.hpp
......
This diff is collapsed.
......@@ -68,8 +68,8 @@ XdmfError::setBuffer(std::streambuf* buf)
*** Private Static Functions ***
********************************/
//automatically writes the message to the provided buffer
//by default this is basically a print statement
// automatically writes the message to the provided buffer
// by default this is basically a print statement
void
XdmfError::WriteToStream(std::string msg)
{
......
This diff is collapsed.
......@@ -202,8 +202,8 @@ XdmfSparseMatrix::populateItem(const std::map<std::string, std::string> & itemPr
}
if(arrayVector.size() < 3) {
//The three required arrays are for the row pointer, column index, and the contained values.
//Without these arrays the object can't be properly built.
// The three required arrays are for the row pointer, column index, and the contained values.
// Without these arrays the object can't be properly built.
try {
XdmfError::message(XdmfError::FATAL,
"Expected 3 arrays attached to "
......
......@@ -73,6 +73,7 @@ public:
{
mXPath.clear();
//this section writes to file
std::ofstream fileStream;
if(!mStream) {
fileStream.open(mXMLFilePath.c_str());
......@@ -96,7 +97,7 @@ public:
xmlFreeDoc(mXMLDocument);
xmlCleanupParser();
if(mHeavyDataWriter->getMode() == XdmfHeavyDataWriter::Default) {
mHeavyDataWriter->closeFile();
}
......@@ -285,6 +286,7 @@ XdmfWriter::visit(XdmfArray & array,
const bool isSubclassed =
array.getItemTag().compare(XdmfArray::ItemTag) != 0;
if(isSubclassed) {
try {
this->visit(dynamic_cast<XdmfItem &>(array), visitor);
......@@ -294,10 +296,10 @@ XdmfWriter::visit(XdmfArray & array,
}
}
if(array.getSize() > 0 && !(mImpl->mLastXPathed && isSubclassed)) {
std::vector<std::string> xmlTextValues;
//adjust for multifile write
// Take care of writing to single heavy data file (Default behavior)
if(!array.isInitialized() && array.getHeavyDataController(0) &&
array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0 &&
......@@ -307,36 +309,42 @@ XdmfWriter::visit(XdmfArray & array,
if(array.getHeavyDataController(0) ||
array.getSize() > mImpl->mLightDataLimit) {
//this case is for if the data is smaller than the limit
//create case for when data is over the limit
// Write values to heavy data
try {
try {// this takes about half the time needed
mImpl->mHeavyDataWriter->visit(array, mImpl->mHeavyDataWriter);
}
catch (XdmfError e) {
throw e;
}
std::stringstream valuesStream;
for(unsigned int i = 0; i < array.getNumberHeavyDataControllers(); i++) {
for(unsigned int i = 0; i < array.getNumberHeavyDataControllers(); ++i) {
std::string heavyDataPath =
array.getHeavyDataController(i)->getFilePath();
size_t index = heavyDataPath.find_last_of("/\\");
if(index != std::string::npos) {//if path is not a folder
const std::string heavyDataDir = heavyDataPath.substr(0, index + 1);//put the directory path into this variable
if(mImpl->mXMLFilePath.find(heavyDataDir) == 0) {//if the directory is in the XML File Path
if(index != std::string::npos) {
// if path is not a folder
// put the directory path into this variable
const std::string heavyDataDir = heavyDataPath.substr(0, index + 1);
// if the directory is in the XML File Path
if(mImpl->mXMLFilePath.find(heavyDataDir) == 0) {
heavyDataPath =
heavyDataPath.substr(heavyDataDir.size(),
heavyDataPath.size() - heavyDataDir.size());//pull the file off of the end and place it in the DataPath
}//otherwise the full path is required
heavyDataPath.size() - heavyDataDir.size());
// pull the file off of the end and place it in the DataPath
}
// otherwise the full path is required
}
std::stringstream dimensionStream;
for (unsigned int j = 0; j < array.getHeavyDataController(i)->getDimensions().size(); j++) {
for (unsigned int j = 0; j < array.getHeavyDataController(i)->getDimensions().size(); ++j) {
dimensionStream << array.getHeavyDataController(i)->getDimensions()[j];
if (j < array.getHeavyDataController(i)->getDimensions().size() - 1) {
dimensionStream << " ";
}
}
valuesStream.str(std::string());//clear the stream
// clear the stream
valuesStream.str(std::string());
if (array.getNumberHeavyDataControllers() > 1) {
valuesStream << heavyDataPath << ":"
<< array.getHeavyDataController(i)->getDataSetPath()
......@@ -366,7 +374,7 @@ XdmfWriter::visit(XdmfArray & array,
array.swap(arrayToWrite);
mImpl->mXMLCurrentNode = mImpl->mXMLCurrentNode->last;
this->visit(dynamic_cast<XdmfItem &>(*arrayToWrite.get()), visitor);
for(unsigned int i = 0; i<xmlTextValues.size(); i++) {
for(unsigned int i = 0; i<xmlTextValues.size(); ++i) {
xmlAddChild(mImpl->mXMLCurrentNode->last,
xmlNewText((xmlChar*)xmlTextValues[i].c_str()));
}
......@@ -375,7 +383,7 @@ XdmfWriter::visit(XdmfArray & array,
}
else {
this->visit(dynamic_cast<XdmfItem &>(array), visitor);
for(unsigned int i = 0; i<xmlTextValues.size(); i++) {
for(unsigned int i = 0; i<xmlTextValues.size(); ++i) {
xmlAddChild(mImpl->mXMLCurrentNode->last,
xmlNewText((xmlChar*)xmlTextValues[i].c_str()));
}
......@@ -415,7 +423,7 @@ XdmfWriter::visit(XdmfItem & item,
XdmfInformation & xpathinfo = dynamic_cast<XdmfInformation &>(item);
if (xpathinfo.getKey() == "XIncludes") {
shared_ptr<XdmfInformation> outputinfo;
for (unsigned int i = 0; i < xpathinfo.getNumberInformations(); i++) {
for (unsigned int i = 0; i < xpathinfo.getNumberInformations(); ++i) {
mImpl->mXPathCount++;
outputinfo = xpathinfo.getInformation(i);
mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode,
......@@ -509,6 +517,7 @@ XdmfWriter::visit(XdmfItem & item,
}
else {
// Not inserted before --- need to write all data and traverse.
mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode,
NULL,
(xmlChar *)tag.c_str(),
......
......@@ -50,7 +50,7 @@ int main(int, char **)
catch (XdmfError e)
{
//a print statement is redundant since the error message is sent to cout
//printf("The error message is:\n%s\n", e.what());
//std::cout << "The error message is:\n" << e.what() << std::endl;
}
return 0;
......
......@@ -189,7 +189,7 @@ int main(int, char **)
dimensionVector.push_back(5);
dimensionVector.push_back(4);
writtenArray->initialize<int>(dimensionVector);
for (int i = 0; i < 20; i++)
for (int i = 0; i < 20; ++i)
{
writtenArray->insert(i, i + 1);
}
......@@ -234,9 +234,9 @@ shared_ptr<XdmfArray> maximum(std::vector<shared_ptr<XdmfArray> > values)
else
{
double maxVal = values[0]->getValue<double>(0);
for (int i = 0; i < values.size(); i++)
for (int i = 0; i < values.size(); ++i)
{
for (int j = 0; j < values[i]->getSize(); j++)
for (int j = 0; j < values[i]->getSize(); ++j)
{
if (maxVal < values[i]->getValue<double>(j))
{
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
shared_ptr<XdmfArray> testArray = XdmfArray::New();
for (unsigned int i = 1; i <= 4; i++)
for (unsigned int i = 1; i <= 4; ++i)
{
testArray->pushBack(i*id);
}
......@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
testArray->insert(writeController);
for (unsigned int i = 0; i<size; i++)
for (unsigned int i = 0; i<size; ++i)
{
MPI_Barrier(comm);
if (i == id)
......@@ -106,26 +106,26 @@ int main(int argc, char *argv[])
std::cout << "filepath = " << testArray->getHeavyDataController(0)->getFilePath() << std::endl;
outputVector = testArray->getHeavyDataController(0)->getDataspaceDimensions();
std::cout << "Data space dimensions" << std::endl;
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
}
std::cout << "Controller Dimensions" << std::endl;
outputVector = testArray->getHeavyDataController(0)->getDimensions();
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
}
std::cout << "Controller size" << testArray->getHeavyDataController(0)->getSize() << std::endl;
std::cout << "Controller starts" << std::endl;
outputVector = testArray->getHeavyDataController(0)->getStart();
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
}
std::cout << "Controller strides" << std::endl;
outputVector = testArray->getHeavyDataController(0)->getStride();
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << "\n" << std::endl;
}
......@@ -169,7 +169,7 @@ int main(int argc, char *argv[])
std::cout << "done testing read" << std::endl;
for (unsigned int i = 0; i<size; i++)
for (unsigned int i = 0; i<size; ++i)
{
MPI_Barrier(comm);
if (i == id)
......@@ -180,26 +180,26 @@ int main(int argc, char *argv[])
std::cout << "filepath = " << readArray->getHeavyDataController(0)->getFilePath() << std::endl;
outputVector = readArray->getHeavyDataController(0)->getDataspaceDimensions();
std::cout << "Data space dimensions" << std::endl;
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
}
std::cout << "Controller Dimensions" << std::endl;
outputVector = readArray->getHeavyDataController(0)->getDimensions();
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
}
std::cout << "Controller size" << readArray->getHeavyDataController(0)->getSize() << std::endl;
std::cout << "Controller starts" << std::endl;
outputVector = readArray->getHeavyDataController(0)->getStart();
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
}
std::cout << "Controller strides" << std::endl;
outputVector = readArray->getHeavyDataController(0)->getStride();
for (int j=0; j<outputVector.size(); j++)
for (int j=0; j<outputVector.size(); ++j)
{
std::cout << "[" << j << "] =" << outputVector[j] << "\n" << std::endl;
}
......
......@@ -190,7 +190,7 @@ int main(int, char **)
/*
the version of XdmfMap::New() used here returns a number of maps equal to the number of attributes it was provided with.
*/
for (int i = 0; i<mapcollection.size(); i++)
for (int i = 0; i<mapcollection.size(); ++i)
{
gridHolder->insert(mapcollection[i]);
}
......@@ -226,14 +226,14 @@ int main(int, char **)
primaryDomain->accept(exampleWriter);
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
for (int i = 0; i <= 408; i++)
for (int i = 0; i <= 408; ++i)
{//overflow occurs a little after the end of this loop
primaryDomain->accept(exampleHeavyWriter);
}
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Default);
primaryDomain->accept(exampleHeavyWriter);
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
for (int i = 0; i<5; i++)
for (int i = 0; i<5; ++i)
{//this loop covers the overflow of the fileSizeLimit
primaryDomain->accept(exampleHeavyWriter);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -222,28 +222,23 @@ int main(int, char **)
exampleHeavyWriter->setFileSizeLimit(1);
primaryDomain->accept(exampleHeavyWriter);
printf("default mode\n");
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Overwrite);//do this so that the data isn't in the hdf5 file twice.
printf("overwrite mode\n");
exampleHeavyWriter->setFileIndex(0);
exampleWriter->setLightDataLimit(1);
primaryDomain->accept(exampleWriter);
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
printf("append mode\n");
for (int i = 0; i <= 797; i++)
{//overflow occurs at around 509
primaryDomain->accept(exampleHeavyWriter);
}
/*exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Default);
printf("default mode\n");
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Default);
primaryDomain->accept(exampleHeavyWriter);
printf("append mode\n");
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
for (int i = 0; i<500; i++)
{
primaryDomain->accept(exampleHeavyWriter);
}*/
}
primaryDomain->accept(exampleWriter);
return 0;
}
......@@ -9,6 +9,6 @@ int main(int, char **)
shared_ptr<XdmfReader> testReader = XdmfReader::New();
shared_ptr<XdmfArray> readArray = shared_dynamic_cast<XdmfArray>(testReader->read("arraydata.xmf"));
readArray->read();
printf("Array ocntains %s\n", readArray->getValuesString());
std::cout << "Array ocntains " << readArray->getValuesString() << std::endl;
return 0;
}
......@@ -17,16 +17,16 @@ int main(int, char **)
shared_ptr<XdmfReader> testReader = XdmfReader::New();
/*
shared_ptr<XdmfArray> readArray = shared_dynamic_cast<XdmfArray>(testReader->read("array.xmf"));
printf("Array ocntains %s\n", readArray->getValuesString());
std::cout << "Array ocntains " << readArray->getValuesString() << std::endl;
*/
shared_ptr<XdmfDomain> readDomain = shared_dynamic_cast<XdmfDomain>(testReader->read("array.xmf"));
printf("pulling out unstructured grid\n");
std::cout << "pulling out unstructured grid" << std::endl;
shared_ptr<XdmfRectilinearGrid> readGrid = readDomain->getRectilinearGrid(0);
//printf("pulling out geometry\n");
//std::cout << "pulling out geometry" << std::endl;
//shared_ptr<XdmfGeometry> readGeometry = readGrid->getGeometry();
printf("pulling out dimensions\n");
std::cout << "pulling out dimensions" << std::endl;
std::vector<shared_ptr<XdmfArray> > readDimensions = readGrid->getCoordinates();
printf("Geometry contains %s\n", readDimensions[0]->getValuesString());
std::cout << "Geometry contains " << readDimensions[0]->getValuesString() << std::endl;
shared_ptr<XdmfWriter> testWriter = XdmfWriter::New("arrayoutput.xmf");
readGrid->accept(testWriter);
//readArray->accept(testWriter);
......
......@@ -35,11 +35,9 @@ int main(int, char **)
shared_ptr<XdmfWriter> writer = XdmfWriter::New("TestXdmfGraph.xmf");
graph->accept(writer);
printf("after writing\n");
shared_ptr<XdmfReader> reader = XdmfReader::New();
shared_ptr<XdmfGraph> readGraph =
shared_dynamic_cast<XdmfGraph>(reader->read("TestXdmfGraph.xmf"));
printf("after reading\n");
assert(readGraph);
assert(readGraph->getNumberNodes() == graph->getNumberNodes());
assert(readGraph->getNumberAttributes() == graph->getNumberAttributes());
......
......@@ -211,7 +211,7 @@ double parse(std::string expression, std::map<std::string, double> variables)
//if it is grab the string between paranthesis
i = i + 2;
valueStart = i;
unsigned int numOpenParenthesis = 0;
int numOpenParenthesis = 0;
while ((expression[i] != ')' || numOpenParenthesis) && i < expression.size())
{
if (expression[i] == '(')
......@@ -483,7 +483,7 @@ shared_ptr<XdmfArray> parse(std::string expression, std::map<std::string, shared
//if it is grab the string between paranthesis
i = i + 2;
valueStart = i;
unsigned int numOpenParenthesis = 0;
int numOpenParenthesis = 0;
while ((expression[i] != ')' || numOpenParenthesis) && i < expression.size())
{
if (expression[i] == '(')
......@@ -996,11 +996,11 @@ shared_ptr<XdmfArray> calculation(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArr
if (i<arrayRatio1)
{
int amountWritten = val1->getSize()/arrayRatio1;
if ((unsigned int)((amountWritten * arrayRatio1) + i) < val1->getSize())
if (((amountWritten * arrayRatio1) + i) < (int)val1->getSize())
{
amountWritten++;
}
if (amountWritten > floor(val2->getSize()/arrayRatio2))
if (amountWritten > (int)floor(val2->getSize()/arrayRatio2))
{
arrayExcess1 += amountWritten - (int)floor(val2->getSize()/arrayRatio2);
amountWritten = (int)floor(val2->getSize()/arrayRatio2);
......@@ -1010,11 +1010,11 @@ shared_ptr<XdmfArray> calculation(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArr
else //second array takes the rest
{
int amountWritten = val2->getSize()/arrayRatio2;
if ((unsigned int)((amountWritten * arrayRatio2) + i) < val2->getSize())
if (((amountWritten * arrayRatio2) + i) < (int)val2->getSize())
{
amountWritten++;
}
if (amountWritten > floor(val1->getSize()/arrayRatio1))
if (amountWritten > (int)floor(val1->getSize()/arrayRatio1))
{
arrayExcess2 += amountWritten - (int)floor(val1->getSize()/arrayRatio1);
amountWritten = (int)floor(val1->getSize()/arrayRatio1);
......
......@@ -35,7 +35,6 @@ if __name__ == "__main__":
startclock = time.clock()
for i in range(numTimestamps):
#print "timestamp " + str(i)
timestampGrid = XdmfGridCollection.New()
timestampTime = XdmfTime.New(i)
timestampGrid.setTime(timestampTime)
......@@ -68,11 +67,15 @@ if __name__ == "__main__":
#sectionGrid.accept(exampleHeavyWriter)
#exampleHeavyWriter.closeFile()
primaryCollection.insert(timestampGrid)
writeclock = time.clock()
exampleHeavyWriter.openFile()
timestampGrid.accept(exampleHeavyWriter)
#primaryDomain.accept(exampleHeavyWriter)
#primaryDomain.accept(exampleWriter)
if i % 10 == 9:
primaryDomain.accept(exampleWriter)
else:
timestampGrid.accept(exampleHeavyWriter)
exampleHeavyWriter.closeFile()
print "iteration " + str(i) + " Time = " + str(time.clock() - writeclock)
exampleHeavyWriter.openFile()
......@@ -81,3 +84,8 @@ if __name__ == "__main__":
exampleHeavyWriter.closeFile()
print (time.clock() - startclock)
print XdmfSystemUtils.getRealPath("timestamptest.xmf")
#os.remove("/usr/var/tmp/ajburns/timing.xmf")
#os.remove("/usr/var/tmp/ajburns/timing.h5")
This diff is collapsed.
......@@ -173,6 +173,7 @@ class XdmfHeavyDataWriter;
#define XdmfInitHDF5 xdmfinithdf5_
#define XdmfSetTopologyPolyline xdmfsettopologypolyline_
#define XdmfSetTopologyPolygon xdmfsettopologypolygon_
#define XdmfRetrieveNumDomainGridCollections xdmfretrievenumdomaingridcollections_
......@@ -541,10 +542,6 @@ public:
const void * const connectivityValues,
const int numNodes);
/**
* Returns the number of grid collections currently
* contained in the domain
......@@ -2285,6 +2282,21 @@ public:
const int arrayType,
const void * const connectivityValues);
/**
* Set the topology (connectivity data) for a polygon that will be
* added to the next grid.
*
* @param nodesPerElement number of nodes in the polygon.
* @param numValues number of connectivity values to copy.
* @param arrayType type of connectivity values.
* @param connectivityValues array of connectivity values.
*
* @return int providing id to fortran if reusing.
*/
int setTopologyPolygon(const unsigned int nodesPerElement,
const unsigned int numValues,
const int arrayType,
const void * const connectivityValues);
private:
......
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