Changeset 3884
- Timestamp:
- 05/21/10 13:39:55 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Loads/Numericalflux.cpp
r3784 r3884 63 63 int num_nodes; 64 64 int num_elems; 65 bool isinternal; 65 66 66 67 /*numericalflux constructor data: */ … … 73 74 numericalflux_mparid=iomodel->numberofelements+1; //matlab indexing 74 75 75 /*Get left and right elements*/ 76 e1=(int)iomodel->edges[4*i+2]; //edges are [node1 node2 elem1 elem2] 77 e2=(int)iomodel->edges[4*i+3]; //edges are [node1 node2 elem1 elem2] 78 if (isnan(e2)){ 76 /*First, see wether this is an internal or boundary edge (if e2=NaN)*/ 77 if (isnan((double)iomodel->edges[4*i+3])){ //edges are [node1 node2 elem1 elem2] 79 78 /* Boundary edge, only one element */ 79 e1=(int)iomodel->edges[4*i+2]; 80 e2=(int)UNDEF; 80 81 num_elems=1; 81 82 num_nodes=2; … … 85 86 else{ 86 87 /* internal edge: connected to 2 elements */ 88 e1=(int)iomodel->edges[4*i+2]; 89 e2=(int)iomodel->edges[4*i+3]; 87 90 num_elems=2; 88 91 num_nodes=4; … … 103 106 pos1=pos2=UNDEF; 104 107 for(j=0;j<3;j++){ 105 if (iomodel->elements[3*( int)e1+j]==i1) pos1=j+1;106 if (iomodel->elements[3*( int)e2+j]==i1) pos2=j+1;108 if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1; 109 if (iomodel->elements[3*(e2-1)+j]==i1) pos2=j+1; 107 110 } 108 111 ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF); … … 110 113 /*3: We have the id of the elements and the position of the vertices in the index 111 114 * we can compute their dofs!*/ 112 numericalflux_node_ids[0]=3*( int)e1+pos1; //ex: 1 2 3113 numericalflux_node_ids[1]=3*( int)e1+(pos1%3)+1; //ex: 2 3 1114 numericalflux_node_ids[2]=3*( int)e2+pos2; //ex: 1 2 3115 numericalflux_node_ids[3]=3*( int)e2+((pos2+1)%3)+1; //ex: 3 1 2115 numericalflux_node_ids[0]=3*(e1-1)+pos1; //ex: 1 2 3 116 numericalflux_node_ids[1]=3*(e1-1)+(pos1%3)+1; //ex: 2 3 1 117 numericalflux_node_ids[2]=3*(e2-1)+pos2; //ex: 1 2 3 118 numericalflux_node_ids[3]=3*(e2-1)+((pos2+1)%3)+1; //ex: 3 1 2 116 119 } 117 120 else{ … … 120 123 pos1==UNDEF; 121 124 for(j=0;j<3;j++){ 122 if (iomodel->elements[3*( int)e1+j]==i1) pos1=j+1;125 if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1; 123 126 } 124 127 ISSMASSERT(pos1!=UNDEF); … … 126 129 /*3: We have the id of the elements and the position of the vertices in the index 127 130 * we can compute their dofs!*/ 128 numericalflux_node_ids[0]=3*(int)e1+pos1; 129 numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1; 130 131 numericalflux_node_ids[0]=3*(e1-1)+pos1; 132 numericalflux_node_ids[1]=3*(e1-1)+(pos1%3)+1; 131 133 } 132 134
Note:
See TracChangeset
for help on using the changeset viewer.