XdmfGridCollection.hpp 4.08 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 : XdmfGridCollection.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 26
#ifndef XDMFGRIDCOLLECTION_HPP_
#define XDMFGRIDCOLLECTION_HPP_

27 28 29
// Forward Declarations
class XdmfGridCollectionType;

30
// Includes
31
#include "Xdmf.hpp"
32
#include "XdmfDomain.hpp"
33
#include "XdmfGrid.hpp"
34 35 36 37

/**
 * @brief A spatial or temporal collection of XdmfGrids.
 *
38 39 40 41
 * A temporal collection is timestep data.  Each child grid represents
 * the state at a single timestep.  A spatial collection consists of
 * XdmfGrids that are arranged together in space. E.g. a partitioned
 * mesh.
42
 *
43 44
 * It is valid to nest collections. A spatial collection inside a
 * temporal collection is commonly used.
45
 */
46
class XDMF_EXPORT XdmfGridCollection : public XdmfDomain,
47
                                       public XdmfGrid {
48

49
public:
50

51 52 53 54 55
  /**
   * Create a new XdmfGridCollection.
   *
   * @return constructed XdmfGridCollection.
   */
56
  static shared_ptr<XdmfGridCollection> New();
57

58
  virtual ~XdmfGridCollection();
59

60 61
  LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid);
  static const std::string ItemTag;
62

63
  std::map<std::string, std::string> getItemProperties() const;
64

65
  std::string getItemTag() const;
66

67 68 69 70 71
  /**
   * Get the XdmfGridCollectionType associated with this grid collection.
   *
   * @return XdmfGridCollectionType of this collection.
   */
72
  shared_ptr<const XdmfGridCollectionType> getType() const;
73

74 75
  using XdmfDomain::insert;
  using XdmfGrid::insert;
76

77
  /**
78
   * Insert an information into the grid collection.
79 80 81
   *
   * @param information an XdmfInformation to attach to this item.
   */
82
  void insert(const shared_ptr<XdmfInformation> information);
83

84
  /**
85 86
   * Set the XdmfGridCollectionType associated with this grid
   * collection.
87 88 89
   *
   * @param type the XdmfGridCollectionType to set.
   */
90
  void setType(const shared_ptr<const XdmfGridCollectionType> type);
91

92
  void traverse(const shared_ptr<XdmfBaseVisitor> visitor);
93

94
protected:
95

96
  XdmfGridCollection();
97

98 99
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
100
               std::vector<shared_ptr<XdmfItem> > & childItems,
101
               const XdmfCoreReader * const reader);
102

103
private:
104

105 106 107
  XdmfGridCollection(const XdmfGridCollection &);  // Not implemented.
  void operator=(const XdmfGridCollection &);  // Not implemented.

108
  shared_ptr<const XdmfGridCollectionType> mType;
109 110
};

111
#ifdef _WIN32
112
XDMF_TEMPLATE template class XDMF_EXPORT
113
shared_ptr<const XdmfGridCollectionType>;
114 115
#endif

116
#endif /* XDMFGRID_HPP_ */