From 5287af96ebbb94ce4211577d099a8b98cf93daab Mon Sep 17 00:00:00 2001 From: hamidrezanorouzi Date: Tue, 6 Dec 2022 18:50:47 +0330 Subject: [PATCH] DEMsystems initialize finalize --- DEMSystems/CMakeLists.txt | 2 +- DEMSystems/sphereDEMSystem/sphereDEMSystem.C | 64 +++++++++++++++++++- DEMSystems/sphereDEMSystem/sphereDEMSystem.H | 32 ++++++++-- solvers/sphereGranFlow/createDEMComponents.H | 2 +- 4 files changed, 92 insertions(+), 8 deletions(-) diff --git a/DEMSystems/CMakeLists.txt b/DEMSystems/CMakeLists.txt index dde2d20a..d9f7c681 100644 --- a/DEMSystems/CMakeLists.txt +++ b/DEMSystems/CMakeLists.txt @@ -3,7 +3,7 @@ set(SourceFiles sphereDEMSystem/sphereDEMSystem.C ) -set(link_libs Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction) +set(link_libs Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction Utilities) pFlow_add_library_install(DEMSystems SourceFiles link_libs) diff --git a/DEMSystems/sphereDEMSystem/sphereDEMSystem.C b/DEMSystems/sphereDEMSystem/sphereDEMSystem.C index 91e345b6..f9a85f4d 100644 --- a/DEMSystems/sphereDEMSystem/sphereDEMSystem.C +++ b/DEMSystems/sphereDEMSystem/sphereDEMSystem.C @@ -21,7 +21,67 @@ Licence: #include "sphereDEMSystem.H" -pFlow::sphereDEMSystem::sphereDEMSystem() +pFlow::sphereDEMSystem::sphereDEMSystem(int argc, char* argv[]) +: + ControlDict_() { + + Report(0)<<"Initializing host/device execution spaces . . . \n"; + Report(1)<<"Host execution space is "<< greenText(DefaultHostExecutionSpace::name())<( + ControlDict_.startTime(), + ControlDict_.endTime(), + ControlDict_.saveInterval(), + ControlDict_.startTimeName()); + + Report(0)<<"\nReading proprties . . . "<( + Control().caseSetup().path()+propertyFile__); + + Report(0)<< "\nCreating surface geometry for sphereDEMSystem . . . "<(Control(), Property()); + + + //Report(0)<<"\nCreating particle insertion for spheres. . ."<( + objectFile( + insertionFile__, + "", + objectFile::READ_ALWAYS, + objectFile::WRITE_ALWAYS + ), + sphParticles, + sphParticles.shapes() + );*/ + + Report(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."< + #include "systemControl.H" #include "property.H" #include "uniquePtr.H" @@ -28,6 +30,9 @@ Licence: #include "sphereParticles.H" #include "interaction.H" #include "Insertions.H" +#include "readControlDict.H" + + namespace pFlow @@ -36,8 +41,10 @@ namespace pFlow class sphereDEMSystem { protected: + + readControlDict ControlDict_; - systemControl Control_; + uniquePtr Control_ = nullptr; uniquePtr property_ = nullptr; @@ -45,13 +52,15 @@ protected: uniquePtr particles_ = nullptr; + uniquePtr insertion_ = nullptr; + uniquePtr interaction_ = nullptr; - uniquePtr insertion_ = nullptr; + auto& Control() { - return Control_; + return Control_(); } auto& Property() @@ -76,7 +85,22 @@ protected: public: - sphereDEMSystem(); + sphereDEMSystem(int argc, char* argv[]); + + ~sphereDEMSystem(); + + sphereDEMSystem(const sphereDEMSystem&)=delete; + + sphereDEMSystem& operator = (const sphereDEMSystem&)=delete; + + + std::array g()const + { + return { + Control_->g().x(), + Control_->g().y(), + Control_->g().z()}; + } }; diff --git a/solvers/sphereGranFlow/createDEMComponents.H b/solvers/sphereGranFlow/createDEMComponents.H index eabbd732..a407a9e1 100755 --- a/solvers/sphereGranFlow/createDEMComponents.H +++ b/solvers/sphereGranFlow/createDEMComponents.H @@ -38,7 +38,7 @@ auto& sphInsertion = -Report(0)<<"\nCreating interation model for sphere-sphere contact and sphere-wall contact . . ."<