source:
issm/oecreview/Archive/16554-17801/ISSM-17704-17705.diff@
17802
Last change on this file since 17802 was 17802, checked in by , 11 years ago | |
---|---|
File size: 2.8 KB |
-
../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
63 63 IssmDouble* serial_vertexgrounded = NULL; 64 64 IssmDouble* serial_vertexfloating = NULL; 65 65 IssmDouble* phi = NULL; 66 int index;67 int* dof=NULL;68 IssmDouble* xyz_list=NULL;69 66 70 67 /*Initialize vector with number of vertices*/ 71 int numberofvertices = vertices->NumberOfVertices(); 72 vertexgrounded = new Vector<IssmDouble>(numberofvertices); 73 vertexfloating = new Vector<IssmDouble>(numberofvertices); 74 phi = xNew<IssmDouble>(numberofvertices); 75 IssmDouble x[numberofvertices]; 76 77 /*Get x coordinate for each vertex*/ 78 for(int i = 0;i<elements->Size();i++){ 79 Element* element = dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 80 element->GetVerticesCoordinates(&xyz_list); 81 element->GetDofList(&dof,FSvelocityEnum,GsetEnum); 82 for (int j=0;j<3;j++) x[dof[j]]=xyz_list[3*j]; 83 } 68 int numberofvertices = vertices->NumberOfVertices(); 69 vertexgrounded = new Vector<IssmDouble>(numberofvertices); 70 vertexfloating = new Vector<IssmDouble>(numberofvertices); 71 phi = xNew<IssmDouble>(numberofvertices); 84 72 85 73 /*Fill vector vertices_potentially_floating: */ 86 for(int i =0;i<elements->Size();i++){74 for(int i=0;i<elements->Size();i++){ 87 75 Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 88 76 element->FSContactMigration(vertexgrounded,vertexfloating); 89 77 } … … 91 79 /*Assemble vector and serialize */ 92 80 vertexgrounded->Assemble(); 93 81 vertexfloating->Assemble(); 94 serial_vertexgrounded =vertexgrounded->ToMPISerial();95 serial_vertexfloating =vertexfloating->ToMPISerial();82 serial_vertexgrounded=vertexgrounded->ToMPISerial(); 83 serial_vertexfloating=vertexfloating->ToMPISerial(); 96 84 97 /*find vert exon GL */98 for(int i =0;i<numberofvertices;i++){85 /*find vertices on GL */ 86 for(int i=0;i<numberofvertices;i++){ 99 87 if(serial_vertexgrounded[i]==1. && serial_vertexfloating[i]==1.){ 100 phi[i] = 0.; 101 index = i; 88 phi[i]=0.; 102 89 } 103 } 104 105 /*assign value for phi, grounded if >0*/ 106 for(int i = 0;i<numberofvertices;i++){ 107 if (x[i] < x[index]) { 108 phi[i] = 1.; 90 else if(serial_vertexgrounded[i]==1.){ 91 phi[i]=1.; 109 92 } 110 else if (x[i] > x[index]){111 phi[i] =-1.;93 else if(serial_vertexfloating[i]==1.){ 94 phi[i]=-1.; 112 95 } 113 else if (x[i]==x[index]){114 phi[i] = 0;96 else{ 97 _error_("not supported (vertexfloating="<<serial_vertexfloating[i]<<" vertexgrounded="<<serial_vertexgrounded[i]<<")"); 115 98 } 116 99 } 117 100
Note:
See TracBrowser
for help on using the repository browser.