Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp =================================================================== --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp (revision 12085) +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp (revision 12086) @@ -46,10 +46,9 @@ segments=*psegments; segmentmarkerlist=*psegmentmarkerlist; - /*Establish list of segments that belong to a rift: */ - RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments); /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element, - first node and second snode)*/ + /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element,first node and second snode)*/ + RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments); /*Go through all nodes of the rift segments, and start splitting the mesh: */ flags=(int*)xcalloc(nods,sizeof(int)); //to make sure we don't split the same nodes twice! @@ -69,9 +68,13 @@ DetermineGridElementListOnOneSideOfRift(&NumGridElementListOnOneSideOfRift,&GridElementListOnOneSideOfRift,i,nriftsegs,riftsegments,node,index,nel); - /*Summary: we have for node, a list of elements (GridElementListOnOneSideOfRift, of size NumGridElementListOnOneSideOfRift) that all contain node - *and that are on the same side of the rift. For all these elements, we clone node into another node, and we swap all instances of node in the triangulation - *for those elements, to the new node.*/ + /*Summary: we have for node, a list of elements + * (GridElementListOnOneSideOfRift, of size + * NumGridElementListOnOneSideOfRift) that all contain node + *and that are on the same side of the rift. For all these + elements, we clone node into another node, and we swap all + instances of node in the triangulation *for those elements, to the + new node.*/ //augment number of nodes nods=nods+1; Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp =================================================================== --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp (revision 12085) +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp (revision 12086) @@ -277,13 +277,13 @@ *we can only rely on the position (x,y) of the rift nodes to create a segment:*/ for (k=0;k<3;k++){ if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){ - *(segments+3*j+0)=*(index+el1*3+k); _assert_(segments[3*j+0]0 && node4>0); + if ((x[node1-1]==x[node4-1]) && (y[node1-1]==y[node4-1])){ /*Swap node3 and node4:*/ temp_node=node3; node3=node4;