From 63dc76ff15c1c8660f30e1ff1cfcb9c2f04db814 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Tue, 1 Aug 2023 12:00:50 +0200 Subject: Refactoring: instantiate WarpX class via MakeWarpX function (#4104) * move functions from main to WarpX class and make WarpX constructible only using factory method * instantiate WarpX via MakeWarpX static member function * test adding MakeWarpX to warpx_init in python wrapper * revert to the use of a simple pointer for the WarpX instance * fix issue * use finalize in python wrapper * change finalize order * move finalize * fix bug --- Source/main.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'Source/main.cpp') diff --git a/Source/main.cpp b/Source/main.cpp index b889bb24a..3051539d8 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -11,7 +11,6 @@ #include "Initialization/WarpXAMReXInit.H" #include "Utils/WarpXProfilerWrapper.H" #include "Utils/WarpXrocfftUtil.H" -#include "Utils/WarpXUtil.H" #include #include @@ -27,22 +26,13 @@ int main(int argc, char* argv[]) utils::rocfft::setup(); - ParseGeometryInput(); - - ConvertLabParamsToBoost(); - ReadBCParams(); - -#ifdef WARPX_DIM_RZ - CheckGriddingForRZSpectral(); -#endif - { WARPX_PROFILE_VAR("main()", pmain); auto timer = ablastr::utils::timer::Timer{}; timer.record_start_time(); - WarpX warpx; + auto& warpx = WarpX::GetInstance(); warpx.InitData(); @@ -58,6 +48,8 @@ int main(int argc, char* argv[]) } WARPX_PROFILE_VAR_STOP(pmain); + + WarpX::Finalize(); } utils::rocfft::cleanup(); -- cgit v1.2.3