XdmfUnstructuredGrid.hpp 3.93 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
   * @return constructed XdmfUnstructuredGrid.
51
   */
52
  static shared_ptr<XdmfUnstructuredGrid> New();
53

54 55 56 57 58 59 60 61
  /**
   * Create a new XdmfUnstructuredGrid from a XdmfRegularGrid.
   *
   * @return constructed XdmfUnstructuredGrid.
   */
  static shared_ptr<XdmfUnstructuredGrid> 
  New(const shared_ptr<XdmfRegularGrid> regularGrid);

62
  virtual ~XdmfUnstructuredGrid();
63

64
  static const std::string ItemTag;
65

66 67 68 69 70
  /**
   * Get the geometry associated with this grid.
   *
   * @return the geometry associated with this grid.
   */
71
  shared_ptr<XdmfGeometry> getGeometry();
72

73
  virtual std::string getItemTag() const;
74

75 76 77 78 79
  /**
   * Get the topology associated with this grid.
   *
   * @return the topology associated with this grid.
   */
80
  shared_ptr<XdmfTopology> getTopology();
81

82 83 84 85 86
  /**
   * Set the geometry associated with this grid.
   *
   * @param geometry an XdmfGeometry to associate with this grid.
   */
87
  void setGeometry(const shared_ptr<XdmfGeometry> geometry);
88

89 90 91 92 93
  /**
   * Set the topology associated with this grid.
   *
   * @param topology an XdmfTopology to associate with this grid.
   */
94
  void setTopology(const shared_ptr<XdmfTopology> topology);
95

96
protected:
97

98
  XdmfUnstructuredGrid();
99
  XdmfUnstructuredGrid(const shared_ptr<XdmfRegularGrid> regularGrid);
100

101
private:
102

103 104
  XdmfUnstructuredGrid(const XdmfUnstructuredGrid &);  // Not implemented.
  void operator=(const XdmfUnstructuredGrid &);  // Not implemented.
105 106 107

};

108
#ifdef _WIN32
109
XDMF_TEMPLATE template class XDMF_EXPORT
110
shared_ptr<XdmfTopology>;
111
XDMF_TEMPLATE template class XDMF_EXPORT
112
shared_ptr<XdmfGeometry>;
113 114
#endif

115
#endif /* XDMFUNSTRUCTUREDGRID_HPP_ */