Commit b5dd7763 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont
Browse files

changes to suppress warnings when using -Wall

parent f23f1bef
...@@ -221,17 +221,17 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties, ...@@ -221,17 +221,17 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties,
//this needs to be changed to account for controllers being a vector now //this needs to be changed to account for controllers being a vector now
mRemoteTaskIdsControllers.clear(); mRemoteTaskIdsControllers.clear();
for (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)); mRemoteTaskIdsControllers.push_back(arrayVector[0]->getHeavyDataController(i));
} }
mLocalNodeIdsControllers.clear(); mLocalNodeIdsControllers.clear();
for (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)); mLocalNodeIdsControllers.push_back(arrayVector[1]->getHeavyDataController(i));
} }
mRemoteLocalNodeIdsControllers.clear(); mRemoteLocalNodeIdsControllers.clear();
for (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)); mRemoteLocalNodeIdsControllers.push_back(arrayVector[2]->getHeavyDataController(i));
} }
...@@ -246,18 +246,18 @@ XdmfMap::read() ...@@ -246,18 +246,18 @@ XdmfMap::read()
mRemoteTaskIdsControllers.size() > 0 && mRemoteTaskIdsControllers.size() > 0 &&
mRemoteLocalNodeIdsControllers.size() > 0) { mRemoteLocalNodeIdsControllers.size() > 0) {
int localNodeCount = 0; unsigned int localNodeCount = 0;
for (int i = 0; i< mLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< mLocalNodeIdsControllers.size(); i++)
{ {
localNodeCount += mLocalNodeIdsControllers[i]->getSize(); localNodeCount += mLocalNodeIdsControllers[i]->getSize();
} }
int remoteTaskCount = 0; unsigned int remoteTaskCount = 0;
for (int i = 0; i< mRemoteTaskIdsControllers.size(); i++) for (unsigned int i = 0; i< mRemoteTaskIdsControllers.size(); i++)
{ {
remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize(); remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize();
} }
int remoteNodeCount = 0; unsigned int remoteNodeCount = 0;
for (int i = 0; i< mRemoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< mRemoteLocalNodeIdsControllers.size(); i++)
{ {
remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize(); remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize();
} }
...@@ -280,21 +280,21 @@ XdmfMap::read() ...@@ -280,21 +280,21 @@ XdmfMap::read()
shared_ptr<XdmfArray> remoteLocalNodeIds = XdmfArray::New(); shared_ptr<XdmfArray> remoteLocalNodeIds = XdmfArray::New();
mRemoteTaskIdsControllers[0]->read(remoteTaskIds.get()); mRemoteTaskIdsControllers[0]->read(remoteTaskIds.get());
for (int i = 1; i < mRemoteTaskIdsControllers.size(); i++) for (unsigned int i = 1; i < mRemoteTaskIdsControllers.size(); i++)
{ {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteTaskIdsControllers[i]->read(tempArray.get()); mRemoteTaskIdsControllers[i]->read(tempArray.get());
remoteTaskIds->insert(remoteTaskIds->getSize(), tempArray, 0, tempArray->getSize()); remoteTaskIds->insert(remoteTaskIds->getSize(), tempArray, 0, tempArray->getSize());
} }
mLocalNodeIdsControllers[0]->read(localNodeIds.get()); mLocalNodeIdsControllers[0]->read(localNodeIds.get());
for (int i = 1; i < mLocalNodeIdsControllers.size(); i++) for (unsigned int i = 1; i < mLocalNodeIdsControllers.size(); i++)
{ {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mLocalNodeIdsControllers[i]->read(tempArray.get()); mLocalNodeIdsControllers[i]->read(tempArray.get());
localNodeIds->insert(localNodeIds->getSize(), tempArray, 0, tempArray->getSize()); localNodeIds->insert(localNodeIds->getSize(), tempArray, 0, tempArray->getSize());
} }
mRemoteLocalNodeIdsControllers[0]->read(remoteLocalNodeIds.get()); mRemoteLocalNodeIdsControllers[0]->read(remoteLocalNodeIds.get());
for (int i = 1; i < mRemoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 1; i < mRemoteLocalNodeIdsControllers.size(); i++)
{ {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteLocalNodeIdsControllers[i]->read(tempArray.get()); mRemoteLocalNodeIdsControllers[i]->read(tempArray.get());
...@@ -323,18 +323,18 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController> ...@@ -323,18 +323,18 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController>
std::vector<shared_ptr<XdmfHeavyDataController> > localNodeIdsControllers, std::vector<shared_ptr<XdmfHeavyDataController> > localNodeIdsControllers,
std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers) std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers)
{ {
int localNodeCount = 0; unsigned int localNodeCount = 0;
for (int i = 0; i< localNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< localNodeIdsControllers.size(); i++)
{ {
localNodeCount += localNodeIdsControllers[i]->getSize(); localNodeCount += localNodeIdsControllers[i]->getSize();
} }
int remoteTaskCount = 0; unsigned int remoteTaskCount = 0;
for (int i = 0; i< remoteTaskIdsControllers.size(); i++) for (unsigned int i = 0; i< remoteTaskIdsControllers.size(); i++)
{ {
remoteTaskCount += remoteTaskIdsControllers[i]->getSize(); remoteTaskCount += remoteTaskIdsControllers[i]->getSize();
} }
int remoteNodeCount = 0; unsigned int remoteNodeCount = 0;
for (int i = 0; i< remoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< remoteLocalNodeIdsControllers.size(); i++)
{ {
remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize(); remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize();
} }
...@@ -396,15 +396,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor) ...@@ -396,15 +396,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
} }
} }
for (int i = 0; i < mRemoteTaskIdsControllers.size(); i++) for (unsigned int i = 0; i < mRemoteTaskIdsControllers.size(); i++)
{ {
remoteTaskIds->insert(mRemoteTaskIdsControllers[i]); remoteTaskIds->insert(mRemoteTaskIdsControllers[i]);
} }
for (int i = 0; i < mLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i < mLocalNodeIdsControllers.size(); i++)
{ {
localNodeIds->insert(mLocalNodeIdsControllers[i]); localNodeIds->insert(mLocalNodeIdsControllers[i]);
} }
for (int i = 0; i < mRemoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i < mRemoteLocalNodeIdsControllers.size(); i++)
{ {
remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]); remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]);
} }
...@@ -417,15 +417,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor) ...@@ -417,15 +417,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
mRemoteTaskIdsControllers.clear(); mRemoteTaskIdsControllers.clear();
mRemoteLocalNodeIdsControllers.clear(); mRemoteLocalNodeIdsControllers.clear();
for (int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); i++)
{ {
mRemoteTaskIdsControllers.push_back(remoteTaskIds->getHeavyDataController(i)); mRemoteTaskIdsControllers.push_back(remoteTaskIds->getHeavyDataController(i));
} }
for (int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); i++)
{ {
mLocalNodeIdsControllers.push_back(localNodeIds->getHeavyDataController(i)); mLocalNodeIdsControllers.push_back(localNodeIds->getHeavyDataController(i));
} }
for (int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); i++)
{ {
mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i)); mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i));
} }
......
...@@ -539,7 +539,7 @@ public: ...@@ -539,7 +539,7 @@ public:
{ {
if(mArray->mHeavyDataControllers.size()>0) { if(mArray->mHeavyDataControllers.size()>0) {
int total = 0; int total = 0;
for (int i = 0; i < mArray->mHeavyDataControllers.size(); i++) { for (unsigned int i = 0; i < mArray->mHeavyDataControllers.size(); i++) {
total += mArray->mHeavyDataControllers[i]->getSize(); total += mArray->mHeavyDataControllers[i]->getSize();
} }
return total; return total;
...@@ -613,7 +613,7 @@ XdmfArray::evaluateExpression(std::string expression, std::map<std::string, shar ...@@ -613,7 +613,7 @@ XdmfArray::evaluateExpression(std::string expression, std::map<std::string, shar
//string is parsed left to right //string is parsed left to right
//elements of the same priority are evaluated right to left //elements of the same priority are evaluated right to left
for (int i = 0; i < expression.size(); i++) { for (unsigned int i = 0; i < expression.size(); i++) {
if (mValidDigitChars.find(expression[i]) != std::string::npos) {//found to be a digit if (mValidDigitChars.find(expression[i]) != std::string::npos) {//found to be a digit
//progress until a non-digit is found //progress until a non-digit is found
int valueStart = i; int valueStart = i;
...@@ -880,13 +880,12 @@ XdmfArray::addOperation(char newoperator, shared_ptr<XdmfArray>(*operationref)(s ...@@ -880,13 +880,12 @@ XdmfArray::addOperation(char newoperator, shared_ptr<XdmfArray>(*operationref)(s
else { //build the operation else { //build the operation
//add operation to the supported character string //add operation to the supported character string
mSupportedOperations.push_back(newoperator); mSupportedOperations.push_back(newoperator);
int priorityArraySize = sizeof(mOperationPriority)/sizeof(int); unsigned int priorityArraySize = sizeof(mOperationPriority)/sizeof(int);
if (mSupportedOperations.size()-1 > priorityArraySize) {//first check to see if the priority array is large enough if (mSupportedOperations.size()-1 > priorityArraySize) {//first check to see if the priority array is large enough
//if it isn't make it bigger, double size should be fine //if it isn't make it bigger, double size should be fine
int newArray [priorityArraySize*2]; int newArray [priorityArraySize*2];
std::copy(mOperationPriority, mOperationPriority+(priorityArraySize-1), newArray); std::copy(mOperationPriority, mOperationPriority+(priorityArraySize-1), newArray);
delete mOperationPriority; *mOperationPriority = *newArray;
*mOperationPriority = *newArray;
} }
size_t priorityLocation = mSupportedOperations.find(newoperator); size_t priorityLocation = mSupportedOperations.find(newoperator);
mOperationPriority[priorityLocation] = priority; mOperationPriority[priorityLocation] = priority;
...@@ -1161,8 +1160,8 @@ XdmfArray::interlace(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2) ...@@ -1161,8 +1160,8 @@ XdmfArray::interlace(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2)
returnArray->resize(val1->getSize()+val2->getSize(), sampleValue); returnArray->resize(val1->getSize()+val2->getSize(), sampleValue);
} }
//determine ratio of array sizes //determine ratio of array sizes
int arrayRatio1 = floor(static_cast<double>(val1->getSize())/val2->getSize()); int arrayRatio1 = (int)floor(static_cast<double>(val1->getSize())/val2->getSize());
int arrayRatio2 = floor(static_cast<double>(val2->getSize())/val1->getSize()); int arrayRatio2 = (int)floor(static_cast<double>(val2->getSize())/val1->getSize());
if (arrayRatio1 < 1) { if (arrayRatio1 < 1) {
arrayRatio1 = 1; arrayRatio1 = 1;
} }
...@@ -1178,23 +1177,23 @@ XdmfArray::interlace(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2) ...@@ -1178,23 +1177,23 @@ XdmfArray::interlace(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2)
//first array gets the first value of the new array //first array gets the first value of the new array
if (i<arrayRatio1) { if (i<arrayRatio1) {
int amountWritten = val1->getSize()/arrayRatio1; int amountWritten = val1->getSize()/arrayRatio1;
if (((amountWritten * arrayRatio1) + i) < val1->getSize()) { if (((amountWritten * arrayRatio1) + i) < (int)val1->getSize()) {
amountWritten++; amountWritten++;
} }
if (amountWritten > floor(val2->getSize()/arrayRatio2)) { if (amountWritten > floor(val2->getSize()/arrayRatio2)) {
arrayExcess1 += amountWritten - floor(val2->getSize()/arrayRatio2); arrayExcess1 += amountWritten - (int)floor(val2->getSize()/arrayRatio2);
amountWritten = floor(val2->getSize()/arrayRatio2); amountWritten = (int)floor(val2->getSize()/arrayRatio2);
} }
returnArray->insert(i, val1, i, amountWritten, stride, arrayRatio1); returnArray->insert(i, val1, i, amountWritten, stride, arrayRatio1);
} }
else { //second array takes the rest else { //second array takes the rest
int amountWritten = val2->getSize()/arrayRatio2; int amountWritten = val2->getSize()/arrayRatio2;
if (((amountWritten * arrayRatio2) + i) < val2->getSize()) { if (((amountWritten * arrayRatio2) + i) < (int)val2->getSize()) {
amountWritten++; amountWritten++;
} }
if (amountWritten > floor(val1->getSize()/arrayRatio1)) { if (amountWritten > floor(val1->getSize()/arrayRatio1)) {
arrayExcess2 += amountWritten - floor(val1->getSize()/arrayRatio1); arrayExcess2 += amountWritten - (int)floor(val1->getSize()/arrayRatio1);
amountWritten = floor(val1->getSize()/arrayRatio1); amountWritten = (int)floor(val1->getSize()/arrayRatio1);
} }
returnArray->insert(i, val2, i-arrayRatio1, amountWritten, stride, arrayRatio2); returnArray->insert(i, val2, i-arrayRatio1, amountWritten, stride, arrayRatio2);
} }
...@@ -1226,7 +1225,7 @@ int ...@@ -1226,7 +1225,7 @@ int
XdmfArray::addFunction(std::string name, shared_ptr<XdmfArray>(*functionref)(std::vector<shared_ptr<XdmfArray> >)) XdmfArray::addFunction(std::string name, shared_ptr<XdmfArray>(*functionref)(std::vector<shared_ptr<XdmfArray> >))
{ {
//check to ensure that the name has valid characters //check to ensure that the name has valid characters
for (int i = 0; i < name.size(); i++) { for (unsigned int i = 0; i < name.size(); i++) {
if (mValidVariableChars.find(name[i]) == std::string::npos) {//if the character is not found in the list of valid characters if (mValidVariableChars.find(name[i]) == std::string::npos) {//if the character is not found in the list of valid characters
//then throw an error //then throw an error
try { try {
...@@ -1257,8 +1256,8 @@ shared_ptr<XdmfArray> ...@@ -1257,8 +1256,8 @@ shared_ptr<XdmfArray>
XdmfArray::sum(std::vector<shared_ptr<XdmfArray> > values) XdmfArray::sum(std::vector<shared_ptr<XdmfArray> > values)
{ {
double total = 0.0; double total = 0.0;
for (int i = 0; i < values.size(); i++) { for (unsigned int i = 0; i < values.size(); i++) {
for (int j = 0; j < values[i]->getSize(); j++) { for (unsigned int j = 0; j < values[i]->getSize(); j++) {
total += values[i]->getValue<double>(j); total += values[i]->getValue<double>(j);
} }
} }
...@@ -1272,7 +1271,7 @@ XdmfArray::ave(std::vector<shared_ptr<XdmfArray> > values) ...@@ -1272,7 +1271,7 @@ XdmfArray::ave(std::vector<shared_ptr<XdmfArray> > values)
{ {
double total = sum(values)->getValue<double>(0);; double total = sum(values)->getValue<double>(0);;
int totalSize = 0; int totalSize = 0;
for (int i = 0; i < values.size(); i++) for (unsigned int i = 0; i < values.size(); i++)
{ {
totalSize += values[i]->getSize(); totalSize += values[i]->getSize();
} }
...@@ -1310,9 +1309,9 @@ XdmfArray::getDimensions() const ...@@ -1310,9 +1309,9 @@ XdmfArray::getDimensions() const
std::vector<unsigned int> tempDimensions; std::vector<unsigned int> tempDimensions;
//find the controller with the most dimensions //find the controller with the most dimensions
int dimControllerIndex = 0; int dimControllerIndex = 0;
int dimSizeMax = 0; unsigned int dimSizeMax = 0;
unsigned int dimTotal = 0; unsigned int dimTotal = 0;
for (int i = 0; i < mHeavyDataControllers.size(); i++) { for (unsigned int i = 0; i < mHeavyDataControllers.size(); i++) {
dimTotal += mHeavyDataControllers[i]->getSize(); dimTotal += mHeavyDataControllers[i]->getSize();
if (mHeavyDataControllers[i]->getSize() > dimSizeMax) { if (mHeavyDataControllers[i]->getSize() > dimSizeMax) {
dimSizeMax = mHeavyDataControllers[i]->getSize(); dimSizeMax = mHeavyDataControllers[i]->getSize();
...@@ -1321,7 +1320,7 @@ XdmfArray::getDimensions() const ...@@ -1321,7 +1320,7 @@ XdmfArray::getDimensions() const
} }
//total up the size of the lower dimensions //total up the size of the lower dimensions
int controllerDimensionSubtotal = 1; int controllerDimensionSubtotal = 1;
for (int i = 0; i < mHeavyDataControllers[dimControllerIndex]->getDimensions().size() - 1; i++) { for (unsigned int i = 0; i < mHeavyDataControllers[dimControllerIndex]->getDimensions().size() - 1; i++) {
returnDimensions.push_back(mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]); returnDimensions.push_back(mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]);
controllerDimensionSubtotal *= mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]; controllerDimensionSubtotal *= mHeavyDataControllers[dimControllerIndex]->getDimensions()[i];
} }
...@@ -1566,12 +1565,12 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1566,12 +1565,12 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
//pull data from values //pull data from values
std::vector<unsigned int > dimTotalVector; std::vector<unsigned int > dimTotalVector;
unsigned int dimTotal = 1; unsigned int dimTotal = 1;
for (int i = 0; i < values->getDimensions().size(); i++) { for (unsigned int i = 0; i < values->getDimensions().size(); i++) {
dimTotalVector.push_back(dimTotal); dimTotalVector.push_back(dimTotal);
dimTotal *= values->getDimensions()[i]; dimTotal *= values->getDimensions()[i];
} }
std::vector<int> indexVector; std::vector<unsigned int> indexVector;
for (int i = 0; i < values->getDimensions().size(); i++) { for (unsigned int i = 0; i < values->getDimensions().size(); i++) {
indexVector.push_back(0); indexVector.push_back(0);
} }
shared_ptr<XdmfArray> holderArray = XdmfArray::New(); shared_ptr<XdmfArray> holderArray = XdmfArray::New();
...@@ -1580,7 +1579,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1580,7 +1579,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
//initialize the section of the array you're pulling from //initialize the section of the array you're pulling from
unsigned int startTotal = 0; unsigned int startTotal = 0;
dimTotal = 1; dimTotal = 1;
for (int i = 0; i < values->getDimensions().size(); i++) { for (unsigned int i = 0; i < values->getDimensions().size(); i++) {
if (i == 0) {//stride doesn't factor in to the first dimension since it's being used with the insert call if (i == 0) {//stride doesn't factor in to the first dimension since it's being used with the insert call
startTotal += valuesStartIndex[i] * dimTotal; startTotal += valuesStartIndex[i] * dimTotal;
} }
...@@ -1594,7 +1593,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1594,7 +1593,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
holderoffset+=numValues[0]; holderoffset+=numValues[0];
//increment up the vector //increment up the vector
bool increment = true; bool increment = true;
for (int i = 0; i < indexVector.size() && increment; i++) { for (unsigned int i = 0; i < indexVector.size() && increment; i++) {
indexVector[i]++; indexVector[i]++;
if (i+1 < numValues.size()) {//to keep the loop from breaking at the end if (i+1 < numValues.size()) {//to keep the loop from breaking at the end
if (indexVector[i] >= numValues[i+1]) { if (indexVector[i] >= numValues[i+1]) {
...@@ -1610,7 +1609,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1610,7 +1609,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
//use an variation of the last loop to insert into this array //use an variation of the last loop to insert into this array
indexVector.clear(); indexVector.clear();
for (int i = 0; i < this->getDimensions().size(); i++) { for (unsigned int i = 0; i < this->getDimensions().size(); i++) {
indexVector.push_back(0); indexVector.push_back(0);
} }
holderoffset = 0; holderoffset = 0;
...@@ -1618,7 +1617,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1618,7 +1617,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
//initialize the section of the array you're pulling from //initialize the section of the array you're pulling from
unsigned int startTotal = 0; unsigned int startTotal = 0;
dimTotal = 1; dimTotal = 1;
for (int i = 0; i < this->getDimensions().size(); i++) { for (unsigned int i = 0; i < this->getDimensions().size(); i++) {
if (i == 0) {//stride doesn't factor in to the first dimension since it's being used with the insert call if (i == 0) {//stride doesn't factor in to the first dimension since it's being used with the insert call
startTotal += startIndex[i] * dimTotal; startTotal += startIndex[i] * dimTotal;
} }
...@@ -1632,7 +1631,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1632,7 +1631,7 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
holderoffset+=numInserted[0]; holderoffset+=numInserted[0];
//increment up the vector //increment up the vector
bool increment = true; bool increment = true;
for (int i = 0; i < indexVector.size() && increment; i++) { for (unsigned int i = 0; i < indexVector.size() && increment; i++) {
indexVector[i]++; indexVector[i]++;
if (i+1 < numInserted.size()) {//to keep the loop from breaking at the end if (i+1 < numInserted.size()) {//to keep the loop from breaking at the end
if (indexVector[i] >= numInserted[i+1]) { if (indexVector[i] >= numInserted[i+1]) {
...@@ -1664,7 +1663,6 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex, ...@@ -1664,7 +1663,6 @@ XdmfArray::insert(const std::vector<unsigned int> startIndex,
catch (XdmfError e) { catch (XdmfError e) {
throw e; throw e;
} }
} }
} }
} }
...@@ -1712,7 +1710,7 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie ...@@ -1712,7 +1710,7 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie
std::vector<std::string> contentVals; std::vector<std::string> contentVals;
contentVals.push_back(content->second); contentVals.push_back(content->second);
int contentIndex=1; unsigned int contentIndex=1;
bool endOfContent = false; bool endOfContent = false;
...@@ -1799,7 +1797,7 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie ...@@ -1799,7 +1797,7 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie
} }
else {//if it fails then it means that the next content is not a dimension string else {//if it fails then it means that the next content is not a dimension string
//in this case it is assumed that the controller will have dimensions equal to the array //in this case it is assumed that the controller will have dimensions equal to the array
for (int j = 0; j < mDimensions.size(); j++) { for (unsigned int j = 0; j < mDimensions.size(); j++) {
contentDims.push_back(mDimensions[j]); contentDims.push_back(mDimensions[j]);
} }
contentStep = 1; contentStep = 1;
...@@ -1869,11 +1867,11 @@ XdmfArray::read() ...@@ -1869,11 +1867,11 @@ XdmfArray::read()
{ {
if(mHeavyDataControllers.size() > 0) { if(mHeavyDataControllers.size() > 0) {
this->release(); this->release();
for (int i = 0; i < mHeavyDataControllers.size(); i++) { for (unsigned int i = 0; i < mHeavyDataControllers.size(); i++) {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mHeavyDataControllers[i]->read(tempArray.get()); mHeavyDataControllers[i]->read(tempArray.get());
unsigned int dimTotal = 1; unsigned int dimTotal = 1;
for (int j = 0; j < mHeavyDataControllers[i]->getDimensions().size(); j++) { for (unsigned int j = 0; j < mHeavyDataControllers[i]->getDimensions().size(); j++) {
dimTotal *= mHeavyDataControllers[i]->getDimensions()[j]; dimTotal *= mHeavyDataControllers[i]->getDimensions()[j];
} }
this->insert(mHeavyDataControllers[i]->getArrayOffset(), tempArray, 0, dimTotal, 1, 1); this->insert(mHeavyDataControllers[i]->getArrayOffset(), tempArray, 0, dimTotal, 1, 1);
...@@ -1882,9 +1880,9 @@ XdmfArray::read() ...@@ -1882,9 +1880,9 @@ XdmfArray::read()
std::vector<unsigned int> tempDimensions; std::vector<unsigned int> tempDimensions;
//find the controller with the most dimensions //find the controller with the most dimensions
int dimControllerIndex = 0; int dimControllerIndex = 0;
int dimSizeMax = 0; unsigned int dimSizeMax = 0;
unsigned int dimTotal = 0; unsigned int dimTotal = 0;
for (int i = 0; i < mHeavyDataControllers.size(); i++) { for (unsigned int i = 0; i < mHeavyDataControllers.size(); i++) {
dimTotal += mHeavyDataControllers[i]->getSize(); dimTotal += mHeavyDataControllers[i]->getSize();
if (mHeavyDataControllers[i]->getSize() > dimSizeMax) { if (mHeavyDataControllers[i]->getSize() > dimSizeMax) {
dimSizeMax = mHeavyDataControllers[i]->getSize(); dimSizeMax = mHeavyDataControllers[i]->getSize();
...@@ -1893,7 +1891,7 @@ XdmfArray::read() ...@@ -1893,7 +1891,7 @@ XdmfArray::read()
} }
//total up the size of the lower dimensions //total up the size of the lower dimensions
int controllerDimensionSubtotal = 1; int controllerDimensionSubtotal = 1;
for (int i = 0; i < mHeavyDataControllers[dimControllerIndex]->getDimensions().size() - 1; i++) { for (unsigned int i = 0; i < mHeavyDataControllers[dimControllerIndex]->getDimensions().size() - 1; i++) {
returnDimensions.push_back(mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]); returnDimensions.push_back(mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]);
controllerDimensionSubtotal *= mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]; controllerDimensionSubtotal *= mHeavyDataControllers[dimControllerIndex]->getDimensions()[i];
} }
......
...@@ -190,13 +190,13 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i ...@@ -190,13 +190,13 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%extend XdmfArray { %extend XdmfArray {
%{ %{
#include <stack>; #include <stack>
/*These can't be accessed from python so don't worry about security issues.*/
static std::map<std::string, PyObject *> pythonFunctions; static std::map<std::string, PyObject *> pythonFunctions;
static std::map<char, PyObject *> pythonOperations; static std::map<char, PyObject *> pythonOperations;
static int pythonOperationPriority [4]; static int pythonOperationPriority [4];
static std::string pythonSupportedOperations = ""; static std::string pythonSupportedOperations = "";
%} %}
/*These can't be accessed from python so don't worry about security issues.*/
PyObject * getBuffer() { PyObject * getBuffer() {
void *vp = $self->getValuesInternal(); void *vp = $self->getValuesInternal();
...@@ -329,15 +329,6 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i ...@@ -329,15 +329,6 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
/*note, accessing private members is impossible from swig.*/ /*note, accessing private members is impossible from swig.*/
/*to generate new static functions mark them as static here.*/ /*to generate new static functions mark them as static here.*/
static std::vector<std::string> getSupportedFunctions()
{
std::vector<std::string> returnVector = XdmfArray::getSupportedFunctions();
for (std::map<std::string, PyObject *>::iterator functionWalker = pythonFunctions.begin(); functionWalker != pythonFunctions.end(); functionWalker++) {
returnVector.push_back(functionWalker->first);
}
return returnVec