@@ -54,6 +54,31 @@ namespace hemelb::configuration {
5454        std::shared_ptr<util::UnitConverter> unit_converter;
5555
5656    public: 
57+         template  <typename  TraitsT>
58+         static  std::unique_ptr<SimulationMaster> CreateSim (
59+                 CommandLine const & options,
60+                 net::IOCommunicator const & ioComms
61+         ) {
62+             auto  ans = std::unique_ptr<SimulationMaster>(new  SimulationMaster (ioComms));
63+             //  Start the main timer!
64+             ans->timings .total ().Start ();
65+ 
66+             ans->fileManager  = std::make_shared<configuration::PathManager>(
67+                     options,
68+                     ioComms.OnIORank (),
69+                     ioComms.Size ()
70+             );
71+             auto && infile = ans->fileManager ->GetInputFile ();
72+             log::Logger::Log<log::Info, log::Singleton>(" Reading configuration from %s"  , infile.c_str ());
73+             //  Convert XML to configuration
74+             ans->simConfig  = configuration::SimConfig::New (infile);
75+             //  Use it to initialise self
76+             auto  builder = configuration::SimBuilder (ans->simConfig );
77+             log::Logger::Log<log::Info, log::Singleton>(" Beginning Initialisation."  );
78+             builder.build <TraitsT>(*ans);
79+             return  ans;
80+         }
81+ 
5782        explicit  SimBuilder (SimConfig const & conf, bool  construct_unit_converter = true );
5883        virtual  ~SimBuilder () = default ;
5984
@@ -111,7 +136,7 @@ namespace hemelb::configuration {
111136        ) const ;
112137
113138        [[nodiscard]] std::shared_ptr<reporting::Reporter> BuildReporter (
114-                 io:: PathManager const & fileManager,
139+                 PathManager const & fileManager,
115140                std::vector<reporting::Reportable*> const  & reps
116141        ) const ;
117142    };
@@ -299,8 +324,6 @@ namespace hemelb::configuration {
299324    [[nodiscard]] std::shared_ptr<net::IteratedAction> SimBuilder::BuildCellController (SimulationMaster const & control, reporting::Timers& timings) const  {
300325        if  (config.HasRBCSection ()) {
301326#ifdef  HEMELB_BUILD_RBC
302-             using  traitsType = typename  T::Traits;
303- 
304327            auto  ccb = redblood::CellControllerBuilder (unit_converter);
305328
306329            auto & ioComms = control.ioComms ;
@@ -324,4 +347,4 @@ namespace hemelb::configuration {
324347        return  {};
325348    }
326349}
327- #endif 
350+ #endif 
0 commit comments