[cig-commits] r13855 - in long/3D/Gale/trunk: . src/Underworld/plugins/EulerDeform
walter at geodynamics.org
walter at geodynamics.org
Mon Jan 12 16:03:41 PST 2009
Author: walter
Date: 2009-01-12 16:03:40 -0800 (Mon, 12 Jan 2009)
New Revision: 13855
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c
Log:
r2451 at dante: boo | 2009-01-12 12:45:24 -0800
Awful hack to make EulerDeform reset the x coordinate of the top right, but interpolate the height. Only works if the boz is of length=2
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2450
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2451
Modified: long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c 2009-01-13 00:03:38 UTC (rev 13854)
+++ long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c 2009-01-13 00:03:40 UTC (rev 13855)
@@ -703,6 +703,32 @@
memcpy( sys->mesh->verts[inds[ind_i]], sys->sideCoords[ind_i], nDims * sizeof(double) );
FreeObject( tmpIndSet );
FreeArray( sys->sideCoords );
+
+
+ if(sys->wrapTop)
+ {
+ if(sys->staticRight)
+ {
+ double x0,y0,x1,y1;
+ double x_fixed, delta;
+ int nn=Mesh_GetLocalSize( sys->mesh, MT_VERTEX )-1;
+ x_fixed=2.0;
+
+ x0=sys->mesh->verts[nn-1][0];
+ y0=sys->mesh->verts[nn-1][1];
+ x1=sys->mesh->verts[nn][0];
+ y1=sys->mesh->verts[nn][1];
+
+ sys->mesh->verts[nn][0]=x_fixed;
+ delta=(x1-x_fixed)/(x1-x0);
+ sys->mesh->verts[nn][1]=y0*delta + y1*(1-delta);
+
+ printf("Remesh %d %g %g %g %g %g %g %g\n",
+ nn,x0,y0,x1,y1,x_fixed,delta,
+ sys->mesh->verts[nn][1]);
+ }
+ }
+
}
/* Every system should synchronise the mesh coordinates. */
@@ -981,7 +1007,8 @@
nLocalNodes = Mesh_GetLocalSize( mesh, MT_VERTEX );
/* Skip corners. */
- if( ijk[0] == 0 || ijk[0] == grm->sizes[0] - 1 ) {
+ if( ijk[0] == 0 ) {
+/* if( ijk[0] == 0 || ijk[0] == grm->sizes[0] - 1 ) { */
return;
}
@@ -1002,12 +1029,17 @@
memcpy( crds[0], oldCrds[ind], nDims * sizeof(double) );
memcpy( crds[1], oldCrd, nDims * sizeof(double) );
}
- else {
+ else if( newCrd[0] > oldCrd[0] ) {
ijk[0]++; ind = Grid_Project( grm, ijk ); ijk[0]--;
insist( Mesh_GlobalToDomain( mesh, MT_VERTEX, ind, &ind ) );
memcpy( crds[1], oldCrds[ind], nDims * sizeof(double) );
memcpy( crds[0], oldCrd, nDims * sizeof(double) );
}
+ else {
+ insist( Mesh_GlobalToDomain( mesh, MT_VERTEX, ind, &ind ) );
+ memcpy( crds[1], oldCrds[ind], nDims * sizeof(double) );
+ memcpy( crds[0], oldCrd, nDims * sizeof(double) );
+ }
/* Interpolate. */
#ifndef NDEBUG
More information about the CIG-COMMITS
mailing list