[cig-commits] r15107 - mc/3D/CitcomS/trunk/module/Exchanger

tan2 at geodynamics.org tan2 at geodynamics.org
Tue Jun 2 15:09:26 PDT 2009


Author: tan2
Date: 2009-06-02 15:09:25 -0700 (Tue, 02 Jun 2009)
New Revision: 15107

Modified:
   mc/3D/CitcomS/trunk/module/Exchanger/Boundary.cc
   mc/3D/CitcomS/trunk/module/Exchanger/Boundary.h
Log:
Boundary for global mesh, not sure whether it works with interpolator or not

Modified: mc/3D/CitcomS/trunk/module/Exchanger/Boundary.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/Exchanger/Boundary.cc	2009-06-02 22:07:05 UTC (rev 15106)
+++ mc/3D/CitcomS/trunk/module/Exchanger/Boundary.cc	2009-06-02 22:09:25 UTC (rev 15107)
@@ -55,14 +55,10 @@
     normal_.reserve(maxNodes);
 
     // find out which nodes belong to the boundary and fill X_ with them
-    // XXX: only implemented for regional model
     if (E->parallel.nprocxy == 1)
-        initX(E, excludeTop, excludeBottom);
-    else {
-        journal::firewall_t firewall("CitcomS-Boundary");
-        firewall << "Boundary is not implemented for full solver (yet)."
-                 << journal::endl;
-    }
+        initRegionalX(E, excludeTop, excludeBottom);
+    else 
+        initFullX(E, excludeTop, excludeBottom);
 
     // define the tight bounding box of the boundary
     initBBox(E);
@@ -93,8 +89,8 @@
 }
 
 
-void Boundary::initX(const All_variables* E,
-		     bool excludeTop, bool excludeBottom)
+void Boundary::initRegionalX(const All_variables* E,
+                             bool excludeTop, bool excludeBottom)
 {
     const int itop = E->lmesh.noz;
 
@@ -144,6 +140,40 @@
 }
 
 
+void Boundary::initFullX(const All_variables* E,
+                         bool excludeTop, bool excludeBottom)
+{
+    const int itop = E->lmesh.noz;
+
+    if(E->parallel.me_loc[3] == E->parallel.nprocz - 1) {
+	if(!excludeTop) {
+	    for(int k=1; k<=E->lmesh.noy; k++)
+		for(int j=1; j<=E->lmesh.nox; j++) {
+		    std::vector<int> normalFlag(Exchanger::DIM,0);
+		    normalFlag[2] = 1;
+		    int node = ijk2node(E, itop, j, k);
+		    appendNode(E, node, normalFlag);
+		}
+	}
+    }
+
+
+    const int ibottom = 1;
+
+    if(E->parallel.me_loc[3] == 0) {
+	if(!excludeBottom) {
+	    for(int k=1; k<=E->lmesh.noy; k++)
+		for(int j=1; j<=E->lmesh.nox; j++) {
+		    std::vector<int> normalFlag(Exchanger::DIM,0);
+		    normalFlag[2] = -1;
+		    int node = ijk2node(E, ibottom, j, k);
+		    appendNode(E, node, normalFlag);
+		}
+	}
+    }
+}
+
+
 void Boundary::addSidewalls(const All_variables* E, int znode, int r_normal)
 {
     const int i = znode;

Modified: mc/3D/CitcomS/trunk/module/Exchanger/Boundary.h
===================================================================
--- mc/3D/CitcomS/trunk/module/Exchanger/Boundary.h	2009-06-02 22:07:05 UTC (rev 15106)
+++ mc/3D/CitcomS/trunk/module/Exchanger/Boundary.h	2009-06-02 22:09:25 UTC (rev 15107)
@@ -59,9 +59,11 @@
 
 private:
     void initBBox(const All_variables *E);
-    void initX(const All_variables *E,
-	       bool excludeTop, bool excludeBottom);
-
+    void initRegionalX(const All_variables *E,
+                       bool excludeTop, bool excludeBottom);
+    void initFullX(const All_variables *E,
+                   bool excludeTop, bool excludeBottom);
+    
     void addSidewalls(const All_variables* E, int znode, int r_normal);
     bool checkSidewalls(const All_variables* E,
 			int j, int k, std::vector<int>& normalFlag);



More information about the CIG-COMMITS mailing list