Discrete Element Methods (Alpha)
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

DEMGrain.cpp 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 = DEMParticle::NewSP();
  23. Grain->SetCentreMass( (Vector3r() << 2,3,4).finished() );
  24. std::cout << *Grain << std::endl;
  25. YAML::Node ng = Grain->Serialize();
  26. //Vector3r pos; pos << 2,3,4;
  27. //Grain->SetCentreMass( pos );
  28. auto Grain2 = DEMParticle::DeSerialize(ng);
  29. std::cout << *Grain2 << std::endl;
  30. if ( Grain2 != Grain) {
  31. std::cout << "Not Equal" << std::endl;
  32. }
  33. }