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

4 5 6
// Forward Declarations
class XdmfGridCollectionType;

7
// Includes
8
#include "XdmfDomain.hpp"
9
#include "XdmfGrid.hpp"
10 11 12 13 14 15 16 17 18

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

public:

24 25 26 27 28
	/**
	 * Create a new XdmfGridCollection.
	 *
	 * @return constructed XdmfGridCollection.
	 */
29
	static boost::shared_ptr<XdmfGridCollection> New();
30

31 32
	virtual ~XdmfGridCollection();

33
	LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid)
34
	static const std::string ItemTag;
35 36 37

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

38
	std::string getItemTag() const;
39

40 41 42 43 44 45 46
	/**
	 * Get the XdmfGridCollectionType associated with this grid collection.
	 *
	 * @return XdmfGridCollectionType of this collection.
	 */
	boost::shared_ptr<const XdmfGridCollectionType> getType() const;

47 48
	using XdmfDomain::insert;
	using XdmfGrid::insert;
49

50 51 52 53 54 55 56
	/**
	 * Insert an information into the grid collection (needed to use virtual inheritance correctly).
	 *
	 * @param information an XdmfInformation to attach to this item.
	 */
	void insert(const boost::shared_ptr<XdmfInformation> information);

57 58 59
	/**
	 * Set the XdmfGridCollectionType associated with this grid collection.
	 *
60
	 * @param type the XdmfGridCollectionType to set.
61
	 */
62
	void setType(const boost::shared_ptr<const XdmfGridCollectionType> type);
63

64 65
	void traverse(const boost::shared_ptr<XdmfBaseVisitor> visitor);

66 67 68
protected:

	XdmfGridCollection();
69
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
70 71 72 73 74 75

private:

	XdmfGridCollection(const XdmfGridCollection & collection);  // Not implemented.
	void operator=(const XdmfGridCollection & collection);  // Not implemented.

76
	boost::shared_ptr<const XdmfGridCollectionType> mType;
77 78 79
};

#endif /* XDMFGRID_HPP_ */