~esys-p-dev/esys-particle/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/////////////////////////////////////////////////////////////
//                                                         //
// Copyright (c) 2003-2014 by The University of Queensland //
// Centre for Geoscience Computing                         //
// http://earth.uq.edu.au/centre-geoscience-computing      //
//                                                         //
// Primary Business: Brisbane, Queensland, Australia       //
// Licensed under the Open Software License version 3.0    //
// http://www.opensource.org/licenses/osl-3.0.php          //
//                                                         //
/////////////////////////////////////////////////////////////

#ifndef __FRAC_H
#define __FRAC_H

#include "graph.h"
#include <map>
#include <set>
#include <iostream>
#include <string>

using std::map;
using std::multimap;
using std::set;
using std::ostream;
using std::string;

class Frac
{
 private:
  multimap<int,int> m_old_grain_map;
  multimap<int,int> m_new_grain_to_particle_map;
  map<int,int> m_new_grain_map;
  map<int,set<int> > m_grain_to_grain_map;
  map<int,int> m_tag_map;
  map<int,double> m_old_grain_mass_map;
  map<int,double> m_new_grain_mass_map;

  map<int,Vec3> get_move_vectors(const Graph&);
  map<int,double> get_grain_mass(const Graph&);

 public:
  Frac(const Graph&, const Graph&);

  void writeMassRatio(ostream&,double);
  int writeAllMass(ostream&,double,int,bool with_tag=false);
  void writeAsVtk(const string&,float,const Graph&,bool);
  pair<double,double> getSplitAbrasion(Graph&, double,double);
};
#endif //__FRAC_H