Changeset 11242
- Timestamp:
- 01/29/12 20:04:20 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
r11197 r11242 12 12 int UpdateVertexPositionsx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){ 13 13 14 int i; 15 Vertex* vertex=NULL; 16 double* thickness=NULL; 17 double* bed=NULL; 14 int i; 15 Vec vz = NULL; 16 Vertex *vertex = NULL; 17 double *thickness = NULL; 18 double *bed = NULL; 18 19 19 20 /*get vertex vectors for bed and thickness: */ 20 GetVectorFromInputsx( &thickness,elements,nodes, vertices, loads, materials, parameters, ThicknessEnum,VertexEnum); 21 GetVectorFromInputsx( &bed ,elements,nodes, vertices, loads, materials, parameters, BedEnum, VertexEnum); 21 GetVectorFromInputsx(&thickness,elements,nodes, vertices, loads, materials, parameters, ThicknessEnum,VertexEnum); 22 GetVectorFromInputsx(&bed ,elements,nodes, vertices, loads, materials, parameters, BedEnum, VertexEnum); 23 24 /*Allocate vector*/ 25 vz=NewVec(vertices->NumberOfVertices()); 22 26 23 27 /*Update verices new geometry: */ 24 28 for (i=0;i<vertices->Size();i++){ 25 29 vertex=(Vertex*)vertices->GetObjectByOffset(i); 26 vertex->UpdatePosition( thickness,bed);30 vertex->UpdatePosition(vz,parameters,thickness,bed); 27 31 } 32 33 /*Assemble mesh velocity*/ 34 VecAssemblyBegin(vz); 35 VecAssemblyEnd(vz); 28 36 29 37 /*Free ressources:*/ 30 38 xfree((void**)&thickness); 31 39 xfree((void**)&bed); 40 VecFree(&vz); 32 41 return 1; 33 42 } -
issm/trunk-jpl/src/c/objects/Vertex.cpp
r11236 r11242 71 71 printf(" z: %g\n",z); 72 72 printf(" sigma: %g\n",sigma); 73 printf(" connectivity: % g\n",connectivity);73 printf(" connectivity: %i\n",connectivity); 74 74 printf(" dof: %i\n",dof); 75 75 printf(" clone: %i\n",clone); … … 273 273 /*}}}*/ 274 274 /*FUNCTION Vertex::UpdateVertexPosition {{{1*/ 275 void Vertex::UpdatePosition(double* thickness,double* bed){ 275 void Vertex::UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed){ 276 277 double oldz,newz; 278 double dt,velz; 279 280 /*Get time stepping*/ 281 parameters->FindParam(&dt,TimesteppingTimeStepEnum); 276 282 277 283 /*sigma remains constant. z=bed+sigma*thickness*/ 278 this->z=bed[this->dof]+sigma*thickness[this->dof]; 279 280 } 281 /*}}}*/ 284 oldz = this->z; 285 newz = bed[this->dof]+sigma*thickness[this->dof]; 286 velz = (newz-oldz)/dt; 287 this->z = newz; 288 289 /*put vz in vector*/ 290 VecSetValue(vz,this->Sid(),velz,INSERT_VALUES); 291 } 292 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Vertex.h
r11001 r11242 63 63 int Sid(void); 64 64 int Connectivity(void); 65 void UpdatePosition( double* thickness,double* bed);65 void UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed); 66 66 /*}}}*/ 67 67 };
Note:
See TracChangeset
for help on using the changeset viewer.