Page MenuHomec4science

dumper.h
No OneTemporary

File Metadata

Created
Tue, Jul 30, 14:29

dumper.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 DUMPER_H
#define DUMPER_H
#include <map>
#include <string>
#include "field.h"
/** Class Dumper
* Interface of a dumper
*/
#define C_MODE 0
#define FORTRAN_MODE 1
#define TRIANGLE1 0
#define TRIANGLE2 1
#define TETRA1 2
#define TETRA2 3
#define POINT_SET 4
#define COMPRESSED 2
#define BASE64 1
#define TEXT 0
class Dumper{
public:
Dumper();
virtual ~Dumper();
//! dump to file
virtual void Dump()=0;
//! initialisation of the dumper
void Init();
//! give vector with coordinates
void SetPoints(double * points,int dimension,int nb,const char * name);
//! give vector to connectivity
void SetConnectivity(int * connectivity,int element_type,int nb_elem,int mode);
//! give vector to per node data
void AddNodeDataField(double * data,int dimension,const char * name);
//! give vector to per element data
void AddElemDataField(double * data,int dimension,const char * name);
//! set prefix directory
void SetPrefix(const char * dir);
//! set mode
virtual void SetMode(int mode){flag_compressed = mode & COMPRESSED;}
//! set embeded flag
virtual void SetEmbeddedValue(const char * name, int value)=0;
//! set rank and world size params for parallel treatment
void SetParallelContext(int me, int wld_size);
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 //DUMPERPARAVIEW_H

Event Timeline