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

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

preparing oecreview for 13393-13976'

File size: 1.6 KB
  • ../trunk-jpl/src/c/Container/Elements.cpp

     
    293293        delete patch;
    294294}
    295295/*}}}*/
     296/*FUNCTION Elements::MaxNumNodes{{{*/
     297int Elements::MaxNumNodes(void){
     298
     299        int max=0;
     300        int allmax;
     301        int numnodes=0;
     302
     303        /*Now go through all elements, and get how many nodes they own, unless they are clone nodes: */
     304        for(int i=0;i<this->Size();i++){
     305
     306                Element* element=dynamic_cast<Element*>(this->GetObjectByOffset(i));
     307                numnodes=element->GetNumberOfNodes();
     308                if(numnodes>max)max=numnodes;
     309        }
     310
     311        /*Grab max of all cpus: */
     312        #ifdef _HAVE_MPI_
     313        MPI_Allreduce((void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,IssmComm::GetComm());
     314        max=allmax;
     315        #endif
     316
     317        return max;
     318}
     319/*}}}*/
    296320/*FUNCTION Elements::NumberOfElements{{{*/
    297321int Elements::NumberOfElements(void){
    298322
  • ../trunk-jpl/src/c/Container/Elements.h

     
    2626                /*numerics*/
    2727                void   Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
    2828                void   DeleteResults(void);
     29                int    MaxNumNodes(void);
    2930                void   ProcessResultsUnits(void);
    3031                void   SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
    3132                void   ToResults(Results* results,Parameters* parameters);
Note: See TracBrowser for help on using the repository browser.