[cig-commits] r14488 - seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/MODELS/3D/citcoms_isotropic_no_crust

tan2 at geodynamics.org tan2 at geodynamics.org
Fri Mar 27 11:59:10 PDT 2009


Author: tan2
Date: 2009-03-27 11:59:10 -0700 (Fri, 27 Mar 2009)
New Revision: 14488

Modified:
   seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/MODELS/3D/citcoms_isotropic_no_crust/read_citcoms_data.c
Log:
higher accuracy for inverse mapping


Modified: seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/MODELS/3D/citcoms_isotropic_no_crust/read_citcoms_data.c
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/MODELS/3D/citcoms_isotropic_no_crust/read_citcoms_data.c	2009-03-27 18:58:48 UTC (rev 14487)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/MODELS/3D/citcoms_isotropic_no_crust/read_citcoms_data.c	2009-03-27 18:59:10 UTC (rev 14488)
@@ -312,9 +312,11 @@
     double dist2;
     double coord[4][3];
     element_t *e = &model->elements[elem];
-    double accuracy = e->size2 * 1e-10;
     double xx[3];
 
+    const double accuracy = e->size2 * 1e-20;
+    const int max_iter = 1000;
+
     element2surfnodes(elem, corners);
 
     /* coordinates of the nodes on the unit sphere, ABCD */
@@ -363,13 +365,18 @@
 
         /* converged */
 	if(dist2 < accuracy) {
+            for(j=0; j<naxes; j++) {
+                /* eta must in the range of [-1, 1] */
+                eta[j] = (eta[j] > 1.0) ? 1.0 : eta[j];
+                eta[j] = (eta[j] < -1.0) ? -1.0 : eta[j];
+            }
             get_2d_shape_functions(shp12, eta);
             return;
         }
 
         count ++;
 
-    } while(count < 1000);
+    } while(count < max_iter);
 
     /* cannot converge */
     fprintf(stderr, "error: rank=%d %e eta=(%f %f) x0=(%.15e %.15e %.15e) xx=(%.15e %.15e %.15e)\n",



More information about the CIG-COMMITS mailing list