ESyS-Particle  2.2
InteractionToStressConverter.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2013 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 
14 #ifndef ESYS_LSMINTERACTIONTOSTRESSCONVERTOR_H
15 #define ESYS_LSMINTERACTIONTOSTRESSCONVERTOR_H
16 
22 
23 #include "Foundation/BoundingBox.h"
24 
25 #include <iostream>
26 #include <iomanip>
27 
28 namespace std
29 {
30  template <>
31  struct less<Vec3>
32  {
33  bool operator()(const Vec3 &v1, const Vec3 &v2) const
34  {
35  return esys::lsm::Vec3XyzComparer()(v1, v2);
36  }
37  };
38 }
39 
40 namespace esys
41 {
42  namespace lsm
43  {
47 
49  {
50  public:
53 
54  InteractionToStressConverter(const BoundingBox &box, double gridSpacing);
55 
60  void addRaw2Interactions(std::istream &iStream);
61 
66  void writeVtkUnstructuredXml(std::ostream &oStream);
67 
68  void writeVtkUnstructuredXmlGridInformation(std::ostream &oStream);
69 
81  void writeVtkStructuredXml(std::ostream &oStream);
82 
85 
97 
98  void calcTensorRegularGrid();
99 
113 
114  void calcDevRegularGrid();
115 
124  void writeFlatStructured(std::ostream &oStream);
125 
135  (
136  std::ostream &oStream
137  );
138 
145  void writeUnstructuredDx(std::ostream &oStream);
146 
147  double getMaxRadius();
148 
149  protected:
150  double getRealDevStress(const Tensor &stressTensor) const;
151  double getNormDevStress(const Tensor &stressTensor) const;
152 
153  bool is3d() const;
154 
155  private:
163  };
164  }
165 }
166 #endif