Changeset 25812


Ignore:
Timestamp:
12/02/20 20:36:14 (4 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added rank as a possible output, necessary for ESMF compliance

Location:
issm/trunk-jpl/src/c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r25771 r25812  
    38143814
    38153815        /*Get vertices coordinates*/
    3816         VertexCoordinatesx(&x,&y,&z,femmodel_vertices,false) ;
     3816        VertexCoordinatesx(&x,&y,&z,NULL,femmodel_vertices,false) ;
    38173817
    38183818        /*Get element vertices*/
     
    49714971
    49724972        /*recover lat,long and radius vectors from vertices: */
    4973         VertexCoordinatesx(&latitude,&longitude,&radius,this->vertices,spherical);
     4973        VertexCoordinatesx(&latitude,&longitude,&radius,NULL,this->vertices,spherical);
    49744974
    49754975        /* Green's function (1+k_2-h_2/g): checked against Glenn Milne's thesis Chapter 3 (eqs: 3.3-4, 3.10-11)
  • issm/trunk-jpl/src/c/classes/Vertex.cpp

    r25508 r25812  
    205205}
    206206/*}}}*/
    207 void       Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz, bool spherical){/*{{{*/
     207void       Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Vector<IssmDouble>* vrank,bool spherical){/*{{{*/
    208208
    209209        if(this->clone==true) return;
     
    218218                vy->SetValue(this->sid,this->longitude,INS_VAL);
    219219                vz->SetValue(this->sid,this->R,INS_VAL);
     220        }
     221        if(vrank){
     222                int rank=IssmComm::GetRank();
     223                vrank->SetValue(this->sid,rank,INS_VAL);
    220224        }
    221225
  • issm/trunk-jpl/src/c/classes/Vertex.h

    r25508 r25812  
    6161                int        Sid(void);
    6262                void       UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
    63                 void       VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,bool spherical=false);
     63                void       VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Vector<IssmDouble>* vrank,bool spherical=false);
    6464};
    6565
  • issm/trunk-jpl/src/c/cores/esa_core.cpp

    r25680 r25812  
    4444
    4545        /* recover coordinates of vertices: */
    46         VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical);
    47         VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices);
     46        VertexCoordinatesx(&latitude,&longitude,&radius,NULL,femmodel->vertices,spherical);
     47        VertexCoordinatesx(&xx,&yy,&zz,NULL,femmodel->vertices);
    4848
    4949        /*Figure out size of g-set deflection vector and allocate solution vector: */
  • issm/trunk-jpl/src/c/cores/gia_core.cpp

    r25680 r25812  
    4545
    4646                /*first, recover x and y vectors from vertices: */
    47                 VertexCoordinatesx(&x,&y,NULL,femmodel->vertices); //no need for z coordinate
     47                VertexCoordinatesx(&x,&y,NULL,NULL,femmodel->vertices); //no need for z coordinate
    4848
    4949                /*call the main module: */
  • issm/trunk-jpl/src/c/cores/sealevelchange_core.cpp

    r25763 r25812  
    392392
    393393        /*first, recover lat,long and radius vectors from vertices: */
    394         VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical);
    395         if(horiz) VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices);
     394        VertexCoordinatesx(&latitude,&longitude,&radius,NULL,femmodel->vertices,spherical);
     395        if(horiz) VertexCoordinatesx(&xx,&yy,&zz,NULL,femmodel->vertices);
    396396
    397397
     
    659659
    660660        /*retrieve geometric information: */
    661         VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical);
    662         VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices);
     661        VertexCoordinatesx(&latitude,&longitude,&radius,NULL,femmodel->vertices,spherical);
     662        VertexCoordinatesx(&xx,&yy,&zz,NULL,femmodel->vertices);
    663663
    664664        /*call the elastic main modlule:*/
  • issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.cpp

    r25554 r25812  
    99#include "../../toolkits/toolkits.h"
    1010
    11 void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz, Vertices* vertices,bool spherical) {
    12 
    13         /*output: */
    14         IssmDouble* x=NULL;
    15         IssmDouble* y=NULL;
    16         IssmDouble* z=NULL;
    17 
    18         Vector<IssmDouble>* vx=NULL;
    19         Vector<IssmDouble>* vy=NULL;
    20         Vector<IssmDouble>* vz=NULL;
    21 
    22         /*intermediary: */
    23         int  numberofvertices;
    24         int  i;
     11void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz,int** prank, Vertices* vertices,bool spherical) {
    2512
    2613        /*figure out how many vertices we have: */
    27         numberofvertices=vertices->NumberOfVertices();
     14        int numberofvertices=vertices->NumberOfVertices();
    2815
    29         vx=new Vector<IssmDouble>(numberofvertices);
    30         vy=new Vector<IssmDouble>(numberofvertices);
    31         vz=new Vector<IssmDouble>(numberofvertices);
     16        Vector<IssmDouble>* vx=new Vector<IssmDouble>(numberofvertices);
     17        Vector<IssmDouble>* vy=new Vector<IssmDouble>(numberofvertices);
     18        Vector<IssmDouble>* vz=new Vector<IssmDouble>(numberofvertices);
     19        Vector<IssmDouble>* vrank=NULL;
     20        if(prank) vrank = new Vector<IssmDouble>(numberofvertices);
    3221
    3322        /*march through our vertices: */
    3423        for(Object* & object : vertices->objects){
    3524                Vertex* vertex=(Vertex*)object;
    36                 vertex->VertexCoordinates(vx,vy,vz,spherical);
     25                vertex->VertexCoordinates(vx,vy,vz,vrank,spherical);
    3726        }
    3827
     
    4130        vy->Assemble();
    4231        vz->Assemble();
     32        if(prank) vrank->Assemble();
    4333
    4434        /*serialize: */
    45         x=vx->ToMPISerial();
    46         y=vy->ToMPISerial();
    47         z=vz->ToMPISerial();
     35        IssmDouble* x=vx->ToMPISerial();
     36        IssmDouble* y=vy->ToMPISerial();
     37        IssmDouble* z=vz->ToMPISerial();
     38        IssmDouble* rank = NULL;
     39        if(prank) rank = vrank->ToMPISerial();
    4840
    4941        /*Free ressources: */
     
    5143        delete vy;
    5244        delete vz;
     45        delete vrank;
    5346
    5447        /*output: */
    55         if (px)*px=x;
     48        if(px) *px=x;
    5649        else xDelete<IssmDouble>(x);
    57         if (py)*py=y;
     50        if(py) *py=y;
    5851        else xDelete<IssmDouble>(y);
    59         if (pz)*pz=z;
     52        if(pz) *pz=z;
    6053        else xDelete<IssmDouble>(z);
     54        if(prank) *prank=rank;
     55        else xDelete<IssmDouble>(rank);
    6156}
  • issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.h

    r19984 r25812  
    88
    99/* local prototypes: */
    10 void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz, Vertices* vertices,bool spherical=false);
     10void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz,int** prank,Vertices* vertices,bool spherical=false);
    1111
    1212#endif  /* _VERTEX_COORDINATESX_H */
Note: See TracChangeset for help on using the changeset viewer.