XdmfGridCollection.hpp 1.98 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 10 11 12 13 14 15 16 17 18
#include "XdmfGrid.hpp"

/**
 * @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
class XdmfGridCollection : public XdmfGrid, public XdmfDomain {
20 21 22

public:

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

30 31
	virtual ~XdmfGridCollection();

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

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

37
	std::string getItemTag() const;
38

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

46 47
	using XdmfDomain::insert;
	using XdmfGrid::insert;
48 49 50 51 52 53

	/**
	 * Set the XdmfGridCollectionType associated with this grid collection.
	 *
	 * @param collectionType the XdmfGridCollectionType to set.
	 */
54
	void setType(const boost::shared_ptr<const XdmfGridCollectionType> collectionType);
55

56
	void traverse(const boost::shared_ptr<XdmfBaseVisitor> visitor) const;
57 58 59 60 61 62 63 64 65 66 67

protected:

	XdmfGridCollection();
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems);

private:

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

68
	boost::shared_ptr<const XdmfGridCollectionType> mCollectionType;
69 70 71
};

#endif /* XDMFGRID_HPP_ */