snapshotramses.h 1.81 KB
Newer Older
jcl's avatar
jcl committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// ============================================================================
// Copyright Jean-Charles LAMBERT - 2008-2012
// e-mail:   Jean-Charles.Lambert@oamp.fr
// address:  Dynamique des galaxies
//           Laboratoire d'Astrophysique de Marseille
//           Pole de l'Etoile, site de Chateau-Gombert
//           38, rue Frederic Joliot-Curie
//           13388 Marseille cedex 13 France
//           CNRS U.M.R 6110
// ============================================================================

/**
  @author Jean-Charles Lambert <Jean-Charles.Lambert@oamp.fr>
 */
#ifndef SNAPSHOTRAMSES_H
#define SNAPSHOTRAMSES_H

#include "snapshotinterface.h"
19 20
//#include "camr.h"
//#include "cpart.h"
jcl's avatar
jcl committed
21

22 23 24 25
namespace ramses {
class CAmr;
class CPart;
}
jcl's avatar
jcl committed
26 27
namespace uns {

28 29 30 31
class CParticles {
public:
  CParticles() {
    ntot=ngas=ndm,nstars=0;
jclamber's avatar
jclamber committed
32
    load_bits=0;
33 34 35 36
  }
  std::vector <float> pos,vel,mass,hsml,rho,temp,age;
  std::vector <int> indexes;
  int ntot, ngas, ndm, nstars;
jclamber's avatar
jclamber committed
37
  unsigned int load_bits;
38 39
};

jcl's avatar
jcl committed
40 41 42
class CSnapshotRamsesIn: public CSnapshotInterfaceIn {

public:
43
  CSnapshotRamsesIn(const std::string, const std::string, const std::string, const bool verb=false);
jcl's avatar
jcl committed
44

45
  ~CSnapshotRamsesIn();
jcl's avatar
jcl committed
46 47 48 49 50 51 52 53 54 55 56
  // pure virtual function implemented
  ComponentRangeVector * getSnapshotRange();
  int nextFrame(uns::UserSelection &);
  bool getData(const std::string,int *n,float **);
  bool getData(const std::string,       float * );
  bool getData(const std::string,int *n,int   **);
  bool getData(const std::string,       int   * );
  bool getData(const std::string, const std::string ,int *,float **);
  bool getData(const std::string, const std::string ,int *,int   **);
 int close();

57 58 59 60 61
private:
 ramses::CAmr * amr;
 ramses::CPart * part;
 CParticles * particles;
 bool first_loc;
jclamber's avatar
jclamber committed
62 63

 int reorderParticles(uns::UserSelection & );
jcl's avatar
jcl committed
64 65 66 67
};
}
#endif // SNAPSHOTRAMSES_H