[cig-commits] r13248 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Tue Nov 4 01:48:54 PST 2008


Author: luis
Date: 2008-11-04 01:48:53 -0800 (Tue, 04 Nov 2008)
New Revision: 13248

Modified:
   cs/cigma/trunk/src/Points.cpp
   cs/cigma/trunk/src/Points.h
   cs/cigma/trunk/src/Quadrature.h
   cs/cigma/trunk/src/io_file_reader.h
Log:
Added various reminders.

Also, implemented Points::reinit() for reallocating new memory.

Modified: cs/cigma/trunk/src/Points.cpp
===================================================================
--- cs/cigma/trunk/src/Points.cpp	2008-11-04 09:48:51 UTC (rev 13247)
+++ cs/cigma/trunk/src/Points.cpp	2008-11-04 09:48:53 UTC (rev 13248)
@@ -19,6 +19,23 @@
 }
 
 template <typename T, int dim>
+void Points<T,dim>::reinit(int npts)
+{
+    if (data != 0)
+    {
+        delete [] data;
+        data = 0;
+    }
+
+    this->npts = npts;
+
+    if (npts > 0)
+    {
+        data = new T[npts * dim];
+    }
+}
+
+template <typename T, int dim>
 Points<T,dim>::~Points()
 {
     if (data != 0)

Modified: cs/cigma/trunk/src/Points.h
===================================================================
--- cs/cigma/trunk/src/Points.h	2008-11-04 09:48:51 UTC (rev 13247)
+++ cs/cigma/trunk/src/Points.h	2008-11-04 09:48:53 UTC (rev 13248)
@@ -16,15 +16,21 @@
 public:
     Points();
     Points(int npts);
+    void reinit(int npts);
     ~Points();
 
     int n_points() const;
     int n_dim() const;
     int index(int i, int j) const;
 
-    Point<dim> get(int i) const;
-    T get(int i, int j) const;
+    Point<dim> get(int i) const;    // XXX: rename this get() to point()
+    T get(int i, int j) const;      // XXX: rename this get() to data()
 
+    //XXX: define the following
+    //T& data(int i, j);
+    //T  operator()(int i, int j) const;
+    //T& operator()(int i, int j);
+
     void set(int i, int j, double val);
 
 public:

Modified: cs/cigma/trunk/src/Quadrature.h
===================================================================
--- cs/cigma/trunk/src/Quadrature.h	2008-11-04 09:48:51 UTC (rev 13247)
+++ cs/cigma/trunk/src/Quadrature.h	2008-11-04 09:48:53 UTC (rev 13248)
@@ -33,7 +33,7 @@
     void setWeight(int q, double val);
 
     void reinit(int npts, int ndim);
-    void setData(double *points, double *weights);
+    void setData(double *points, double *weights); // XXX: rename to init(double*,double*)
 
     static boost::shared_ptr<Quadrature> default_rule(Cell::type cell_type);
 

Modified: cs/cigma/trunk/src/io_file_reader.h
===================================================================
--- cs/cigma/trunk/src/io_file_reader.h	2008-11-04 09:48:51 UTC (rev 13247)
+++ cs/cigma/trunk/src/io_file_reader.h	2008-11-04 09:48:53 UTC (rev 13248)
@@ -25,8 +25,12 @@
     virtual int close() = 0;
 
     virtual int getDataset(const char *loc, double **data, int *num, int *dim) = 0;
+    //virtual int getDataset(const char *loc, float **data, int *num, int *dim) = 0;
+    //virtual int getDataset(const char *loc, int **data, int *num, int *dim) = 0;
+
     virtual int getCoordinates(const char *loc, double **coordinates, int *nno, int *nsd) = 0;
     virtual int getConnectivity(const char *loc, int **connectivity, int *nel, int *ndofs) = 0;
+    //virtual int getDofs(const char *loc, double **dofs, int *nno, int *ndofs) = 0;
 
     static boost::shared_ptr<FileReader> New(std::string filename, std::string mode);
 



More information about the CIG-COMMITS mailing list