Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85165079
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
Fri, Sep 27, 05:43
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Sep 29, 05:43 (2 d)
Engine
blob
Format
Raw Data
Handle
21132932
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