[cig-commits] r5888 - in mc/3D/CitcomS/branches/compressible: CitcomS/Components/Advection_diffusion CitcomS/Solver bin lib module

tan2 at geodynamics.org tan2 at geodynamics.org
Wed Jan 24 17:45:21 PST 2007


Author: tan2
Date: 2007-01-24 17:45:20 -0800 (Wed, 24 Jan 2007)
New Revision: 5888

Modified:
   mc/3D/CitcomS/branches/compressible/CitcomS/Components/Advection_diffusion/Advection_diffusion.py
   mc/3D/CitcomS/branches/compressible/CitcomS/Solver/Solver.py
   mc/3D/CitcomS/branches/compressible/bin/Citcom.c
   mc/3D/CitcomS/branches/compressible/lib/Advection_diffusion.c
   mc/3D/CitcomS/branches/compressible/lib/Convection.c
   mc/3D/CitcomS/branches/compressible/lib/Full_geometry_cartesian.c
   mc/3D/CitcomS/branches/compressible/lib/Instructions.c
   mc/3D/CitcomS/branches/compressible/lib/Regional_geometry_cartesian.c
   mc/3D/CitcomS/branches/compressible/lib/Solver_multigrid.c
   mc/3D/CitcomS/branches/compressible/lib/global_defs.h
   mc/3D/CitcomS/branches/compressible/module/advdiffu.c
   mc/3D/CitcomS/branches/compressible/module/mesher.c
   mc/3D/CitcomS/branches/compressible/module/setProperties.c
Log:
Porting r5886-5887 from trunk

Modified: mc/3D/CitcomS/branches/compressible/CitcomS/Components/Advection_diffusion/Advection_diffusion.py
===================================================================
--- mc/3D/CitcomS/branches/compressible/CitcomS/Components/Advection_diffusion/Advection_diffusion.py	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/CitcomS/Components/Advection_diffusion/Advection_diffusion.py	2007-01-25 01:45:20 UTC (rev 5888)
@@ -54,7 +54,6 @@
     def setup(self):
         from CitcomSLib import set_convection_defaults
         set_convection_defaults(self.all_variables)
-	self._been_here = False
 	return
 
 

Modified: mc/3D/CitcomS/branches/compressible/CitcomS/Solver/Solver.py
===================================================================
--- mc/3D/CitcomS/branches/compressible/CitcomS/Solver/Solver.py	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/CitcomS/Solver/Solver.py	2007-01-25 01:45:20 UTC (rev 5888)
@@ -93,8 +93,8 @@
         inv.tracer.initialize(all_variables)
         inv.visc.initialize(all_variables)
 
+        set_signal()
         global_default_values(self.all_variables)
-        set_signal()
 
         from CitcomSLib import return_rank, return_pid
         rank = return_rank(self.all_variables)

Modified: mc/3D/CitcomS/branches/compressible/bin/Citcom.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/bin/Citcom.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/bin/Citcom.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -58,6 +58,7 @@
   void read_mat_from_file();
   void open_time();
   void output_finalize();
+  void PG_timestep_init();
 
   float dot();
   float cpu_time_on_vp_it;
@@ -77,7 +78,7 @@
 
   world = MPI_COMM_WORLD;
   E = citcom_init(&world);             /* allocate global E and do initializaion here */
-  
+
   solver_init(E);
 
   start_time = time = CPU_time0();
@@ -120,13 +121,22 @@
     parallel_process_termination();
   }
 
+  (E->next_buoyancy_field_init)(E);
+
   while ( E->control.keep_going   &&  (Emergency_stop == 0) )   {
+
+    /* The next few lines of code were replaced by
+     * pyCitcom_PG_timestep_solve() in Pyre version.
+     * If you modify here, make sure its Pyre counterpart
+     * is modified as well */
     E->monitor.solution_cycles++;
     if(E->monitor.solution_cycles>E->control.print_convergence)
       E->control.print_convergence=1;
 
     (E->next_buoyancy_field)(E);
+    /* */
 
+
     if(((E->advection.total_timesteps < E->advection.max_total_timesteps) &&
 	(E->advection.timesteps < E->advection.max_timesteps)) ||
        (E->advection.total_timesteps < E->advection.min_timesteps) )

Modified: mc/3D/CitcomS/branches/compressible/lib/Advection_diffusion.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Advection_diffusion.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/Advection_diffusion.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -181,15 +181,6 @@
     /* Set intial values, defaults & read parameters*/
     int m=E->parallel.me;
 
-    E->advection.temp_iterations = 2; /* petrov-galerkin iterations: minimum value. */
-    E->advection.total_timesteps = 1;
-    E->advection.sub_iterations = 1;
-    E->advection.last_sub_iterations = 1;
-    E->advection.gamma = 0.5;
-    E->advection.dt_reduced = 1.0;
-
-    E->monitor.T_maxvaried = 1.05;
-
     input_boolean("ADV",&(E->advection.ADVECTION),"on",m);
 
     input_int("minstep",&(E->advection.min_timesteps),"1",m);
@@ -228,12 +219,6 @@
 
 void PG_timestep(struct All_variables *E)
 {
-  static int been_here = 0;
-
-  if (been_here++ ==0)    {
-    PG_timestep_init(E);
-  }
-
   std_timestep(E);
 
   PG_timestep_solve(E);

Modified: mc/3D/CitcomS/branches/compressible/lib/Convection.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Convection.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/Convection.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -1,6 +1,6 @@
 /*
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * 
+ *
  *<LicenseText>
  *
  * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *</LicenseText>
- * 
+ *
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 /* Assumes parameter list is opened and reads the things it needs.
@@ -39,8 +39,8 @@
 void set_convection_defaults(E)
      struct All_variables *E;
 {
-    void PG_timestep_with_melting();
     void PG_timestep();
+    void PG_timestep_init();
     void read_convection_settings();
     void convection_derived_values();
     void convection_allocate_memory();
@@ -48,7 +48,17 @@
     void convection_initial_fields();
     void twiddle_thumbs();
 
+    E->advection.temp_iterations = 2; /* petrov-galerkin iterations: minimum value. */
+    E->advection.total_timesteps = 1;
+    E->advection.sub_iterations = 1;
+    E->advection.last_sub_iterations = 1;
+    E->advection.gamma = 0.5;
+    E->advection.dt_reduced = 1.0;
+
+    E->monitor.T_maxvaried = 1.05;
+
     E->next_buoyancy_field = PG_timestep;
+    E->next_buoyancy_field_init = PG_timestep_init;
     E->special_process_new_buoyancy = twiddle_thumbs;
     E->problem_settings = read_convection_settings;
     E->problem_derived_values = convection_derived_values;
@@ -58,11 +68,6 @@
     E->problem_update_node_positions = twiddle_thumbs;
     E->problem_update_bcs = twiddle_thumbs;
 
-/*     sprintf(E->control.which_data_files,"Temp,Strf,Pres"); */
-/*     sprintf(E->control.which_horiz_averages,"Temp,Visc,Vrms"); */
-/*     sprintf(E->control.which_running_data,"Step,Time,"); */
-/*     sprintf(E->control.which_observable_data,"Shfl"); */
-
     return;
 }
 

Modified: mc/3D/CitcomS/branches/compressible/lib/Full_geometry_cartesian.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Full_geometry_cartesian.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/Full_geometry_cartesian.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -1,6 +1,6 @@
 /*
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * 
+ *
  *<LicenseText>
  *
  * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *</LicenseText>
- * 
+ *
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 #include <math.h>
@@ -33,38 +33,51 @@
 
 void full_set_2dc_defaults(E)
      struct All_variables *E;
-{ 
+{
 
   E->mesh.nsd = 2;
   E->mesh.dof = 2;
-  
+
 }
 
 
-void full_set_2pt5dc_defaults(E)  
+void full_set_2pt5dc_defaults(E)
     struct All_variables *E;
-{ 
+{
 
   E->mesh.nsd = 2;
   E->mesh.dof = 3;
- 
+
 }
 
 void full_set_3dc_defaults(E)
      struct All_variables *E;
-{ 
+{
 
   E->mesh.nsd = 3;
   E->mesh.dof = 3;
- 
+
 }
 
 void full_set_3dsphere_defaults(E)
      struct All_variables *E;
-{ 
+{
+  void full_set_3dsphere_defaults2(struct All_variables *);
+  int m=E->parallel.me;
+
+  input_double("radius_outer",&(E->sphere.ro),"1",m);
+  input_double("radius_inner",&(E->sphere.ri),"0.55",m);
+
+  full_set_3dsphere_defaults2(E);
+
+  return;
+}
+
+
+void full_set_3dsphere_defaults2(struct All_variables *E)
+{
   int i,j;
   double offset;
-  int m=E->parallel.me;
 
   E->mesh.nsd = 3;
   E->mesh.dof = 3;
@@ -72,9 +85,6 @@
   E->sphere.caps = 12;
   E->sphere.max_connections = 6;
 
-  input_double("radius_outer",&(E->sphere.ro),"1",m);
-  input_double("radius_inner",&(E->sphere.ri),"0.55",m);
-
   offset = 10.0/180.0*M_PI;
 
   for (i=1;i<=4;i++)  {
@@ -111,4 +121,4 @@
     }
 
   return;
- }
+}

Modified: mc/3D/CitcomS/branches/compressible/lib/Instructions.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Instructions.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/Instructions.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -51,68 +51,39 @@
 #include "phase_change.h"
 #include "interuption.h"
 
-extern void parallel_process_termination();
+void parallel_process_termination();
+void allocate_common_vars(struct All_variables*);
+void allocate_velocity_vars(struct All_variables*);
+void check_bc_consistency(struct All_variables*);
+void construct_id(struct All_variables*);
+void construct_ien(struct All_variables*);
+void construct_lm(struct All_variables*);
+void construct_masks(struct All_variables*);
+void construct_mat_group(struct All_variables*);
+void construct_shape_functions(struct All_variables*);
+void construct_sub_element(struct All_variables*);
+void construct_surf_det (struct All_variables*);
+void construct_bdry_det (struct All_variables*);
+void construct_surface (struct All_variables*);
+void get_initial_elapsed_time(struct All_variables*);
+void lith_age_init(struct All_variables *E);
+void mass_matrix(struct All_variables*);
+void output_init(struct All_variables*);
+void read_mat_from_file(struct All_variables*);
+void set_elapsed_time(struct All_variables*);
+void set_sphere_harmonics (struct All_variables*);
+void set_starting_age(struct All_variables*);
+void tracer_initial_settings(struct All_variables*);
+double CPU_time0();
 
 
-void read_instructions(struct All_variables *E, char *filename)
+
+void initial_mesh_solver_setup(struct All_variables *E)
 {
-    void allocate_common_vars();
-    void common_initial_fields();
-    void read_initial_settings();
-    void tracer_initial_settings();
-    void global_default_values();
-    void construct_ien();
-    void construct_surface();
-    void construct_masks();
-    void construct_shape_functions();
-    void construct_id();
-    void construct_lm();
-    void construct_sub_element();
-    void mass_matrix();
-    void construct_node_ks();
-    void construct_node_maps();
-    void read_mat_from_file();
-    void construct_mat_group();
-    void set_up_nonmg_aliases();
-    void check_bc_consistency();
-    void allocate_velocity_vars();
-    void construct_c3x3matrix();
-    void construct_surf_det ();
-    void construct_bdry_det ();
-    void set_sphere_harmonics ();
-    void general_stokes_solver_setup();
 
-    void setup_parser();
-    void shutdown_parser();
-    void output_init();
-
-    void get_initial_elapsed_time();
-    void set_starting_age();
-    void set_elapsed_time();
-
-
-    double CPU_time0();
-    double global_vdot();
-
-    /* =====================================================
-       Global interuption handling routine defined once here
-       =====================================================  */
-
     E->monitor.cpu_time_at_last_cycle =
         E->monitor.cpu_time_at_start = CPU_time0();
 
-    set_signal();
-
-    /* ==================================================
-       Initialize from the command line
-       from startup files. (See Parsing.c).
-       ==================================================  */
-
-    setup_parser(E,filename);
-
-    global_default_values(E);
-    read_initial_settings(E);
-
     output_init(E);
     (E->problem_derived_values)(E);   /* call this before global_derived_  */
     (E->solver.global_derived_values)(E);
@@ -134,8 +105,8 @@
     (E->solver.node_locations)(E);
 
     if(E->control.tracer==1) {
-      tracer_initial_settings(E);
-      (E->problem_tracer_setup)(E);
+	tracer_initial_settings(E);
+	(E->problem_tracer_setup)(E);
     }
 
     allocate_velocity_vars(E);
@@ -144,15 +115,14 @@
     set_starting_age(E);  /* set the starting age to elapsed time, if desired */
     set_elapsed_time(E);         /* reset to elapsed time to zero, if desired */
 
-    if(E->control.lith_age) {
-      lith_age_init(E);
-    }
+    if(E->control.lith_age)
+        lith_age_init(E);
 
     (E->problem_boundary_conds)(E);
 
     check_bc_consistency(E);
 
-    construct_masks(E);         /* order is important here */
+    construct_masks(E);		/* order is important here */
     construct_id(E);
     construct_lm(E);
 
@@ -164,14 +134,11 @@
 
     reference_state(E);
 
-/*    construct_c3x3matrix(E);       */  /* this matrix results from spherical geometry*/
+    /* this matrix results from spherical geometry */
+    /* construct_c3x3matrix(E); */
+
     mass_matrix(E);
 
-    general_stokes_solver_setup(E);
-
-    if (E->parallel.me==0) fprintf(stderr,"time=%f\n",
-                                   CPU_time0()-E->monitor.cpu_time_at_start);
-
     construct_surf_det (E);
     construct_bdry_det (E);
 
@@ -182,6 +149,44 @@
     else
       construct_mat_group(E);
 
+}
+
+
+void read_instructions(struct All_variables *E, char *filename)
+{
+
+    void common_initial_fields();
+    void read_initial_settings();
+    void global_default_values();
+    void general_stokes_solver_setup();
+    void initial_mesh_solver_setup();
+
+    void setup_parser();
+    void shutdown_parser();
+
+    /* =====================================================
+       Global interuption handling routine defined once here
+       =====================================================  */
+
+    set_signal();
+
+    /* ==================================================
+       Initialize from the command line
+       from startup files. (See Parsing.c).
+       ==================================================  */
+
+    setup_parser(E,filename);
+
+    global_default_values(E);
+    read_initial_settings(E);
+
+    initial_mesh_solver_setup(E);
+
+    general_stokes_solver_setup(E);
+
+    if (E->parallel.me==0) fprintf(stderr,"time=%f\n",
+                                   CPU_time0()-E->monitor.cpu_time_at_start);
+
     (E->problem_initial_fields)(E);   /* temperature/chemistry/melting etc */
     common_initial_fields(E);  /* velocity/pressure/viscosity (viscosity must be done LAST) */
 

Modified: mc/3D/CitcomS/branches/compressible/lib/Regional_geometry_cartesian.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Regional_geometry_cartesian.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/Regional_geometry_cartesian.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -1,6 +1,6 @@
 /*
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * 
+ *
  *<LicenseText>
  *
  * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *</LicenseText>
- * 
+ *
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 #include "global_defs.h"
@@ -60,14 +60,9 @@
 void regional_set_3dsphere_defaults(E)
      struct All_variables *E;
 {
+  void regional_set_3dsphere_defaults2(struct All_variables *E);
   int m = E->parallel.me;
 
-  E->mesh.nsd = 3;
-  E->mesh.dof = 3;
-
-  E->sphere.caps = 1;
-  E->sphere.max_connections = 6;
-
   input_double("radius_outer",&(E->sphere.ro),"1",m);
   input_double("radius_inner",&(E->sphere.ri),"0.55",m);
 
@@ -76,6 +71,20 @@
   input_double("fi_min",&(E->control.fi_min),"essential",m);
   input_double("fi_max",&(E->control.fi_max),"essential",m);
 
+  regional_set_3dsphere_defaults2(E);
+
+  return;
+}
+
+
+void regional_set_3dsphere_defaults2(struct All_variables *E)
+{
+  E->mesh.nsd = 3;
+  E->mesh.dof = 3;
+
+  E->sphere.caps = 1;
+  E->sphere.max_connections = 6;
+
   E->sphere.cap[1].theta[1] = E->control.theta_min;
   E->sphere.cap[1].theta[2] = E->control.theta_max;
   E->sphere.cap[1].theta[3] = E->control.theta_max;

Modified: mc/3D/CitcomS/branches/compressible/lib/Solver_multigrid.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Solver_multigrid.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/Solver_multigrid.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -1,6 +1,6 @@
 /*
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * 
+ *
  *<LicenseText>
  *
  * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,21 +22,13 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *</LicenseText>
- * 
+ *
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 #include "element_definitions.h"
 #include "global_defs.h"
 #include <math.h>
 
-/*
-static double weightIJ[5][5] =
-        {       { 0.0,    0.0,    0.0,    0.0,    0.0 },
-		{ 0.0, 0.5625, 0.1875, 0.0625, 0.1875 },
-		{ 0.0, 0.1875, 0.5625, 0.1875, 0.0625 },
-		{ 0.0, 0.0625, 0.1875, 0.5625, 0.1875 },
-		{ 0.0, 0.1875, 0.0625, 0.1875, 0.5625 } };
-*/
 
 void set_mg_defaults(E)
      struct All_variables *E;

Modified: mc/3D/CitcomS/branches/compressible/lib/global_defs.h
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/global_defs.h	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/lib/global_defs.h	2007-01-25 01:45:20 UTC (rev 5888)
@@ -720,6 +720,7 @@
     void (* build_forcing_term)(void*);
     void (* iterative_solver)(void*);
     void (* next_buoyancy_field)(void*);
+    void (* next_buoyancy_field_init)(void*);
     void (* obtain_gravity)(void*);
     void (* problem_settings)(void*);
     void (* problem_derived_values)(void*);

Modified: mc/3D/CitcomS/branches/compressible/module/advdiffu.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/module/advdiffu.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/module/advdiffu.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -1,5 +1,5 @@
 /*
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
 //
@@ -22,7 +22,7 @@
 //
 //</LicenseText>
 //
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */
 
 #include <Python.h>
@@ -69,13 +69,19 @@
 
     E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
 
+    /* This function replaces some code in Citcom.c
+     * If you modify here, make sure its counterpart
+     * is modified as well */
     E->monitor.solution_cycles++;
     if(E->monitor.solution_cycles>E->control.print_convergence)
 	E->control.print_convergence=1;
 
+    /* Since dt may be modified in Pyre, we need to update
+     * E->advection.timestep again */
     E->advection.timestep = dt;
-    PG_timestep_solve(E);
 
+    (E->next_buoyancy_field)(E);
+
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -96,13 +102,6 @@
     E->control.CONVECTION = 1;
     set_convection_defaults(E);
 
-    /* copied from advection_diffusion_parameters() */
-    E->advection.total_timesteps = 1;
-    E->advection.sub_iterations = 1;
-    E->advection.last_sub_iterations = 1;
-    E->advection.gamma = 0.5;
-    E->monitor.T_maxvaried = 1.05;
-
     Py_INCREF(Py_None);
     return Py_None;
 }

Modified: mc/3D/CitcomS/branches/compressible/module/mesher.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/module/mesher.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/module/mesher.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -35,106 +35,10 @@
 #include "material_properties.h"
 
 
-void allocate_common_vars(struct All_variables*);
-void allocate_velocity_vars(struct All_variables*);
-void check_bc_consistency(struct All_variables*);
-void construct_id(struct All_variables*);
-void construct_ien(struct All_variables*);
-void construct_lm(struct All_variables*);
-void construct_masks(struct All_variables*);
-void construct_mat_group(struct All_variables*);
-void construct_shape_functions(struct All_variables*);
-void construct_sub_element(struct All_variables*);
-void construct_surf_det (struct All_variables*);
-void construct_bdry_det (struct All_variables*);
-void construct_surface (struct All_variables*);
-void get_initial_elapsed_time(struct All_variables*);
-void lith_age_init(struct All_variables *E);
-void mass_matrix(struct All_variables*);
-void output_init(struct All_variables*);
-void read_mat_from_file(struct All_variables*);
-void set_elapsed_time(struct All_variables*);
-void set_sphere_harmonics (struct All_variables*);
-void set_starting_age(struct All_variables*);
-void tracer_initial_settings(struct All_variables*);
-double CPU_time0();
+extern void initial_mesh_solver_setup(struct All_variables *);
 
 
 
-
-void sphere_launch(struct All_variables *E)
-    /* copied from read_instructions() */
-{
-
-    E->monitor.cpu_time_at_last_cycle =
-        E->monitor.cpu_time_at_start = CPU_time0();
-
-    output_init(E);
-    (E->problem_derived_values)(E);   /* call this before global_derived_  */
-    (E->solver.global_derived_values)(E);
-
-    (E->solver.parallel_processor_setup)(E);   /* get # of proc in x,y,z */
-    (E->solver.parallel_domain_decomp0)(E);  /* get local nel, nno, elx, nox et al */
-
-    allocate_common_vars(E);
-    (E->problem_allocate_vars)(E);
-    (E->solver_allocate_vars)(E);
-
-           /* logical domain */
-    construct_ien(E);
-    construct_surface(E);
-    (E->solver.construct_boundary)(E);
-    (E->solver.parallel_domain_boundary_nodes)(E);
-
-           /* physical domain */
-    (E->solver.node_locations)(E);
-
-    if(E->control.tracer==1) {
-	tracer_initial_settings(E);
-	(E->problem_tracer_setup)(E);
-    }
-
-    allocate_velocity_vars(E);
-
-    get_initial_elapsed_time(E);  /* Get elapsed time from restart run*/
-    set_starting_age(E);  /* set the starting age to elapsed time, if desired */
-    set_elapsed_time(E);         /* reset to elapsed time to zero, if desired */
-
-    if(E->control.lith_age)
-        lith_age_init(E);
-
-    (E->problem_boundary_conds)(E);
-
-    check_bc_consistency(E);
-
-    construct_masks(E);		/* order is important here */
-    construct_id(E);
-    construct_lm(E);
-
-    (E->solver.parallel_communication_routs_v)(E);
-    (E->solver.parallel_communication_routs_s)(E);
-
-    construct_sub_element(E);
-    construct_shape_functions(E);
-
-    reference_state(E);
-    mass_matrix(E);
-
-    construct_surf_det (E);
-    construct_bdry_det (E);
-
-    set_sphere_harmonics (E);
-
-    if(E->control.mat_control)
-      read_mat_from_file(E);
-    else
-      construct_mat_group(E);
-
-    return;
-}
-
-
-
 char pyCitcom_full_sphere_launch__doc__[] = "";
 char pyCitcom_full_sphere_launch__name__[] = "full_sphere_launch";
 
@@ -148,7 +52,7 @@
 
     E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
 
-    sphere_launch(E);
+    initial_mesh_solver_setup(E);
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -169,7 +73,7 @@
 
     E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
 
-    sphere_launch(E);
+    initial_mesh_solver_setup(E);
 
     Py_INCREF(Py_None);
     return Py_None;

Modified: mc/3D/CitcomS/branches/compressible/module/setProperties.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/module/setProperties.c	2007-01-25 01:38:10 UTC (rev 5887)
+++ mc/3D/CitcomS/branches/compressible/module/setProperties.c	2007-01-25 01:45:20 UTC (rev 5888)
@@ -103,14 +103,6 @@
     getIntProperty(properties, "adv_sub_iterations", E->advection.temp_iterations, fp);
 
 
-    E->advection.total_timesteps = 1;
-    E->advection.sub_iterations = 1;
-    E->advection.last_sub_iterations = 1;
-    E->advection.gamma = 0.5;
-    E->advection.dt_reduced = 1.0;
-
-    E->monitor.T_maxvaried = 1.05;
-
     PUTS(("\n"));
 
     Py_INCREF(Py_None);
@@ -485,6 +477,8 @@
 
 PyObject * pyCitcom_Sphere_set_properties(PyObject *self, PyObject *args)
 {
+    void full_set_3dsphere_defaults2(struct All_variables *);
+
     PyObject *obj, *properties, *out;
     struct All_variables *E;
     FILE *fp;
@@ -537,66 +531,17 @@
     getDoubleProperty(properties, "radius_outer", E->sphere.ro, fp);
     getDoubleProperty(properties, "radius_inner", E->sphere.ri, fp);
 
-    E->mesh.nsd = 3;
-    E->mesh.dof = 3;
-    E->sphere.max_connections = 6;
 
     if (E->parallel.nprocxy == 12) {
-	int i, j;
-	double offset = 10.0/180.0*M_PI;
-	/* full spherical version */
-	E->sphere.caps = 12;
-
-	for (i=1;i<=4;i++)  {
-	    E->sphere.cap[(i-1)*3+1].theta[1] = 0.0;
-	    E->sphere.cap[(i-1)*3+1].theta[2] = M_PI/4.0+offset;
-	    E->sphere.cap[(i-1)*3+1].theta[3] = M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+1].theta[4] = M_PI/4.0+offset;
-	    E->sphere.cap[(i-1)*3+1].fi[1] = 0.0;
-	    E->sphere.cap[(i-1)*3+1].fi[2] = (i-1)*M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+1].fi[3] = (i-1)*M_PI/2.0 + M_PI/4.0;
-	    E->sphere.cap[(i-1)*3+1].fi[4] = i*M_PI/2.0;
-
-	    E->sphere.cap[(i-1)*3+2].theta[1] = M_PI/4.0+offset;
-	    E->sphere.cap[(i-1)*3+2].theta[2] = M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].theta[3] = 3*M_PI/4.0-offset;
-	    E->sphere.cap[(i-1)*3+2].theta[4] = M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].fi[1] = i*M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].fi[2] = i*M_PI/2.0 - M_PI/4.0;
-	    E->sphere.cap[(i-1)*3+2].fi[3] = i*M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].fi[4] = i*M_PI/2.0 + M_PI/4.0;
-	}
-
-	for (i=1;i<=4;i++)  {
-	    j = (i-1)*3;
-	    if (i==1) j=12;
-	    E->sphere.cap[j].theta[1] = M_PI/2.0;
-	    E->sphere.cap[j].theta[2] = 3*M_PI/4.0-offset;
-	    E->sphere.cap[j].theta[3] = M_PI;
-	    E->sphere.cap[j].theta[4] = 3*M_PI/4.0-offset;
-	    E->sphere.cap[j].fi[1] = (i-1)*M_PI/2.0 + M_PI/4.0;
-	    E->sphere.cap[j].fi[2] = (i-1)*M_PI/2.0;
-	    E->sphere.cap[j].fi[3] = 0.0;
-	    E->sphere.cap[j].fi[4] = i*M_PI/2.0;
-	}
-
-    } else {
-	/* regional version */
-	E->sphere.caps = 1;
-
+        full_set_3dsphere_defaults2(E);
+    }
+    else {
 	getDoubleProperty(properties, "theta_min", E->control.theta_min, fp);
 	getDoubleProperty(properties, "theta_max", E->control.theta_max, fp);
 	getDoubleProperty(properties, "fi_min", E->control.fi_min, fp);
 	getDoubleProperty(properties, "fi_max", E->control.fi_max, fp);
 
-	E->sphere.cap[1].theta[1] = E->control.theta_min;
-	E->sphere.cap[1].theta[2] = E->control.theta_max;
-	E->sphere.cap[1].theta[3] = E->control.theta_max;
-	E->sphere.cap[1].theta[4] = E->control.theta_min;
-	E->sphere.cap[1].fi[1] = E->control.fi_min;
-	E->sphere.cap[1].fi[2] = E->control.fi_min;
-	E->sphere.cap[1].fi[3] = E->control.fi_max;
-	E->sphere.cap[1].fi[4] = E->control.fi_max;
+        regional_set_3dsphere_defaults2(E);
     }
 
     E->mesh.layer[1] = 1;



More information about the cig-commits mailing list