aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index a6e4f06a1..f5826fd93 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -232,11 +232,25 @@ bool WarpX::do_device_synchronize = false;
WarpX* WarpX::m_instance = nullptr;
+void WarpX::MakeWarpX ()
+{
+ ParseGeometryInput();
+
+ ConvertLabParamsToBoost();
+ ReadBCParams();
+
+#ifdef WARPX_DIM_RZ
+ CheckGriddingForRZSpectral();
+#endif
+
+ m_instance = new WarpX();
+}
+
WarpX&
WarpX::GetInstance ()
{
if (!m_instance) {
- m_instance = new WarpX();
+ MakeWarpX();
}
return *m_instance;
}
@@ -244,14 +258,20 @@ WarpX::GetInstance ()
void
WarpX::ResetInstance ()
{
- delete m_instance;
- m_instance = nullptr;
+ if (m_instance){
+ delete m_instance;
+ m_instance = nullptr;
+ }
}
-WarpX::WarpX ()
+void
+WarpX::Finalize()
{
- m_instance = this;
+ WarpX::ResetInstance();
+}
+WarpX::WarpX ()
+{
ReadParameters();
BackwardCompatibility();
@@ -304,12 +324,6 @@ WarpX::WarpX ()
// Particle Boundary Buffer (i.e., scraped particles on boundary)
m_particle_boundary_buffer = std::make_unique<ParticleBoundaryBuffer>();
- // Diagnostics
- multi_diags = std::make_unique<MultiDiagnostics>();
-
- /** create object for reduced diagnostics */
- reduced_diags = std::make_unique<MultiReducedDiags>();
-
Efield_aux.resize(nlevs_max);
Bfield_aux.resize(nlevs_max);