Index: /issm/trunk-jpl/src/c/Container/Elements.cpp
===================================================================
--- /issm/trunk-jpl/src/c/Container/Elements.cpp	(revision 13886)
+++ /issm/trunk-jpl/src/c/Container/Elements.cpp	(revision 13887)
@@ -294,4 +294,28 @@
 }
 /*}}}*/
+/*FUNCTION Elements::MaxNumNodes{{{*/
+int Elements::MaxNumNodes(void){
+
+	int max=0;
+	int allmax;
+	int numnodes=0;
+
+	/*Now go through all elements, and get how many nodes they own, unless they are clone nodes: */
+	for(int i=0;i<this->Size();i++){
+
+		Element* element=dynamic_cast<Element*>(this->GetObjectByOffset(i));
+		numnodes=element->GetNumberOfNodes();
+		if(numnodes>max)max=numnodes;
+	}
+
+	/*Grab max of all cpus: */
+	#ifdef _HAVE_MPI_
+	MPI_Allreduce((void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,IssmComm::GetComm());
+	max=allmax;
+	#endif
+
+	return max;
+}
+/*}}}*/
 /*FUNCTION Elements::NumberOfElements{{{*/
 int Elements::NumberOfElements(void){
Index: /issm/trunk-jpl/src/c/Container/Elements.h
===================================================================
--- /issm/trunk-jpl/src/c/Container/Elements.h	(revision 13886)
+++ /issm/trunk-jpl/src/c/Container/Elements.h	(revision 13887)
@@ -27,4 +27,5 @@
 		void   Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
 		void   DeleteResults(void);
+		int    MaxNumNodes(void);
 		void   ProcessResultsUnits(void);
 		void   SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
