[cig-commits] r11418 - in cs/benchmark/cigma/trunk/src: . tests

luis at geodynamics.org luis at geodynamics.org
Wed Mar 12 11:03:13 PDT 2008


Author: luis
Date: 2008-03-12 11:03:12 -0700 (Wed, 12 Mar 2008)
New Revision: 11418

Added:
   cs/benchmark/cigma/trunk/src/ZeroField.cpp
   cs/benchmark/cigma/trunk/src/ZeroField.h
   cs/benchmark/cigma/trunk/src/tests/TestZeroField.cpp
Removed:
   cs/benchmark/cigma/trunk/src/ZeroFunction.cpp
   cs/benchmark/cigma/trunk/src/ZeroFunction.h
   cs/benchmark/cigma/trunk/src/tests/TestZeroFunction.cpp
Modified:
   cs/benchmark/cigma/trunk/src/Makefile.am
   cs/benchmark/cigma/trunk/src/tests/Makefile
Log:
Rename ZeroFunction to the slightly more descriptive ZeroField, since it needs a (dim,rank) shape


Modified: cs/benchmark/cigma/trunk/src/Makefile.am
===================================================================
--- cs/benchmark/cigma/trunk/src/Makefile.am	2008-03-12 18:03:10 UTC (rev 11417)
+++ cs/benchmark/cigma/trunk/src/Makefile.am	2008-03-12 18:03:12 UTC (rev 11418)
@@ -146,6 +146,6 @@
 	VtkWriter.h \
 	Writer.cpp \
 	Writer.h \
-	ZeroFunction.cpp \
-	ZeroFunction.h
+	ZeroField.cpp \
+	ZeroField.h
 

Added: cs/benchmark/cigma/trunk/src/ZeroField.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/ZeroField.cpp	                        (rev 0)
+++ cs/benchmark/cigma/trunk/src/ZeroField.cpp	2008-03-12 18:03:12 UTC (rev 11418)
@@ -0,0 +1,24 @@
+#include "ZeroField.h"
+
+using namespace cigma;
+
+
+ZeroField::ZeroField()
+{
+    dim = rank = 0;
+}
+
+
+ZeroField::~ZeroField()
+{
+}
+
+
+void ZeroField::eval(double *x, double *y)
+{
+    for (int i = 0; i < rank; i++)
+    {
+        y[i] = 0.0;
+    }
+}
+

Copied: cs/benchmark/cigma/trunk/src/ZeroField.h (from rev 11417, cs/benchmark/cigma/trunk/src/ZeroFunction.h)
===================================================================
--- cs/benchmark/cigma/trunk/src/ZeroField.h	                        (rev 0)
+++ cs/benchmark/cigma/trunk/src/ZeroField.h	2008-03-12 18:03:12 UTC (rev 11418)
@@ -0,0 +1,36 @@
+#ifndef __ZERO_FIELD_H__
+#define __ZERO_FIELD_H__
+
+#include "Field.h"
+
+namespace cigma {
+    class ZeroField;
+}
+
+class cigma::ZeroField : Field
+{
+public:
+    ZeroField();
+    ~ZeroField();
+
+public:
+    void eval(double *point, double *value);
+
+public:
+    int n_dim() { return dim; }
+    int n_rank() { return rank; }
+
+public:
+    void set_shape(int dim, int rank)
+    {
+        this->dim = dim;
+        this->rank = rank;
+    }
+
+public:
+    int dim;
+    int rank;
+};
+
+#endif
+

Deleted: cs/benchmark/cigma/trunk/src/ZeroFunction.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/ZeroFunction.cpp	2008-03-12 18:03:10 UTC (rev 11417)
+++ cs/benchmark/cigma/trunk/src/ZeroFunction.cpp	2008-03-12 18:03:12 UTC (rev 11418)
@@ -1,12 +0,0 @@
-#include "ZeroFunction.h"
-
-using namespace cigma;
-
-void ZeroFunction::eval(double *x, double *y)
-{
-    for (int i = 0; i < rank; i++)
-    {
-        y[i] = 0.0;
-    }
-}
-

Deleted: cs/benchmark/cigma/trunk/src/ZeroFunction.h
===================================================================
--- cs/benchmark/cigma/trunk/src/ZeroFunction.h	2008-03-12 18:03:10 UTC (rev 11417)
+++ cs/benchmark/cigma/trunk/src/ZeroFunction.h	2008-03-12 18:03:12 UTC (rev 11418)
@@ -1,32 +0,0 @@
-#ifndef __ZERO_FUNCTION_H__
-#define __ZERO_FUNCTION_H__
-
-#include "Field.h"
-
-namespace cigma {
-    class ZeroFunction;
-}
-
-class cigma::ZeroFunction : Field
-{
-public:
-    void eval(double *point, double *value);
-
-public:
-    int n_dim() { return dim; }
-    int n_rank() { return rank; }
-
-public:
-    void set_shape(int dim, int rank)
-    {
-        this->dim = dim;
-        this->rank = rank;
-    }
-
-public:
-    int dim;
-    int rank;
-};
-
-#endif
-

Modified: cs/benchmark/cigma/trunk/src/tests/Makefile
===================================================================
--- cs/benchmark/cigma/trunk/src/tests/Makefile	2008-03-12 18:03:10 UTC (rev 11417)
+++ cs/benchmark/cigma/trunk/src/tests/Makefile	2008-03-12 18:03:12 UTC (rev 11418)
@@ -34,7 +34,7 @@
 	TestAnn.o \
 	TestAnnLocator.o \
 	TestHdfReader.o \
-	TestZeroFunction.o \
+	TestZeroField.o \
 
 
 TESTS = $(TESTOBJS:.o=.out)

Copied: cs/benchmark/cigma/trunk/src/tests/TestZeroField.cpp (from rev 11417, cs/benchmark/cigma/trunk/src/tests/TestZeroFunction.cpp)
===================================================================
--- cs/benchmark/cigma/trunk/src/tests/TestZeroField.cpp	                        (rev 0)
+++ cs/benchmark/cigma/trunk/src/tests/TestZeroField.cpp	2008-03-12 18:03:12 UTC (rev 11418)
@@ -0,0 +1,33 @@
+#include <iostream>
+#include "../ZeroField.h"
+
+using namespace std;
+using namespace cigma;
+
+int main()
+{
+    ZeroField *F = new ZeroField();
+
+    const int n = 10;
+    double x[n], y[n];
+
+    int i;
+    for (i = 0; i < n; i++)
+    {
+        x[i] = i / (1.0 * n);
+    }
+
+    F->set_shape(1,1);
+
+    for (i = 0; i < n; i++)
+    {
+        F->eval(&x[i], &y[i]);
+    }
+
+    for (i = 0; i < n; i++)
+    {
+        cout << "F(" << x[i] << ") = " << y[i] << endl;
+    }
+
+    return 0;
+}

Deleted: cs/benchmark/cigma/trunk/src/tests/TestZeroFunction.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/tests/TestZeroFunction.cpp	2008-03-12 18:03:10 UTC (rev 11417)
+++ cs/benchmark/cigma/trunk/src/tests/TestZeroFunction.cpp	2008-03-12 18:03:12 UTC (rev 11418)
@@ -1,33 +0,0 @@
-#include <iostream>
-#include "../ZeroFunction.h"
-
-using namespace std;
-using namespace cigma;
-
-int main()
-{
-    ZeroFunction *F = new ZeroFunction();
-
-    const int n = 10;
-    double x[n], y[n];
-
-    int i;
-    for (i = 0; i < n; i++)
-    {
-        x[i] = i / (1.0 * n);
-    }
-
-    F->set_shape(1,1);
-
-    for (i = 0; i < n; i++)
-    {
-        F->eval(&x[i], &y[i]);
-    }
-
-    for (i = 0; i < n; i++)
-    {
-        cout << "F(" << x[i] << ") = " << y[i] << endl;
-    }
-
-    return 0;
-}



More information about the cig-commits mailing list