Chombo + EB  3.2
STLIF.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _STLIF_H_
12 #define _STLIF_H_
13 
14 #include <iostream>
15 #include <fstream>
16 using std::istream;
17 using std::ifstream;
18 
19 #include "MayDay.H"
20 
21 #include "BaseIF.H"
22 #include "STLExplorer.H"
23 
24 #include "NamespaceHeader.H"
25 
26 ///
27 /**
28  This implicit function reads an STL file and uses the polygonal information
29  to provide edge intersections. As such, calling it's "value" function is
30  an error. It is handled specially in "GeometryShop".
31  */
32 class STLIF: public BaseIF
33 {
34 public:
35  ///
36  /**
37  Type of data being read
38  */
39  enum DataType
40  {
41  Invalid = -1,
42  ASCII = 0,
45  };
46 
47  ///
48  /**
49  Constructor specifying filename (a_filename), the form of the data
50  (a_dataType - ASCII or Binary), level set value (a_value), and whether
51  inside the domain is where data is less than the level set value
52  (a_inside). Data is read from the file named and a complete ASCII
53  header (see above) is expected.
54  */
55  STLIF(const char* const a_filename,
56  const STLIF::DataType& a_dataType);
57 
58  /// Copy constructor
59  STLIF(const STLIF& a_inputIF);
60 
61  /// Destructor
62  virtual ~STLIF();
63 
64  ///
65  /**
66  For STLIF, calling this method is an error.
67  */
68  virtual Real value(const RealVect& a_point) const;
69 
70  virtual BaseIF* newImplicitFunction() const;
71 
72  virtual STLExplorer* getExplorer() const;
73 
74 protected:
75  void makeExplorer();
76 
77  string m_filename;
79 
81 
82 private:
84  {
85  MayDay::Abort("STLIF uses strong construction");
86  }
87 
88  void operator=(const STLIF& a_inputIF)
89  {
90  MayDay::Abort("STLIF doesn't allow assignment");
91  }
92 };
93 
94 #include "NamespaceFooter.H"
95 #endif
string m_filename
Definition: STLIF.H:77
void operator=(const STLIF &a_inputIF)
Definition: STLIF.H:88
Definition: STLIF.H:32
virtual STLExplorer * getExplorer() const
Definition: STLIF.H:41
virtual Real value(const RealVect &a_point) const
STLExplorer * m_explorer
Definition: STLIF.H:80
Definition: BaseIF.H:32
DataType
Definition: STLIF.H:39
Definition: STLExplorer.H:40
double Real
Definition: REAL.H:33
virtual ~STLIF()
Destructor.
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
void makeExplorer()
Definition: STLIF.H:42
STLIF()
Definition: STLIF.H:83
STLIF::DataType m_dataType
Definition: STLIF.H:78
Definition: STLIF.H:43
virtual BaseIF * newImplicitFunction() const
Definition: STLIF.H:44
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).