Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F66833310
reader.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
Mon, Jun 17, 22:36
Size
2 KB
Mime Type
text/x-c
Expires
Wed, Jun 19, 22:36 (2 d)
Engine
blob
Format
Raw Data
Handle
18300048
Attached To
rIOHELPER iohelper
reader.hh
View Options
/**
* @file visitor.hh
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @date Thu Nov 1 14:44:09 2012
*
* @brief reader description
*
* @section LICENSE
*
* <insert lisence here>
*
*/
#ifndef __IOHELPER_READER_H__
#define __IOHELPER_READER_H__
/* -------------------------------------------------------------------------- */
#include <map>
#include <string>
#include "iohelper_common.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_IOHELPER__
/** Class Reader
* Interface of a reader
*/
class
Reader
{
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public
:
Reader
();
virtual
~
Reader
();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
//! dump to file
virtual
void
Read
()
=
0
;
//! do the allocation
void
Init
();
//! give vector with coordinates
void
SetPoints
(
const
std
::
string
&
name
);
//! give vector with coordinates
void
SetConnectivity
(
int
elem_type
);
//! give vector to per node data
void
AddNodeDataField
(
const
std
::
string
&
name
);
//! give vector to per element data
void
AddElemDataField
(
const
char
*
name
);
//! set prefix directory
void
SetPrefix
(
const
std
::
string
&
dir
);
// ! set parallel context
void
SetParallelContext
(
int
me
,
int
wld_size
);
//! set mode
virtual
void
SetMode
(
int
mode
){
flag_compressed
=
mode
&
COMPRESSED
;}
//! give vector with coordinates
double
*
GetPoints
();
//! give vector to connectivity
int
*
GetConnectivity
();
//! give vector to per node data
double
*
GetNodeDataField
(
const
char
*
name
);
//! give vector to per element data
double
*
GetElemDataField
(
const
char
*
name
);
//! return number of read nodes
int
GetNumberNodes
();
//! return number of read elements
int
GetNumberElements
();
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected
:
std
::
string
prefix
;
std
::
string
base_name
;
int
dump_step
;
//! flag to produce zipped files
bool
flag_compressed
;
// //! vector of positions
// Field<double> * position;
// //! vector of connectivity
// Field<int> * connec;
// //! vector of additional per node data
// std::map<std::string,Field<double> *> per_node_data;
// //! vector of additional per element data
// std::map<std::string,Field<double> *> per_element_data;
int
world_size
;
int
my_rank
;
int
elem_type
;
int
connectivity_mode
;
};
__END_IOHELPER__
#endif
/* __IOHELPER_READER_H__ */
Event Timeline
Log In to Comment