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 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. /**
  36. * Uses YAML to serialize this object.
  37. * @return a YAML::Node
  38. */
  39. YAML::Node Serialize() const;
  40. /**
  41. * Constructs an object from a YAML::Node.
  42. */
  43. static std::shared_ptr< DEMParticle > DeSerialize(const YAML::Node& node);
  44. // ==================== OPERATORS =======================
  45. // ==================== OPERATIONS =======================
  46. // ==================== ACCESS =======================
  47. void SetCentreMass( const Vector3r& pos );
  48. /** Accessor to centre of Mass */
  49. Vector3r GetCentreMass( );
  50. /** Convience accessor to a single corrdinate of the centre of mass
  51. */
  52. Real GetCentreMass( const int& icord );
  53. // ==================== INQUIRY =======================
  54. /** Returns the name of the underlying class, similiar to Python's type */
  55. virtual inline std::string GetName() const {
  56. return this->CName;
  57. }
  58. protected:
  59. // ==================== LIFECYCLE =======================
  60. /** Default protected constructor, use New */
  61. DEMParticle ( );
  62. /** Protected DeDerializing constructor, use factory DeSerialize method*/
  63. DEMParticle (const YAML::Node& node);
  64. /** Default protected destructor, use Delete */
  65. ~DEMParticle ();
  66. private:
  67. /** ASCII string representation of the class name */
  68. static constexpr auto CName = "DEMParticle";
  69. // ==================== DATA MEMBERS =========================
  70. Vector3r centreMass;
  71. }; // ----- end of class DEMParticle -----
  72. } // ----- end of Lemma name -----
  73. #endif // ----- #ifndef DEMPARTICLE_INC -----
  74. /* vim: set tabstop=4 expandtab: */
  75. /* vim: set filetype=cpp: */