Discrete Element Methods (Alpha)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DEMParticle.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 05/31/2016 01:31:28 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2016, University of Utah
  15. * @copyright Copyright (c) 2016, Lemma Software, LLC
  16. */
  17. #ifndef DEMPARTICLE_INC
  18. #define DEMPARTICLE_INC
  19. #include "LemmaObject.h"
  20. namespace Lemma {
  21. /**
  22. \brief
  23. \details
  24. */
  25. class DEMParticle : public LemmaObject {
  26. friend std::ostream &operator<<(std::ostream &stream,
  27. const DEMParticle &ob);
  28. public:
  29. // ==================== LIFECYCLE =======================
  30. /**
  31. * Factory method for generating concrete class.
  32. * @return a std::shared_ptr of type DEMParticle
  33. */
  34. static std::shared_ptr< DEMParticle > NewSP();
  35. // ==================== OPERATORS =======================
  36. // ==================== OPERATIONS =======================
  37. // ==================== ACCESS =======================
  38. void SetCentreMass( const Vector3r& pos );
  39. Vector3r GetCentreMass( );
  40. // ==================== INQUIRY =======================
  41. #ifdef HAVE_YAMLCPP
  42. /**
  43. * Uses YAML to serialize this object.
  44. * @return a YAML::Node
  45. */
  46. YAML::Node Serialize() const;
  47. /**
  48. * Constructs an object from a YAML::Node.
  49. */
  50. static std::shared_ptr< DEMParticle > DeSerialize(const YAML::Node& node);
  51. #endif
  52. protected:
  53. // ==================== LIFECYCLE =======================
  54. /** Default protected constructor, use New */
  55. DEMParticle (const std::string& name);
  56. #ifdef HAVE_YAMLCPP
  57. /** Protected DeDerializing constructor, use factory DeSerialize method*/
  58. DEMParticle (const YAML::Node& node);
  59. #endif
  60. /** Default protected destructor, use Delete */
  61. ~DEMParticle ();
  62. private:
  63. // ==================== DATA MEMBERS =========================
  64. Vector3r centreMass;
  65. }; // ----- end of class DEMParticle -----
  66. } // ----- end of Lemma name -----
  67. #endif // ----- #ifndef DEMPARTICLE_INC -----