XdmfUnstructuredGrid.hpp 5.61 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 55
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
   * @skipline New
56 57 58
   *
   * Python
   *
59 60
   * @dontinclude XdmfExampleUnstructuredGrid.py
   * @skipline New
61
   *
62
   * @return constructed XdmfUnstructuredGrid.
63
   */
64
  static shared_ptr<XdmfUnstructuredGrid> New();
65

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

90
  virtual ~XdmfUnstructuredGrid();
91

92
  static const std::string ItemTag;
93

94 95 96
  /**
   * Get the geometry associated with this grid.
   *
97 98 99 100
   * Example of use:
   *
   * C++
   *
101
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
102
   * @skipline Assuming
103
   * @skipline getGeometry
104 105 106
   *
   * Python
   *
107
   * @dontinclude XdmfExampleUnstructuredGrid.py
108
   * @skipline Assuming
109
   * @skipline getGeometry
110
   *
111 112
   * @return the geometry associated with this grid.
   */
113
  shared_ptr<XdmfGeometry> getGeometry();
114

115
  virtual std::string getItemTag() const;
116

117 118 119
  /**
   * Get the topology associated with this grid.
   *
120 121 122 123
   * Example of use:
   *
   * C++
   *
124
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
125
   * @skipline Assuming
126
   * @skipline getTopology
127 128 129
   *
   * Python
   *
130
   * @dontinclude XdmfExampleUnstructuredGrid.py
131
   * @skipline Assuming
132
   * @skipline getTopology
133
   *
134 135
   * @return the topology associated with this grid.
   */
136
  shared_ptr<XdmfTopology> getTopology();
137

138 139 140
  /**
   * Set the geometry associated with this grid.
   *
141 142 143 144
   * Example of use:
   *
   * C++
   *
145 146 147 148
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
   * @skipline New
   * @skipline newGeometry
   * @until setGeometry
149 150 151
   *
   * Python
   *
152 153 154 155
   * @dontinclude XdmfExampleUnstructuredGrid.py
   * @skipline New
   * @skipline newGeometry
   * @until setGeometry
156
   *
157 158
   * @param geometry an XdmfGeometry to associate with this grid.
   */
159
  void setGeometry(const shared_ptr<XdmfGeometry> geometry);
160

161 162 163
  /**
   * Set the topology associated with this grid.
   *
164 165 166 167
   * Example of use:
   *
   * C++
   *
168 169 170 171
   * @dontinclude ExampleXdmfUnstructuredGrid.cpp
   * @skipline New
   * @skipline newTopology
   * @until setTopology
172 173 174
   *
   * Python
   *
175 176 177 178
   * @dontinclude XdmfExampleUnstructuredGrid.py
   * @skipline New
   * @skipline newTopology
   * @until setTopology
179
   *
180 181
   * @param topology an XdmfTopology to associate with this grid.
   */
182
  void setTopology(const shared_ptr<XdmfTopology> topology);
183

184
protected:
185

186
  XdmfUnstructuredGrid();
187
  XdmfUnstructuredGrid(const shared_ptr<XdmfRegularGrid> regularGrid);
188

189
private:
190

191 192
  XdmfUnstructuredGrid(const XdmfUnstructuredGrid &);  // Not implemented.
  void operator=(const XdmfUnstructuredGrid &);  // Not implemented.
193 194 195

};

196
#ifdef _WIN32
197
XDMF_TEMPLATE template class XDMF_EXPORT
198
shared_ptr<XdmfTopology>;
199
XDMF_TEMPLATE template class XDMF_EXPORT
200
shared_ptr<XdmfGeometry>;
201 202
#endif

203
#endif /* XDMFUNSTRUCTUREDGRID_HPP_ */