New DEM project
authorTrevor Irons <tirons@egi.utah.edu>
Tue, 31 May 2016 22:10:17 +0000 (16:10 -0600)
committerTrevor Irons <tirons@egi.utah.edu>
Tue, 31 May 2016 22:10:17 +0000 (16:10 -0600)
CMakeLists.txt [new file with mode: 0644]
dox/README.txt [new file with mode: 0644]
examples/CMakeLists.txt [new file with mode: 0644]
examples/DEMGrain.cpp [new file with mode: 0644]
include/.DEMParticle.h.swp [new file with mode: 0644]
include/DEM4Core [new file with mode: 0644]
include/DEMParticle.h [new file with mode: 0644]
src/.DEMObject.cpp.swp [new file with mode: 0644]
src/CMakeLists.txt [new file with mode: 0644]
src/DEMParticle.cpp [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..dd8c346
--- /dev/null
@@ -0,0 +1,17 @@
+if (LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT)
+       include_directories(${CMAKE_INSTALL_PREFIX}/include)
+
+       include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/include" )
+       add_subdirectory("src")
+
+       add_library( dem4core ${DEMSOURCE} )  
+       target_link_libraries(dem4core "lemmacore")
+
+       install ( TARGETS dem4core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
+
+       if (LEMMA_BUILD_EXAMPLES)
+               add_subdirectory(examples)
+       endif()
+else()
+       message( STATUS "DEM requires Lemma to be build with VTK" )
+endif()
diff --git a/dox/README.txt b/dox/README.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3a96ab8
--- /dev/null
@@ -0,0 +1,6 @@
+add_executable( DEMGrain DEMGrain.cpp  )
+target_link_libraries(  DEMGrain  "lemmacore" "dem4core")
+
+INSTALL_TARGETS( "/share/DEM/"
+       DEMGrain 
+)
diff --git a/examples/DEMGrain.cpp b/examples/DEMGrain.cpp
new file mode 100644 (file)
index 0000000..9dbb979
--- /dev/null
@@ -0,0 +1,30 @@
+/* This file is part of Lemma, a geophysical modelling and inversion API.
+ * More information is available at http://lemmasoftware.org
+ */
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/**
+ * @file
+ * @date      05/31/2016 12:27:49 PM
+ * @version   $Id$
+ * @author    Trevor Irons (ti)
+ * @email     tirons@egi.utah.edu
+ * @copyright Copyright (c) 2016, University of Utah
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
+ */
+
+
+#include "Lemma"
+#include "DEM4Core"
+using namespace Lemma;
+
+
+int main()
+{
+    std::cout << "Hello DEM" << std::endl;
+}
+
diff --git a/include/.DEMParticle.h.swp b/include/.DEMParticle.h.swp
new file mode 100644 (file)
index 0000000..1fd44fa
Binary files /dev/null and b/include/.DEMParticle.h.swp differ
diff --git a/include/DEM4Core b/include/DEM4Core
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/include/DEMParticle.h b/include/DEMParticle.h
new file mode 100644 (file)
index 0000000..a065ce8
--- /dev/null
@@ -0,0 +1,103 @@
+/* This file is part of Lemma, a geophysical modelling and inversion API.
+ * More information is available at http://lemmasoftware.org
+ */
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/**
+ * @file
+ * @date      05/31/2016 01:31:28 PM
+ * @version   $Id$
+ * @author    Trevor Irons (ti)
+ * @email     tirons@egi.utah.edu
+ * @copyright Copyright (c) 2016, University of Utah
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
+ */
+
+#ifndef  DEMPARTICLE_INC
+#define  DEMPARTICLE_INC
+
+#include "LemmaObject.h"
+
+namespace Lemma {
+
+    /**
+      \brief
+      \details
+     */
+    class DEMParticle : public LemmaObject {
+
+        friend std::ostream &operator<<(std::ostream &stream,
+                const DEMParticle &ob);
+
+        public:
+
+        // ====================  LIFECYCLE     =======================
+
+        /**
+         * @copybrief LemmaObject::New()
+         * @copydetails LemmaObject::New()
+         */
+        static DEMParticle* New();
+
+        /**
+         *  @copybrief   LemmaObject::Delete()
+         *  @copydetails LemmaObject::Delete()
+         */
+        void Delete();
+
+        // ====================  OPERATORS     =======================
+
+        // ====================  OPERATIONS    =======================
+
+        // ====================  ACCESS        =======================
+
+        // ====================  INQUIRY       =======================
+
+#ifdef HAVE_YAMLCPP
+        /**
+         *  Uses YAML to serialize this object.
+         *  @return a YAML::Node
+         */
+        YAML::Node Serialize() const;
+
+        /**
+         *   Constructs an object from a YAML::Node.
+         */
+        static DEMParticle* DeSerialize(const YAML::Node& node);
+#endif
+
+        protected:
+
+        // ====================  LIFECYCLE     =======================
+
+        /** Default protected constructor, use New */
+        DEMParticle (const std::string& name);
+
+#ifdef HAVE_YAMLCPP
+        /** Protected DeDerializing constructor, use factory DeSerialize  method*/
+        DEMParticle (const YAML::Node& node);
+#endif
+
+        /** Default protected destructor, use Delete */
+        ~DEMParticle ();
+
+        /**
+         *  @copybrief   LemmaObject::Release()
+         *  @copydetails LemmaObject::Release()
+         */
+        void Release();
+
+        private:
+
+        // ====================  DATA MEMBERS  =========================
+
+    }; // -----  end of class  DEMParticle  -----
+
+}              // -----  end of Lemma  name  -----
+
+#endif   // ----- #ifndef DEMPARTICLE_INC  -----
+
diff --git a/src/.DEMObject.cpp.swp b/src/.DEMObject.cpp.swp
new file mode 100644 (file)
index 0000000..c9f2c8c
Binary files /dev/null and b/src/.DEMObject.cpp.swp differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3307769
--- /dev/null
@@ -0,0 +1,5 @@
+set (DEMSOURCE
+       ${DEMSOURCE}
+       ${CMAKE_CURRENT_SOURCE_DIR}/DEMParticle.cpp
+       PARENT_SCOPE
+)
diff --git a/src/DEMParticle.cpp b/src/DEMParticle.cpp
new file mode 100644 (file)
index 0000000..7ccae17
--- /dev/null
@@ -0,0 +1,124 @@
+/* This file is part of Lemma, a geophysical modelling and inversion API.
+ * More information is available at http://lemmasoftware.org
+ */
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/**
+ * @file
+ * @date      05/31/2016 12:27:31 PM
+ * @version   $Id$
+ * @author    Trevor Irons (ti)
+ * @email     tirons@egi.utah.edu
+ * @copyright Copyright (c) 2016, University of Utah
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
+ */
+
+#include "DEMParticle.h"
+
+namespace Lemma {
+
+// ====================  FRIEND METHODS  =====================
+#ifdef HAVE_YAMLCPP
+std::ostream &operator << (std::ostream &stream, const DEMParticle &ob) {
+    stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
+    return stream;
+}
+#else
+std::ostream &operator<<(std::ostream &stream, const DEMParticle& ob) {
+    stream << *(LemmaObject*)(&ob);
+    return stream;
+}
+#endif
+
+// ====================  LIFECYCLE     =======================
+
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  DEMParticle
+// Description:  constructor (protected)
+//--------------------------------------------------------------------------------------
+DEMParticle::DEMParticle (const std::string& name) : LemmaObject(name) {
+
+}  // -----  end of method DEMParticle::DEMParticle  (constructor)  -----
+
+#ifdef HAVE_YAMLCPP
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  DEMParticle
+// Description:  DeSerializing constructor (protected)
+//--------------------------------------------------------------------------------------
+DEMParticle::DEMParticle (const YAML::Node& node) : LemmaObject(node) {
+
+}  // -----  end of method DEMParticle::DEMParticle  (constructor)  -----
+#endif
+
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  New()
+// Description:  public constructor
+//--------------------------------------------------------------------------------------
+DEMParticle* DEMParticle::New() {
+    DEMParticle*  Obj = new DEMParticle("DEMParticle");
+    Obj->AttachTo(Obj);
+    return Obj;
+}
+
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  ~DEMParticle
+// Description:  destructor (protected)
+//--------------------------------------------------------------------------------------
+DEMParticle::~DEMParticle () {
+
+}  // -----  end of method DEMParticle::~DEMParticle  (destructor)  -----
+
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  Delete
+// Description:  public destructor
+//--------------------------------------------------------------------------------------
+void DEMParticle::Delete() {
+    this->DetachFrom(this);
+}
+
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  Release
+// Description:  destructor (protected)
+//--------------------------------------------------------------------------------------
+void DEMParticle::Release() {
+    delete this;
+}
+
+
+#ifdef HAVE_YAMLCPP
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  Serialize
+//--------------------------------------------------------------------------------------
+YAML::Node  DEMParticle::Serialize (  ) const {
+    YAML::Node node = LemmaObject::Serialize();;
+    node.SetTag( this->Name );
+    // FILL IN CLASS SPECIFICS HERE
+    return node;
+}              // -----  end of method DEMParticle::Serialize  -----
+
+
+//--------------------------------------------------------------------------------------
+//       Class:  DEMParticle
+//      Method:  DeSerialize
+//--------------------------------------------------------------------------------------
+DEMParticle* DEMParticle::DeSerialize ( const YAML::Node& node  ) {
+    DEMParticle* Object = new DEMParticle(node);
+    Object->AttachTo(Object);
+    DESERIALIZECHECK( node, Object )
+        return Object ;
+}              // -----  end of method DEMParticle::DeSerialize  -----
+#endif
+
+}              // -----  end of Lemma  name  -----
+