[cig-commits] r9041 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Mon Jan 14 21:28:11 PST 2008


Author: luis
Date: 2008-01-14 21:28:11 -0800 (Mon, 14 Jan 2008)
New Revision: 9041

Modified:
   cs/benchmark/cigma/trunk/src/MeshPart.cpp
   cs/benchmark/cigma/trunk/src/MeshPart.h
Log:
Changes to cigma::MeshPart base class

Modified: cs/benchmark/cigma/trunk/src/MeshPart.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/MeshPart.cpp	2008-01-15 05:28:09 UTC (rev 9040)
+++ cs/benchmark/cigma/trunk/src/MeshPart.cpp	2008-01-15 05:28:11 UTC (rev 9041)
@@ -6,13 +6,15 @@
 cigma::MeshPart::
 MeshPart()
 {
-    //nno = 0;
-    //nsd = 0;
+    nno = 0;
+    nsd = 0;
     coords = 0;
 
-    //nel = 0;
-    //ndofs = 0;
+    nel = 0;
+    ndofs = 0;
     connect = 0;
+    
+    cell = 0;
 }
 
 
@@ -34,11 +36,11 @@
     //assert(nno > 0);
     //assert(nsd > 0);
 
-    //this->nno = nno;
-    //this->nsd = nsd;
+    this->nno = nno;
+    this->nsd = nsd;
 
-    assert(nno == n_nodes());
-    assert(nsd == n_nsd());
+    //assert(nno == n_nodes());
+    //assert(nsd == n_nsd());
 
     /* // XXX: copy pointer
     coords = coordinates;
@@ -63,11 +65,11 @@
     //assert(nel > 0);
     //assert(ndofs > 0);
 
-    //this->nel = nel;
-    //this->ndofs = ndofs;
+    this->nel = nel;
+    this->ndofs = ndofs;
 
-    assert(nel == n_nel());
-    assert(ndofs == n_ndofs());
+    //assert(nel == n_nel());
+    //assert(ndofs == n_ndofs());
 
     /* // XXX: copy pointer
     connect = connectivity;
@@ -89,22 +91,23 @@
 // ---------------------------------------------------------------------------
 
 void cigma::MeshPart::
-cell_coords(int cellIndex, double *globalCellCoords)
+get_cell_coords(int cellIndex, double *globalCellCoords)
 {
     //assert(nsd > 0);
     //assert(ndofs > 0);
 
-    const int nel = n_nel();
-    const int ndofs = n_ndofs();
-    const int nsd = n_nsd();
+    //const int nel = n_nel();
+    //const int ndofs = n_ndofs();
+    //const int nsd = n_nsd();
 
-    assert(0 <= cellIndex); assert(cellIndex < nel);
+    assert(0 <= cellIndex);
+    assert(cellIndex < nel);
 
     int *conn = &connect[ndofs * cellIndex];
 
     for (int i = 0; i < ndofs; i++)
     {
-        double *pt = &coords[conn[i]];
+        double *pt = &coords[nsd * conn[i]];
         for (int j = 0; j < nsd; j++)
         {
             globalCellCoords[nsd*i + j] = pt[j];
@@ -112,3 +115,4 @@
     }
 }
 
+// ---------------------------------------------------------------------------

Modified: cs/benchmark/cigma/trunk/src/MeshPart.h
===================================================================
--- cs/benchmark/cigma/trunk/src/MeshPart.h	2008-01-15 05:28:09 UTC (rev 9040)
+++ cs/benchmark/cigma/trunk/src/MeshPart.h	2008-01-15 05:28:11 UTC (rev 9041)
@@ -1,6 +1,8 @@
 #ifndef __MESH_PART_H__
 #define __MESH_PART_H__
 
+#include "Cell.h"
+
 namespace cigma
 {
     class MeshPart;
@@ -13,25 +15,25 @@
     virtual ~MeshPart();
 
 public:
-    virtual int n_nodes() = 0;
-    virtual int n_nsd() = 0;
-    virtual int n_nel() = 0;
-    virtual int n_ndofs() = 0;
+    //virtual int n_nodes() = 0;
+    //virtual int n_nsd() = 0;
+    //virtual int n_nel() = 0;
+    //virtual int n_ndofs() = 0;
 
 public:
     void set_coordinates(double *coordinates, int nno, int nsd);
     void set_connectivity(int *connectivity, int nel, int ndofs);
 
 public:
-    void cell_coords(int cellIndex, double *globalCoords);
+    void get_cell_coords(int cellIndex, double *globalCoords);
     virtual bool find_cell(double globalPoint[3], int *cellIndex) = 0;
 
 public:
-    //int nno, nsd;
-    //int nel, ndofs;
+    int nno, nsd;
+    int nel, ndofs;
     double *coords;
     int *connect;
-
+    Cell *cell;
 };
 
 



More information about the cig-commits mailing list