Page MenuHomec4science

reader.h
No OneTemporary

File Metadata

Created
Tue, Jul 30, 14:29

reader.h

/*
Copyright 2008 Guillaume ANCIAUX (guillaume.anciaux@epfl.ch)
This file is part of ParaViewHelper.
ParaViewHelper is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ParaViewHelper is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ParaViewHelper. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef READER_H
#define READER_H
#include <map>
#include <string>
#include "field.h"
/** Class Reader
* Interface of a reader
*/
#define C_MODE 0
#define FORTRAN_MODE 1
#define TRIANGLE1 0
#define TRIANGLE2 1
#define TETRA1 2
#define TETRA2 3
#define POINT_SET 4
class Reader{
public:
Reader();
virtual ~Reader();
//! dump to file
virtual void Read()=0;
//! do the allocation
void Init();
//! give vector with coordinates
void SetPoints(const char * name);
//! give vector with coordinates
void SetConnectivity(int elem_type);
//! give vector to per node data
void AddNodeDataField(const char *name);
//! give vector to per element data
void AddElemDataField(const char *name);
//! set prefix directory
void SetPrefix(const char *dir);
// ! set parallel context
void SetParallelContext(int me, int wld_size);
//! 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();
protected:
char prefix[255];
char base_name[255];
int dump_step;
//! flag to produce zipped files
bool flag_compressed;
//! vector of positions
Field * position;
//! vector of connectivity
Field * connec;
//! vector of additional per node data
std::map<std::string,Field *> per_node_data;
//! vector of additional per element data
std::map<std::string,Field *> per_element_data;
int world_size;
int my_rank;
int elem_type;
int connectivity_mode;
};
#endif //READERPARAVIEW_H

Event Timeline