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

luis at geodynamics.org luis at geodynamics.org
Tue Dec 9 18:13:13 PST 2008


Author: luis
Date: 2008-12-09 18:13:12 -0800 (Tue, 09 Dec 2008)
New Revision: 13521

Added:
   cs/cigma/trunk/src/fn_one.cpp
   cs/cigma/trunk/src/fn_one.h
   cs/cigma/trunk/src/fn_test.cpp
   cs/cigma/trunk/src/fn_test.h
Modified:
   cs/cigma/trunk/src/fn_explicit.cpp
   cs/cigma/trunk/src/fn_explicit.h
   cs/cigma/trunk/src/fn_zero.cpp
Log:
Updates to functions

Modified: cs/cigma/trunk/src/fn_explicit.cpp
===================================================================
--- cs/cigma/trunk/src/fn_explicit.cpp	2008-12-10 02:13:10 UTC (rev 13520)
+++ cs/cigma/trunk/src/fn_explicit.cpp	2008-12-10 02:13:12 UTC (rev 13521)
@@ -1,15 +1,15 @@
 #include "fn_explicit.h"
 using namespace cigma;
 
-ExplicitFunction::ExplicitFunction()
+ExplicitFn::ExplicitFn()
 {
 }
 
-ExplicitFunction::~ExplicitFunction()
+ExplicitFn::~ExplicitFn()
 {
 }
 
-bool ExplicitFunction::eval(double *point, double *value)
+bool ExplicitFn::eval(double *point, double *value)
 {
     return false;
 }

Modified: cs/cigma/trunk/src/fn_explicit.h
===================================================================
--- cs/cigma/trunk/src/fn_explicit.h	2008-12-10 02:13:10 UTC (rev 13520)
+++ cs/cigma/trunk/src/fn_explicit.h	2008-12-10 02:13:12 UTC (rev 13521)
@@ -6,14 +6,14 @@
 
 namespace cigma
 {
-    class ExplicitFunction;
+    class ExplicitFn;
 }
 
-class cigma::ExplicitFunction : public cigma::Function
+class cigma::ExplicitFn : public cigma::Function
 {
 public:
-    ExplicitFunction();
-    ~ExplicitFunction();
+    ExplicitFn();
+    ~ExplicitFn();
 
     int n_dim() const;
     int n_rank() const;

Added: cs/cigma/trunk/src/fn_one.cpp
===================================================================
--- cs/cigma/trunk/src/fn_one.cpp	                        (rev 0)
+++ cs/cigma/trunk/src/fn_one.cpp	2008-12-10 02:13:12 UTC (rev 13521)
@@ -0,0 +1,22 @@
+#include "fn_one.h"
+using namespace cigma;
+
+UnitScalarFn::UnitScalarFn()
+{
+    dim = 0;
+}
+
+UnitScalarFn::~UnitScalarFn()
+{
+}
+
+void UnitScalarFn::setDim(int dim)
+{
+    this->dim = dim;
+}
+
+bool UnitScalarFn::eval(double *point, double *value)
+{
+    *value = 1;
+    return true;
+}

Added: cs/cigma/trunk/src/fn_one.h
===================================================================
--- cs/cigma/trunk/src/fn_one.h	                        (rev 0)
+++ cs/cigma/trunk/src/fn_one.h	2008-12-10 02:13:12 UTC (rev 13521)
@@ -0,0 +1,31 @@
+#ifndef __CIGMA_UNIT_SCALAR_FUNCTION_H__
+#define __CIGMA_UNIT_SCALAR_FUNCTION_H__
+
+#include "Function.h"
+
+namespace cigma
+{
+    class UnitScalarFn;
+}
+
+class cigma::UnitScalarFn : public cigma::Function
+{
+public:
+
+    UnitScalarFn();
+    ~UnitScalarFn();
+
+    void setDim(int dim);
+
+    int n_dim() const;
+    int n_rank() const;
+
+    bool eval(double *point, double *value);
+
+public:
+    int dim;
+};
+
+inline int cigma::UnitScalarFn::n_dim() const { return dim; }
+inline int cigma::UnitScalarFn::n_rank() const { return 1; }
+#endif

Added: cs/cigma/trunk/src/fn_test.cpp
===================================================================
--- cs/cigma/trunk/src/fn_test.cpp	                        (rev 0)
+++ cs/cigma/trunk/src/fn_test.cpp	2008-12-10 02:13:12 UTC (rev 13521)
@@ -0,0 +1,31 @@
+#include "fn_test.h"
+using namespace cigma;
+
+
+// ----------------------------------------------------------------------------
+
+CubeFn::CubeFn() {}
+CubeFn::~CubeFn() {}
+
+bool CubeFn::eval(double *point, double *value)
+{
+    value[0] = 1 + point[0]*point[1]*point[2];
+    return true;
+}
+
+
+// ----------------------------------------------------------------------------
+
+SquareFn::SquareFn() {}
+SquareFn::~SquareFn() {}
+
+bool SquareFn::eval(double *point, double *value)
+{
+    value[0] = 1 + point[0]*point[1];
+    return true;
+}
+
+
+// ----------------------------------------------------------------------------
+
+

Added: cs/cigma/trunk/src/fn_test.h
===================================================================
--- cs/cigma/trunk/src/fn_test.h	                        (rev 0)
+++ cs/cigma/trunk/src/fn_test.h	2008-12-10 02:13:12 UTC (rev 13521)
@@ -0,0 +1,42 @@
+#ifndef __CIGMA_TEST_FUNCTIONS_H__
+#define __CIGMA_TEST_FUNCTIONS_H__
+
+#include "Function.h"
+
+namespace cigma
+{
+    class CubeFn;
+    class SquareFn;
+}
+
+
+class cigma::CubeFn : public cigma::Function
+{
+public:
+
+    CubeFn();
+    ~CubeFn();
+
+    inline int n_dim() const { return 3; }
+    inline int n_rank() const { return 1; }
+
+    bool eval(double *point, double *value);
+
+};
+
+
+class cigma::SquareFn : public cigma::Function
+{
+public:
+
+    SquareFn();
+    ~SquareFn();
+
+    inline int n_dim() const { return 2; }
+    inline int n_rank() const { return 1; }
+
+    bool eval(double *point, double *value);
+
+};
+
+#endif

Modified: cs/cigma/trunk/src/fn_zero.cpp
===================================================================
--- cs/cigma/trunk/src/fn_zero.cpp	2008-12-10 02:13:10 UTC (rev 13520)
+++ cs/cigma/trunk/src/fn_zero.cpp	2008-12-10 02:13:12 UTC (rev 13521)
@@ -24,4 +24,3 @@
     return true;
 }
 
-



More information about the CIG-COMMITS mailing list