Skip to content

Commit 721c079

Browse files
authored
Merge pull request #313 from LLNL/feature/bassett4/nodelist-index
Added NodeList index to DataBase
2 parents e282594 + 3de3310 commit 721c079

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

src/DataBase/DataBase.cc

+14
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,20 @@ haveNodeList(const NodeList<Dimension>& nodeList) const {
840840
return itr != nodeListEnd();
841841
}
842842

843+
//------------------------------------------------------------------------------
844+
// Get the NodeList index for the given NodeList
845+
//------------------------------------------------------------------------------
846+
template<typename Dimension>
847+
int
848+
DataBase<Dimension>::
849+
nodeListIndex(const NodeList<Dimension>& nodeList) const {
850+
ConstNodeListIterator itr = find(nodeListBegin(),
851+
nodeListEnd(),
852+
&nodeList);
853+
VERIFY(itr != nodeListEnd());
854+
return std::distance(nodeListBegin(), itr);
855+
}
856+
843857
//------------------------------------------------------------------------------
844858
// Return the const list of NodeList pointers.
845859
//------------------------------------------------------------------------------

src/DataBase/DataBase.hh

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public:
198198
void deleteNodeList(NodeList<Dimension>& nodeList);
199199

200200
bool haveNodeList(const NodeList<Dimension>& nodeList) const;
201+
int nodeListIndex(const NodeList<Dimension>& nodeList) const;
201202

202203
// Allow const access to the list of NodeList pointers.
203204
const std::vector<NodeList<Dimension>*>& nodeListPtrs() const;

src/Distributed/fakempi.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
MIN = -1
88
MAX = -2
99
SUM = -3
10+
MINLOC = -4
11+
MAXLOC = -5
1012

1113
def is_fake_mpi():
1214
return True

src/Distributed/mpi_mpi4py.py

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
MIN = MPI.MIN
3030
MAX = MPI.MAX
3131
SUM = MPI.SUM
32+
MINLOC = MPI.MINLOC
33+
MAXLOC = MPI.MAXLOC
3234

3335
#-------------------------------------------------------------------------------
3436
# Prepare files to keep the stdout and stderr streams in.

0 commit comments

Comments
 (0)