Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97282911
dumpers.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jan 4, 00:58
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Jan 6, 00:58 (2 d)
Engine
blob
Format
Raw Data
Handle
23301621
Attached To
R7871 phys-743-exercises
dumpers.hh
View Options
#if defined(_MPI)
#include <mpi.h>
#endif
#ifndef DUMPERS_HH
#define DUMPERS_HH
/* -------------------------------------------------------------------------- */
class Grid;
/* -------------------------------------------------------------------------- */
class Dumper {
public:
#if defined(_MPI)
explicit Dumper(MPI_Comm communicator)
: m_min(-1.), m_max(1.), m_communicator(communicator) {}
#else
Dumper() : m_min(-1.), m_max(1.) {}
#endif
virtual void dump(const Grid & m_grid, int step) = 0;
void set_min(float min);
void set_max(float max);
float min() const;
float max() const;
protected:
float m_min, m_max;
#if defined(_MPI)
MPI_Comm m_communicator;
#endif
};
/* -------------------------------------------------------------------------- */
class DumperASCII : public Dumper {
public:
#if defined(_MPI)
explicit DumperASCII(MPI_Comm communicator) : Dumper(communicator) {}
#else
DumperASCII() : Dumper() {}
#endif
virtual void dump(const Grid & grid, int step);
};
/* -------------------------------------------------------------------------- */
class DumperBinary : public Dumper {
public:
#if defined(_MPI)
explicit DumperBinary(MPI_Comm communicator) : Dumper(communicator) {}
#else
DumperBinary() : Dumper() {}
#endif
virtual void dump(const Grid & grid, int step);
};
#endif /* DUMPERS_HH */
Event Timeline
Log In to Comment