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 ...@@ -54,7 +54,7 @@ XdmfGraph::getItemTag() const
unsigned int unsigned int
XdmfGraph::getNumberNodes() const 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(); return this->getNumberRows();
} }
......
...@@ -219,19 +219,18 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties, ...@@ -219,19 +219,18 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties,
} }
else { else {
//this needs to be changed to account for controllers being a vector now
mRemoteTaskIdsControllers.clear(); 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)); mRemoteTaskIdsControllers.push_back(arrayVector[0]->getHeavyDataController(i));
} }
mLocalNodeIdsControllers.clear(); 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)); mLocalNodeIdsControllers.push_back(arrayVector[1]->getHeavyDataController(i));
} }
mRemoteLocalNodeIdsControllers.clear(); 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)); mRemoteLocalNodeIdsControllers.push_back(arrayVector[2]->getHeavyDataController(i));
} }
...@@ -247,17 +246,17 @@ XdmfMap::read() ...@@ -247,17 +246,17 @@ XdmfMap::read()
mRemoteLocalNodeIdsControllers.size() > 0) { mRemoteLocalNodeIdsControllers.size() > 0) {
unsigned int localNodeCount = 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(); localNodeCount += mLocalNodeIdsControllers[i]->getSize();
} }
unsigned int remoteTaskCount = 0; 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(); remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize();
} }
unsigned int remoteNodeCount = 0; 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(); remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize();
} }
...@@ -280,21 +279,21 @@ XdmfMap::read() ...@@ -280,21 +279,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 (unsigned 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 (unsigned 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 (unsigned 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());
...@@ -324,17 +323,17 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController> ...@@ -324,17 +323,17 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController>
std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers) std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers)
{ {
unsigned int localNodeCount = 0; 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(); localNodeCount += localNodeIdsControllers[i]->getSize();
} }
unsigned int remoteTaskCount = 0; 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(); remoteTaskCount += remoteTaskIdsControllers[i]->getSize();
} }
unsigned int remoteNodeCount = 0; 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(); remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize();
} }
...@@ -396,15 +395,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor) ...@@ -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]); 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]); 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]); remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]);
} }
...@@ -417,15 +416,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor) ...@@ -417,15 +416,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
mRemoteTaskIdsControllers.clear(); mRemoteTaskIdsControllers.clear();
mRemoteLocalNodeIdsControllers.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)); 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)); 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)); mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i));
} }
......
This diff is collapsed.
...@@ -124,6 +124,98 @@ public: ...@@ -124,6 +124,98 @@ public:
XDMF_CHILDREN(XdmfArray, XdmfHeavyDataController, HeavyDataController, Name); XDMF_CHILDREN(XdmfArray, XdmfHeavyDataController, HeavyDataController, Name);
static const std::string ItemTag; static const std::string ItemTag;
/**
* Adds an operation to the list of viable operators.
*
* Example of Use:
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline prepend
* @skipline main
* @skipline addOperation
* @skipline return
* @until }
* @skipline prepend
* @until }
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline prepend
* @until val2.getSize
* @skipline return
* @skipline __main__
* @skipline addOperation
*
* @param newoperator the character to be associated with the provided binary operation
* @param functionref a pointer to the function to be associated with the provided operator
* @param priority used to determine order of operations the higher the value the earlier it is evaluated
*/
static int addOperation(char newoperator, shared_ptr<XdmfArray>(*functionref)(shared_ptr<XdmfArray>, shared_ptr<XdmfArray>), int priority);
/*
* adds a specified function to the list of functions used while evaluating strings
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline maximum
* @skipline main
* @skipline addFunction
* @skipline return
* @until }
* @skipline maximum
* @until else
* @skipline {
* @until returnArray;
* @skipline }
* @until }
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline maximum
* @until else
* @skipline maxVal
* @until pushBackAsFloat
* @skipline return
* @skipline __main__
* @skipline addFunction
*
* @param name A string to be associated with the provided function during string evaluation
* @param functionref A pointer to the function to be associated with the given string
* @return The total number of functions currently associated
*/
static int addFunction(std::string name, shared_ptr<XdmfArray>(*functionref)(std::vector<shared_ptr<XdmfArray> >));
/**
* Averages the values contained in all the provided arrays.
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline valueArray1
* @until valueVector
* @skipline valueArray1
* @until valueArray2
* @skipline ave
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline valueArray1
* @until valueVector
* @skipline valueArray1
* @until valueArray2
* @skipline ave
*
* @param values a vector containing the arrays to be used
* @return an XdmfArray containing one value which is the average of all values contained within the provided arrays
*/
static shared_ptr<XdmfArray> ave(std::vector<shared_ptr<XdmfArray> > values);
/** /**
* Remove all values from this array. * Remove all values from this array.
* *
...@@ -143,6 +235,31 @@ public: ...@@ -143,6 +235,31 @@ public:
*/ */
void clear(); void clear();
/**
* Joins the two provided arrays together end to end.
*
* Example of Use:
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline valueArray1
* @until (6)
* @skipline chunk
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline valueArray1
* @until (6)
* @skipline chunk
*
* @param val1 the first array being evaluated
* @param val2 the second array being evaluated
* @return the arrays joined end to end
*/
static shared_ptr<XdmfArray> chunk(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2);
/** /**
* Remove a value from this array. * Remove a value from this array.
* *
...@@ -165,12 +282,6 @@ public: ...@@ -165,12 +282,6 @@ public:
*/ */
void erase(const unsigned int index); void erase(const unsigned int index);
/** /**
* Evaluates an expression based on the list of variables provided. * Evaluates an expression based on the list of variables provided.
* A list of valid operations is retrievable from the getSupportedOperations static method. * A list of valid operations is retrievable from the getSupportedOperations static method.
...@@ -256,86 +367,6 @@ public: ...@@ -256,86 +367,6 @@ public:
*/ */
static shared_ptr<XdmfArray> evaluateOperation(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2, char operation); static shared_ptr<XdmfArray> evaluateOperation(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2, char operation);
/**
* Adds an operation to the list of viable operators.
*
* Example of Use:
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline prepend
* @skipline main
* @skipline addOperation
* @skipline return
* @until }
* @skipline prepend
* @until }
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline prepend
* @until val2.getSize
* @skipline return
* @skipline __main__
* @skipline addOperation
*
* @param newoperator the character to be associated with the provided binary operation
* @param functionref a pointer to the function to be associated with the provided operator
* @param priority used to determine order of operations the higher the value the earlier it is evaluated
*/
static int addOperation(char newoperator, shared_ptr<XdmfArray>(*functionref)(shared_ptr<XdmfArray>, shared_ptr<XdmfArray>), int priority);
/**
* Joins the two provided arrays together end to end.
*
* Example of Use:
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline valueArray1
* @until (6)
* @skipline chunk
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline valueArray1
* @until (6)
* @skipline chunk
*
* @param val1 the first array being evaluated
* @param val2 the second array being evaluated
* @return the arrays joined end to end
*/
static shared_ptr<XdmfArray> chunk(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2);
/**
* Joins the two provided arrays while interspercing their values evenly.
* Example of Use:
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline valueArray1
* @until (6)
* @skipline interlace
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline valueArray1
* @until (6)
* @skipline interlace
*
* @param val1 the first array being evaluated
* @param val2 the second array being evaluated
* @return the interlaced arrays
*/
static shared_ptr<XdmfArray> interlace(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2);
/** /**
* Evaluates the function specified using the vector of XdmfArrays provided. * Evaluates the function specified using the vector of XdmfArrays provided.
* None of the XdmfArrays provided are modified during the evaluation process. * None of the XdmfArrays provided are modified during the evaluation process.
...@@ -374,99 +405,6 @@ public: ...@@ -374,99 +405,6 @@ public:
*/ */
static shared_ptr<XdmfArray> evaluateFunction(std::vector<shared_ptr<XdmfArray> > valueVector, std::string functionName); static shared_ptr<XdmfArray> evaluateFunction(std::vector<shared_ptr<XdmfArray> > valueVector, std::string functionName);
/*
* adds a specified function to the list of functions used while evaluating strings
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline maximum
* @skipline main
* @skipline addFunction
* @skipline return
* @until }
* @skipline maximum
* @until else
* @skipline {
* @until returnArray;
* @skipline }
* @until }
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline maximum
* @until else
* @skipline maxVal
* @until pushBackAsFloat
* @skipline return
* @skipline __main__
* @skipline addFunction
*
* @param name A string to be associated with the provided function during string evaluation
* @param functionref A pointer to the function to be associated with the given string
* @return The total number of functions currently associated
*/
static int addFunction(std::string name, shared_ptr<XdmfArray>(*functionref)(std::vector<shared_ptr<XdmfArray> >));
/**
* Adds together all the values contained in the provided arrays.
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline valueArray1
* @until valueVector
* @skipline valueArray1
* @until valueArray2
* @skipline sum
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline valueArray1
* @until valueVector
* @skipline valueArray1
* @until valueArray2
* @skipline sum
*
* @param values a vector containing the arrays to be used
* @return an XdmfArray containing one value which is the total of all the values contained within the provided arrays
*/
static shared_ptr<XdmfArray> sum(std::vector<shared_ptr<XdmfArray> > values);
/**
* Averages the values contained in all the provided arrays.
*
* C++
*
* @dontinclude ExampleXdmfArray.cpp
* @skipline valueArray1
* @until valueVector
* @skipline valueArray1
* @until valueArray2
* @skipline ave
*
* Python
*
* @dontinclude XdmfExampleArray.py
* @skipline valueArray1
* @until valueVector
* @skipline valueArray1
* @until valueArray2
* @skipline ave
*
* @param values a vector containing the arrays to be used
* @return an XdmfArray containing one value which is the average of all values contained within the provided arrays
*/
static shared_ptr<XdmfArray> ave(std::vector<shared_ptr<XdmfArray> > values);
/** /**
* Get the data type of this array. * Get the data type of this array.
* *
...@@ -579,10 +517,6 @@ public: ...@@ -579,10 +517,6 @@ public:
*/ */
std::string getName() const; std::string getName() const;
/** /**
* Gets the priority of operation whose associated character is provided. Returns -1 if the operation is not supported. * Gets the priority of operation whose associated character is provided. Returns -1 if the operation is not supported.
* The higher the value the earlier that operation is evaluated during evaluateExpression. * The higher the value the earlier that operation is evaluated during evaluateExpression.
...@@ -604,12 +538,6 @@ public: ...@@ -604,12 +538,6 @@ public:
*/ */
static int getOperationPriority(char operation); static int getOperationPriority(char operation);
/** /**
* Get the number of values stored in this array. * Get the number of values stored in this array.
* *
...@@ -631,10 +559,6 @@ public: ...@@ -631,10 +559,6 @@ public:
*/ */
unsigned int getSize() const; unsigned int getSize() const;
/** /**
* Gets a string that contains all the characters of the supported operations. * Gets a string that contains all the characters of the supported operations.
* Parenthesis are included for grouping purposes in expressions. * Parenthesis are included for grouping purposes in expressions.
...@@ -677,47 +601,43 @@ public: ...@@ -677,47 +601,43 @@ public:
/** /**
* Gets a string that contains all strings that are viable for use when mapping * Gets a string that contains all strings that are viable for use when mapping
* to shared pointers of XdmfArrays for the evaluateExpression function. * to scalars (which are stored in XdmfArrays of size 1) for the evaluateExpression function.
* *
* Example of Use: * Example of Use:
* *
* C++ * C++
* *
* @dontinclude ExampleXdmfArray.cpp * @dontinclude ExampleXdmfArray.cpp
* @skipline getValidVariableChars * @skipline getValidDigitChars