Skip to content

Commit

Permalink
Added flags to compile with default amrex (i.e. no openpmd-api support)
Browse files Browse the repository at this point in the history
  • Loading branch information
guj committed Dec 14, 2023
1 parent 64d5030 commit 082e755
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Source/Diagnostics/Diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
# include "FlushFormats/FlushFormatOpenPMD.H"
#endif
#include "FlushFormats/FlushFormatPlotfile.H"
// possibly find a flag for PlotPlus?

#ifdef AMREX_USE_OPENPMD_API
#include "FlushFormats/FlushFormatPlotPlus.H"
#endif

#include "FlushFormats/FlushFormatSensei.H"
#include "Particles/MultiParticleContainer.H"
#include "Utils/Algorithms/IsIn.H"
Expand Down Expand Up @@ -479,7 +482,12 @@ Diagnostics::InitBaseData ()
if (m_format == "plotfile"){
m_flush_format = std::make_unique<FlushFormatPlotfile>() ;
} else if (m_format == "plotplus"){
#ifdef AMREX_USE_OPENPMD_API
m_flush_format = std::make_unique<FlushFormatPlotPlus>() ;
#else
WARPX_ABORT_WITH_MESSAGE(
"To use plotplus output format, need to compile AMReX with openpmd support");
#endif
} else if (m_format == "checkpoint"){
// creating checkpoint format
m_flush_format = std::make_unique<FlushFormatCheckpoint>() ;
Expand Down
3 changes: 2 additions & 1 deletion Source/Diagnostics/FlushFormats/FlushFormatPlotPlus.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <AMReX_PlotFileUtil.H> // for AMReXWithOpenPMD
#include <AMReX_MultiFab.H> // for StoreMesh's multi fab

#ifdef AMREX_USE_OPENPMD_API
class AMReXWithOpenPMD
{
public:
Expand Down Expand Up @@ -116,5 +117,5 @@ public:
) const;

};

#endif // AMREX_USE_OPENPMD_API
#endif // WARPX_FLUSHFORMATPLOTPLUS_H_
5 changes: 5 additions & 0 deletions Source/Diagnostics/FlushFormats/FlushFormatPlotPlus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#include <vector>


#ifdef AMREX_USE_OPENPMD_API


#include "warpxWriter.H"
#include "warpxBTD.H"

Expand Down Expand Up @@ -423,3 +426,5 @@ void AMReXWithOpenPMD::StoreMesh (const Vector<const MultiFab*> &mf,
geom,
time);
}

#endif //#ifdef AMREX_USE_OPENPMD_API

0 comments on commit 082e755

Please sign in to comment.