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.

DEMGrain.cpp 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 12:27:49 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. #include "LemmaCore"
  18. #include "DEM4Core"
  19. using namespace Lemma;
  20. int main()
  21. {
  22. auto Grain = DEMGrain::NewSP();
  23. Grain->SetCentreMass( (Vector3r() << 2.254,3.14,4.).finished() );
  24. std::cout << *Grain << std::endl;
  25. YAML::Node ng = Grain->Serialize();
  26. auto Grain3 = DEMGrain::NewSP();
  27. std::cout << Grain3->GetName() << std::endl;
  28. std::cout << ((DEMParticle*)(Grain3.get()))->GetName() << std::endl;
  29. auto Grain4 = DEMParticle::NewSP();
  30. std::cout << Grain4->GetName() << std::endl;
  31. //Vector3r pos; pos << 2,3,4;
  32. //Grain->SetCentreMass( pos );
  33. //auto Grain2 = DEMParticle::DeSerialize(ng);
  34. //std::cout << *Grain2 << std::endl;
  35. /*
  36. if ( *Grain2 != *Grain) {
  37. std::cout << "Not Equal" << std::endl;
  38. }
  39. */
  40. }