XdmfGridCollection.hpp 2.42 KB
Newer Older
1
2
3
#ifndef XDMFGRIDCOLLECTION_HPP_
#define XDMFGRIDCOLLECTION_HPP_

4
5
6
// Forward Declarations
class XdmfGridCollectionType;

7
// Includes
8
#include "Xdmf.hpp"
9
#include "XdmfDomain.hpp"
10
#include "XdmfGrid.hpp"
11
12
13
14

/**
 * @brief A spatial or temporal collection of XdmfGrids.
 *
15
16
17
18
 * 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.
19
 *
20
21
 * It is valid to nest collections. A spatial collection inside a
 * temporal collection is commonly used.
22
 */
23
class XDMF_EXPORT XdmfGridCollection : public XdmfDomain,
24
                                       public XdmfGrid {
25

26
 public:
27

28
29
30
31
32
33
  /**
   * Create a new XdmfGridCollection.
   *
   * @return constructed XdmfGridCollection.
   */
  static boost::shared_ptr<XdmfGridCollection> New();
34

35
  virtual ~XdmfGridCollection();
36

37
38
  LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid);
  static const std::string ItemTag;
39

40
  std::map<std::string, std::string> getItemProperties() const;
41

42
  std::string getItemTag() const;
43

44
45
46
47
48
49
  /**
   * Get the XdmfGridCollectionType associated with this grid collection.
   *
   * @return XdmfGridCollectionType of this collection.
   */
  boost::shared_ptr<const XdmfGridCollectionType> getType() const;
50

51
52
  using XdmfDomain::insert;
  using XdmfGrid::insert;
53

54
  /**
55
   * Insert an information into the grid collection.
56
57
58
59
   *
   * @param information an XdmfInformation to attach to this item.
   */
  void insert(const boost::shared_ptr<XdmfInformation> information);
60

61
  /**
62
63
   * Set the XdmfGridCollectionType associated with this grid
   * collection.
64
65
66
67
   *
   * @param type the XdmfGridCollectionType to set.
   */
  void setType(const boost::shared_ptr<const XdmfGridCollectionType> type);
68

69
  void traverse(const boost::shared_ptr<XdmfBaseVisitor> visitor);
70

71
 protected:
72

73
  XdmfGridCollection();
74

75
76
77
78
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
               std::vector<boost::shared_ptr<XdmfItem> > & childItems,
               const XdmfCoreReader * const reader);
79

80
 private:
81

82
83
84
85
  XdmfGridCollection(const XdmfGridCollection &);  // Not implemented.
  void operator=(const XdmfGridCollection &);  // Not implemented.

  boost::shared_ptr<const XdmfGridCollectionType> mType;
86
87
};

88
#ifdef _WIN32
89
90
XDMF_TEMPLATE template class XDMF_EXPORT
boost::shared_ptr<const XdmfGridCollectionType>;
91
92
#endif

93
#endif /* XDMFGRID_HPP_ */