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

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


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

Modified:
   cs/cigma/trunk/src/core_args.cpp
   cs/cigma/trunk/src/core_args.h
Log:
Argument information for building a function object

Modified: cs/cigma/trunk/src/core_args.cpp
===================================================================
--- cs/cigma/trunk/src/core_args.cpp	2008-12-10 02:13:56 UTC (rev 13546)
+++ cs/cigma/trunk/src/core_args.cpp	2008-12-10 02:13:58 UTC (rev 13547)
@@ -26,6 +26,7 @@
     cell_type_name = other.cell_type_name;
 }
 
+/*
 DataPath MeshInfo::get_nc_path() const
 {
     // allow override
@@ -58,7 +59,13 @@
     }
     return path;
 }
+// */
 
+MeshInfo::operator bool() const
+{
+    return p_mesh || p_nc || p_eb || (cell_type_name != "");
+}
+
 // ----------------------------------------------------------------------------
 
 QuadratureInfo::QuadratureInfo() {}
@@ -80,6 +87,7 @@
     cell_type_name = other.cell_type_name;
 }
 
+/*
 bool QuadratureInfo::single_source() const
 {
     const bool q = !p_quadrature.empty();
@@ -95,12 +103,19 @@
     const bool no_q = p_quadrature.empty();
     return no_q && (w && x);
 }
+// */
 
+/*
 QuadratureInfo::operator bool() const
 {
     const bool s = this->single_source();
     const bool d = this->double_source();
     return (s && !d) || (!s && d);
+} // */
+
+QuadratureInfo::operator bool() const
+{
+    return p_quadrature || p_weights || p_points || (cell_type_name != "");
 }
 
 // ----------------------------------------------------------------------------
@@ -122,6 +137,11 @@
     p_fe_basis_jet = other.p_fe_basis_jet;
 }
 
+FE_Info::operator bool() const
+{
+    return q_info || p_fe_basis || p_fe_basis_jet;
+}
+
 // ----------------------------------------------------------------------------
 
 FieldInfo::FieldInfo() {}
@@ -141,4 +161,26 @@
     mesh_info = other.mesh_info;
 }
 
+FieldInfo::operator bool() const
+{
+    return p_field || fe_info || mesh_info;
+}
+
 // ----------------------------------------------------------------------------
+
+FunctionInfo::FunctionInfo() {}
+FunctionInfo::~FunctionInfo() {}
+
+FunctionInfo::FunctionInfo(const FunctionInfo& other)
+{
+    fn_name = other.fn_name;
+    field_info = other.field_info;
+}
+
+FunctionInfo& FunctionInfo::operator=(const FunctionInfo& other)
+{
+    fn_name = other.fn_name;
+    field_info = other.field_info;
+}
+
+// ----------------------------------------------------------------------------

Modified: cs/cigma/trunk/src/core_args.h
===================================================================
--- cs/cigma/trunk/src/core_args.h	2008-12-10 02:13:56 UTC (rev 13546)
+++ cs/cigma/trunk/src/core_args.h	2008-12-10 02:13:58 UTC (rev 13547)
@@ -21,8 +21,9 @@
         ~MeshInfo();
         MeshInfo(const MeshInfo& other);
         MeshInfo& operator=(const MeshInfo& other);
-        DataPath get_nc_path() const;
-        DataPath get_eb_path() const;
+        operator bool() const;
+        //DataPath get_nc_path() const;
+        //DataPath get_eb_path() const;
         //bool single_file() const;
         //FileReader::ReaderType get_nc_reader_type() const;
         //FileReader::ReaderType get_eb_reader_type() const;
@@ -40,9 +41,9 @@
         ~QuadratureInfo();
         QuadratureInfo(const QuadratureInfo& other);
         QuadratureInfo& operator=(const QuadratureInfo& other);
-        bool single_source() const;
-        bool double_source() const;
         operator bool() const;
+        ////bool single_source() const;
+        ////bool double_source() const;
         //DataPath get_weights_path() const;
         //DataPath get_points_path() const;
         //FileReader::ReaderType get_weights_reader_type() const;
@@ -60,6 +61,7 @@
         ~FE_Info();
         FE_Info(const FE_Info& other);
         FE_Info& operator=(const FE_Info& other);
+        operator bool() const;
     };
 
 
@@ -73,9 +75,20 @@
         ~FieldInfo();
         FieldInfo(const FieldInfo& other);
         FieldInfo& operator=(const FieldInfo& other);
+        operator bool() const;
     };
 
+    struct FunctionInfo
+    {
+        std::string fn_name;
+        FieldInfo field_info;
 
+        FunctionInfo();
+        ~FunctionInfo();
+        FunctionInfo(const FunctionInfo& other);
+        FunctionInfo& operator=(const FunctionInfo& other);
+    };
+
 }
 
 



More information about the CIG-COMMITS mailing list