[cig-commits] r8092 - in mc/3D/CitcomS/trunk/CitcomS: Coupler Solver

tan2 at geodynamics.org tan2 at geodynamics.org
Fri Oct 5 13:02:02 PDT 2007


Author: tan2
Date: 2007-10-05 13:02:02 -0700 (Fri, 05 Oct 2007)
New Revision: 8092

Modified:
   mc/3D/CitcomS/trunk/CitcomS/Coupler/ContainingCoupler.py
   mc/3D/CitcomS/trunk/CitcomS/Coupler/Coupler.py
   mc/3D/CitcomS/trunk/CitcomS/Coupler/EmbeddedCoupler.py
   mc/3D/CitcomS/trunk/CitcomS/Solver/CoupledSolver.py
Log:
Renamed excludeTop -> exclude_top, and excludeBottom -> exclude_bottom. 
(No other CitcomS parameter uses CamelCase.)

Reworked the interaction of initial temperature and coupling. 
Created a new parameter exchange_initial_temperature. 


Modified: mc/3D/CitcomS/trunk/CitcomS/Coupler/ContainingCoupler.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Coupler/ContainingCoupler.py	2007-10-05 20:00:32 UTC (rev 8091)
+++ mc/3D/CitcomS/trunk/CitcomS/Coupler/ContainingCoupler.py	2007-10-05 20:02:02 UTC (rev 8092)
@@ -39,11 +39,6 @@
     def initialize(self, solver):
         Coupler.initialize(self, solver)
 
-        # restart and use temperautre field of previous run?
-        self.restart = solver.restart
-        if self.restart:
-            self.ic_initTemperature = solver.ic_initTemperature
-
         # allocate space for exchanger objects
         self.remoteBdryList = range(self.remoteSize)
         self.sourceList = range(self.remoteSize)
@@ -138,20 +133,16 @@
 
 
     def initTemperature(self):
-        if self.restart:
-            # read-in restarted temperature field
-            self.ic_initTemperature()
-            del self.ic_initTemperature
-            # send temperature to EmbeddedCoupler and postprocess
-            self.restartTemperature()
-        else:
-            from ExchangerLib import initTemperature
-            initTemperature(self.remoteBBox,
-                            self.all_variables)
+        from ExchangerLib import initTemperature
+        initTemperature(self.remoteBBox,
+                        self.all_variables)
         return
 
 
-    def restartTemperature(self):
+    def exchangeTemperature(self):
+        if not self.inventory.exchange_initial_temperature:
+            return
+
         from ExchangerLib import createEmptyInterior, CitcomSource_create
         interior = range(self.remoteSize)
         source = range(self.remoteSize)
@@ -180,7 +171,7 @@
         # If T is modified before sending, EmbeddedCoupler's T will lose sharp
         # feature.
         # EmbeddedCoupler has to call modifyT too to ensure consistent T field.
-        self.modifyT(self.remoteBBox)
+        #self.modifyT(self.remoteBBox)
 
         return
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Coupler/Coupler.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Coupler/Coupler.py	2007-10-05 20:00:32 UTC (rev 8091)
+++ mc/3D/CitcomS/trunk/CitcomS/Coupler/Coupler.py	2007-10-05 20:02:02 UTC (rev 8092)
@@ -146,6 +146,10 @@
 
         # updating the temperature field in the containing solver or not
         two_way_communication = prop.bool("two_way_communication", default=True)
+        # insuring consistent inititial temperature fields at the overlapping
+        # domain or not
+        exchange_initial_temperature = prop.bool("exchange_initial_temperature",
+                                                 default=True)
 
         # if dimensional is True, quantities exchanged are dimensional
         dimensional = prop.bool("dimensional", default=False)
@@ -156,7 +160,6 @@
 
 
 
-
 # version
 __id__ = "$Id$"
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Coupler/EmbeddedCoupler.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Coupler/EmbeddedCoupler.py	2007-10-05 20:00:32 UTC (rev 8091)
+++ mc/3D/CitcomS/trunk/CitcomS/Coupler/EmbeddedCoupler.py	2007-10-05 20:02:02 UTC (rev 8092)
@@ -53,11 +53,6 @@
         assert solver.inventory.bc.inventory.side_sbcs == True, \
                'Error: esolver.bc.side_sbcs must be on!'
 
-	# restart and use temperautre field of previous run?
-        self.restart = solver.restart
-        if self.restart:
-            self.ic_initTemperature = solver.ic_initTemperature
-
         # allocate space for exchanger objects
         self.remoteIntrList = range(self.remoteSize)
         self.sourceList = range(self.remoteSize)
@@ -84,8 +79,8 @@
 
         # the nodes on the boundary, top and bottom boundaries are special
         self.boundary, self.myBBox = createBoundary(self.all_variables,
-                                                    inv.excludeTop,
-                                                    inv.excludeBottom)
+                                                    inv.exclude_top,
+                                                    inv.exclude_bottom)
 
         # an empty interior object, which will be filled by a remote interior obj.
         if inv.two_way_communication:
@@ -155,17 +150,16 @@
 
 
     def initTemperature(self):
-        if self.restart:
-            # receive temperature from CCPLR and postprocess
-            self.restartTemperature()
-        else:
-            from ExchangerLib import initTemperature
-            initTemperature(self.globalBBox,
-                            self.all_variables)
+        from ExchangerLib import initTemperature
+        initTemperature(self.globalBBox,
+                        self.all_variables)
         return
 
 
-    def restartTemperature(self):
+    def exchangeTemperature(self):
+        if not self.inventory.exchange_initial_temperature:
+            return
+
         from ExchangerLib import createInterior, Sink_create
         interior, bbox = createInterior(self.remoteBBox,
                                         self.all_variables)
@@ -181,7 +175,7 @@
         # Note: modifyT is called after receiving unmodified T from CCPLR.
         # If T is modified before sending, ECPLR's T will lose sharp feature.
         # CCPLR has to call modifyT too to ensure consistent T field.
-        self.modifyT(self.globalBBox)
+        #self.modifyT(self.globalBBox)
 
         return
 
@@ -262,10 +256,10 @@
         import pyre.inventory as prop
 
         # excluding nodes in top boundary? (used if vbc is read from file)
-        excludeTop = prop.bool("excludeTop", default=False)
+        exclude_top = prop.bool("exclude_top", default=False)
 
         # excluding nodes in bottom boundary?
-        excludeBottom = prop.bool("excludeBottom", default=False)
+        exclude_bottom = prop.bool("exclude_bottom", default=False)
 
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Solver/CoupledSolver.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Solver/CoupledSolver.py	2007-10-05 20:00:32 UTC (rev 8091)
+++ mc/3D/CitcomS/trunk/CitcomS/Solver/CoupledSolver.py	2007-10-05 20:02:02 UTC (rev 8092)
@@ -50,30 +50,26 @@
         self.myPlus = application.myPlus
         self.remotePlus = application.remotePlus
 
-        self.restart = self.inventory.ic.inventory.restart
-        self.ic_initTemperature = self.inventory.ic.initTemperature
-
         self.coupler.initialize(self)
         return
 
 
     def launch(self, application):
-
         #TODO: checkpoint doesn't contain coupler information yet
-        if self.restart:
-            pass
-
         self.coupler.launch(self)
 
-        ic = self.inventory.ic
-        if not (ic.inventory.restart or ic.inventory.post_p):
-            # switch the default initTemperature to coupled version
-            ic.initTemperature = self.coupler.initTemperature
+        if self.inventory.ic.inventory.restart:
+            from CitcomSLib import readCheckpoint
+            readCheckpoint(self.all_variables)
+        else:
+            # initial conditions
+            ic = self.inventory.ic
+            ic.launch()
 
-        # initial conditions
-        ic.launch()
+            # insure consistent temperature fields across solvers
+            self.coupler.exchangeTemperature()
 
-        self.solveVelocities()
+            self.solveVelocities()
         return
 
 



More information about the cig-commits mailing list