Changeset 25812
- Timestamp:
- 12/02/20 20:36:14 (4 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r25771 r25812 3814 3814 3815 3815 /*Get vertices coordinates*/ 3816 VertexCoordinatesx(&x,&y,&z, femmodel_vertices,false) ;3816 VertexCoordinatesx(&x,&y,&z,NULL,femmodel_vertices,false) ; 3817 3817 3818 3818 /*Get element vertices*/ … … 4971 4971 4972 4972 /*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); 4974 4974 4975 4975 /* 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 205 205 } 206 206 /*}}}*/ 207 void Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz, 207 void Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Vector<IssmDouble>* vrank,bool spherical){/*{{{*/ 208 208 209 209 if(this->clone==true) return; … … 218 218 vy->SetValue(this->sid,this->longitude,INS_VAL); 219 219 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); 220 224 } 221 225 -
issm/trunk-jpl/src/c/classes/Vertex.h
r25508 r25812 61 61 int Sid(void); 62 62 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); 64 64 }; 65 65 -
issm/trunk-jpl/src/c/cores/esa_core.cpp
r25680 r25812 44 44 45 45 /* 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); 48 48 49 49 /*Figure out size of g-set deflection vector and allocate solution vector: */ -
issm/trunk-jpl/src/c/cores/gia_core.cpp
r25680 r25812 45 45 46 46 /*first, recover x and y vectors from vertices: */ 47 VertexCoordinatesx(&x,&y,NULL, femmodel->vertices); //no need for z coordinate47 VertexCoordinatesx(&x,&y,NULL,NULL,femmodel->vertices); //no need for z coordinate 48 48 49 49 /*call the main module: */ -
issm/trunk-jpl/src/c/cores/sealevelchange_core.cpp
r25763 r25812 392 392 393 393 /*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); 396 396 397 397 … … 659 659 660 660 /*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); 663 663 664 664 /*call the elastic main modlule:*/ -
issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.cpp
r25554 r25812 9 9 #include "../../toolkits/toolkits.h" 10 10 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; 11 void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz,int** prank, Vertices* vertices,bool spherical) { 25 12 26 13 /*figure out how many vertices we have: */ 27 numberofvertices=vertices->NumberOfVertices();14 int numberofvertices=vertices->NumberOfVertices(); 28 15 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); 32 21 33 22 /*march through our vertices: */ 34 23 for(Object* & object : vertices->objects){ 35 24 Vertex* vertex=(Vertex*)object; 36 vertex->VertexCoordinates(vx,vy,vz, spherical);25 vertex->VertexCoordinates(vx,vy,vz,vrank,spherical); 37 26 } 38 27 … … 41 30 vy->Assemble(); 42 31 vz->Assemble(); 32 if(prank) vrank->Assemble(); 43 33 44 34 /*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(); 48 40 49 41 /*Free ressources: */ … … 51 43 delete vy; 52 44 delete vz; 45 delete vrank; 53 46 54 47 /*output: */ 55 if (px)*px=x;48 if(px) *px=x; 56 49 else xDelete<IssmDouble>(x); 57 if (py)*py=y;50 if(py) *py=y; 58 51 else xDelete<IssmDouble>(y); 59 if (pz)*pz=z;52 if(pz) *pz=z; 60 53 else xDelete<IssmDouble>(z); 54 if(prank) *prank=rank; 55 else xDelete<IssmDouble>(rank); 61 56 } -
issm/trunk-jpl/src/c/modules/VertexCoordinatesx/VertexCoordinatesx.h
r19984 r25812 8 8 9 9 /* local prototypes: */ 10 void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz, 10 void VertexCoordinatesx( IssmDouble** px, IssmDouble** py, IssmDouble** pz,int** prank,Vertices* vertices,bool spherical=false); 11 11 12 12 #endif /* _VERTEX_COORDINATESX_H */
Note:
See TracChangeset
for help on using the changeset viewer.