source: issm/oecreview/Archive/13393-13976/ISSM-13886-13887.diff@ 21726

Last change on this file since 21726 was 13980, checked in by Mathieu Morlighem, 12 years ago

preparing oecreview for 13393-13976'

File size: 1.6 KB
RevLine 
[13980]1Index: ../trunk-jpl/src/c/Container/Elements.cpp
2===================================================================
3--- ../trunk-jpl/src/c/Container/Elements.cpp (revision 13886)
4+++ ../trunk-jpl/src/c/Container/Elements.cpp (revision 13887)
5@@ -293,6 +293,30 @@
6 delete patch;
7 }
8 /*}}}*/
9+/*FUNCTION Elements::MaxNumNodes{{{*/
10+int Elements::MaxNumNodes(void){
11+
12+ int max=0;
13+ int allmax;
14+ int numnodes=0;
15+
16+ /*Now go through all elements, and get how many nodes they own, unless they are clone nodes: */
17+ for(int i=0;i<this->Size();i++){
18+
19+ Element* element=dynamic_cast<Element*>(this->GetObjectByOffset(i));
20+ numnodes=element->GetNumberOfNodes();
21+ if(numnodes>max)max=numnodes;
22+ }
23+
24+ /*Grab max of all cpus: */
25+ #ifdef _HAVE_MPI_
26+ MPI_Allreduce((void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,IssmComm::GetComm());
27+ max=allmax;
28+ #endif
29+
30+ return max;
31+}
32+/*}}}*/
33 /*FUNCTION Elements::NumberOfElements{{{*/
34 int Elements::NumberOfElements(void){
35
36Index: ../trunk-jpl/src/c/Container/Elements.h
37===================================================================
38--- ../trunk-jpl/src/c/Container/Elements.h (revision 13886)
39+++ ../trunk-jpl/src/c/Container/Elements.h (revision 13887)
40@@ -26,6 +26,7 @@
41 /*numerics*/
42 void Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
43 void DeleteResults(void);
44+ int MaxNumNodes(void);
45 void ProcessResultsUnits(void);
46 void SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
47 void ToResults(Results* results,Parameters* parameters);
Note: See TracBrowser for help on using the repository browser.