XdmfUnstructuredGrid.hpp 6.42 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfUnstructuredGrid.hpp                                            */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

24 25
#ifndef XDMFUNSTRUCTUREDGRID_HPP_
#define XDMFUNSTRUCTUREDGRID_HPP_
26

27 28 29
// Forward Declarations
class XdmfRegularGrid;

30
// Includes
31
#include "Xdmf.hpp"
32 33 34
#include "XdmfGrid.hpp"

/**
35 36
 * @brief An unstructured grid that consists of elements, points, and
 * fields attached to the mesh.
37
 *
38 39 40 41
 * After creating an unstructured grid, the XdmfGeometry and
 * XdmfTopology must be set. The XdmfTopology describes the element
 * types contained in the grid and their connectivity. The
 * XdmfGeometry describes the positions of nodes.
42
 */
43
class XDMF_EXPORT XdmfUnstructuredGrid : public XdmfGrid {
44

45
public:
46

47
  /**
48
   * Create a new XdmfUnstructuredGrid.
49
   *
50 51 52 53
   * Example of use:
   *
   * C++
   *
54
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
55 56
   * @skipline //#initialization
   * @until //#initialization
57 58 59
   *
   * Python
   *
60
   * @dontinclude XdmfExampleUnstructuredGrid.py
61 62
   * @skipline #//initialization
   * @until #//initialization
63
   *
64
   * @return	Constructed XdmfUnstructuredGrid.
65
   */
66
  static shared_ptr<XdmfUnstructuredGrid> New();
67

68 69 70
  /**
   * Create a new XdmfUnstructuredGrid from a XdmfRegularGrid.
   *
71 72 73 74
   * Example of use:
   *
   * C++
   *
75
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
76 77
   * @skipline //#initializationregular
   * @until //#initializationregular
78 79 80
   *
   * Python
   *
81
   * @dontinclude XdmfExampleUnstructuredGrid.py
82 83
   * @skipline #//initializationregular
   * @until #//initializationregular
84
   *
85
   * @param	regularGrid	The grid that the unstructured grid will be created from
86
   *
87
   * @return			Constructed XdmfUnstructuredGrid.
88 89 90 91
   */
  static shared_ptr<XdmfUnstructuredGrid> 
  New(const shared_ptr<XdmfRegularGrid> regularGrid);

92
  virtual ~XdmfUnstructuredGrid();
93

94
  static const std::string ItemTag;
95

96 97 98
  /**
   * Get the geometry associated with this grid.
   *
99 100 101 102
   * Example of use:
   *
   * C++
   *
103
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
104 105 106 107 108 109
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setGeometry
   * @until //#setGeometry
   * @skipline //#getGeometry
   * @until //#getGeometry
110 111 112
   *
   * Python
   *
113
   * @dontinclude XdmfExampleUnstructuredGrid.py
114 115 116 117 118 119
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setGeometry
   * @until #//setGeometry
   * @skipline #//getGeometry
   * @until #//getGeometry
120
   *
121
   * @return	The geometry associated with this grid.
122
   */
123
  shared_ptr<XdmfGeometry> getGeometry();
124

125
  virtual std::string getItemTag() const;
126

127 128 129
  /**
   * Get the topology associated with this grid.
   *
130 131 132 133
   * Example of use:
   *
   * C++
   *
134
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
135 136 137 138 139 140
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setTopology
   * @until //#setTopology
   * @skipline //#getTopology
   * @until //#getTopology
141 142 143
   *
   * Python
   *
144
   * @dontinclude XdmfExampleUnstructuredGrid.py
145 146 147 148 149 150
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setTopology
   * @until #//setTopology
   * @skipline #//getTopology
   * @until #//getTopology
151
   *
152
   * @return	The topology associated with this grid.
153
   */
154
  shared_ptr<XdmfTopology> getTopology();
155

156 157 158
  /**
   * Set the geometry associated with this grid.
   *
159 160 161 162
   * Example of use:
   *
   * C++
   *
163
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
164 165 166 167
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setGeometry
   * @until //#setGeometry
168 169 170
   *
   * Python
   *
171
   * @dontinclude XdmfExampleUnstructuredGrid.py
172 173 174 175
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setGeometry
   * @until #//setGeometry
176
   *
177
   * @param	geometry	An XdmfGeometry to associate with this grid.
178
   */
179
  void setGeometry(const shared_ptr<XdmfGeometry> geometry);
180

181 182 183
  /**
   * Set the topology associated with this grid.
   *
184 185 186 187
   * Example of use:
   *
   * C++
   *
188
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
189 190 191 192
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setTopology
   * @until //#setTopology
193 194 195
   *
   * Python
   *
196
   * @dontinclude XdmfExampleUnstructuredGrid.py
197 198 199 200
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setTopology
   * @until #//setTopology
201
   *
202
   * @param	topology	An XdmfTopology to associate with this grid.
203
   */
204
  void setTopology(const shared_ptr<XdmfTopology> topology);
205

206
protected:
207

208
  XdmfUnstructuredGrid();
209
  XdmfUnstructuredGrid(const shared_ptr<XdmfRegularGrid> regularGrid);
210

211
private:
212

213 214
  XdmfUnstructuredGrid(const XdmfUnstructuredGrid &);  // Not implemented.
  void operator=(const XdmfUnstructuredGrid &);  // Not implemented.
215 216 217

};

218
#ifdef _WIN32
219
XDMF_TEMPLATE template class XDMF_EXPORT
220
shared_ptr<XdmfTopology>;
221
XDMF_TEMPLATE template class XDMF_EXPORT
222
shared_ptr<XdmfGeometry>;
223 224
#endif

225
#endif /* XDMFUNSTRUCTUREDGRID_HPP_ */