[cig-commits] r4193 - in mc/3D/CitcomS/trunk: CitcomS/Solver module

tan2 at geodynamics.org tan2 at geodynamics.org
Tue Aug 1 12:21:55 PDT 2006


Author: tan2
Date: 2006-08-01 12:21:55 -0700 (Tue, 01 Aug 2006)
New Revision: 4193

Modified:
   mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py
   mc/3D/CitcomS/trunk/module/bindings.cc
   mc/3D/CitcomS/trunk/module/outputs.cc
   mc/3D/CitcomS/trunk/module/outputs.h
Log:
Closing output files in Solver.py

Modified: mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py	2006-08-01 19:06:42 UTC (rev 4192)
+++ mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py	2006-08-01 19:21:55 UTC (rev 4193)
@@ -244,7 +244,7 @@
         if self.coupler:
             output(self.all_variables, step)
 
-	#finalize()
+        self.finalize()
         return
 
 
@@ -284,7 +284,12 @@
         return
 
 
+    def finalize(self):
+        from CitcomSLib import output_finalize
+        output_finalize(self.all_variables)
+        return
 
+
     class Inventory(Component.Inventory):
 
         import pyre.inventory

Modified: mc/3D/CitcomS/trunk/module/bindings.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/bindings.cc	2006-08-01 19:06:42 UTC (rev 4192)
+++ mc/3D/CitcomS/trunk/module/bindings.cc	2006-08-01 19:21:55 UTC (rev 4193)
@@ -205,6 +205,11 @@
      METH_VARARGS,
      pyCitcom_output__doc__},
 
+    {pyCitcom_output_finalize__name__,
+     pyCitcom_output_finalize,
+     METH_VARARGS,
+     pyCitcom_output_finalize__doc__},
+
     // from setProperties.h
 
     {pyCitcom_Advection_diffusion_set_properties__name__,

Modified: mc/3D/CitcomS/trunk/module/outputs.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/outputs.cc	2006-08-01 19:06:42 UTC (rev 4192)
+++ mc/3D/CitcomS/trunk/module/outputs.cc	2006-08-01 19:21:55 UTC (rev 4193)
@@ -37,6 +37,13 @@
 #include "output.h"
 
 
+extern "C" {
+
+    void output_finalize(struct  All_variables *E);
+
+}
+
+
 char pyCitcom_output__doc__[] = "";
 char pyCitcom_output__name__[] = "output";
 
@@ -64,6 +71,26 @@
 }
 
 
+char pyCitcom_output_finalize__doc__[] = "";
+char pyCitcom_output_finalize__name__[] = "output_finalize";
+
+PyObject * pyCitcom_output_finalize(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    int cycles;
+
+    if (!PyArg_ParseTuple(args, "O:output_finalize", &obj))
+        return NULL;
+
+    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
+
+    output_finalize(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
 char pyCitcom_output_pseudo_surf__doc__[] = "";
 char pyCitcom_output_pseudo_surf__name__[] = "output_pseudo_surf";
 

Modified: mc/3D/CitcomS/trunk/module/outputs.h
===================================================================
--- mc/3D/CitcomS/trunk/module/outputs.h	2006-08-01 19:06:42 UTC (rev 4192)
+++ mc/3D/CitcomS/trunk/module/outputs.h	2006-08-01 19:21:55 UTC (rev 4193)
@@ -34,6 +34,11 @@
 extern "C"
 PyObject * pyCitcom_output(PyObject *, PyObject *);
 
+extern char pyCitcom_output_finalize__name__[];
+extern char pyCitcom_output_finalize__doc__[];
+extern "C"
+PyObject * pyCitcom_output_finalize(PyObject *, PyObject *);
+
 #endif
 
 // version



More information about the cig-commits mailing list