XdmfGridCollection.hpp 4.09 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 38 39 40 41 42

/**
 * @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.
 */
43
class XDMF_EXPORT XdmfGridCollection : public XdmfDomain,
44
	public XdmfGrid {
45 46 47

public:

48 49 50 51 52
	/**
	 * Create a new XdmfGridCollection.
	 *
	 * @return constructed XdmfGridCollection.
	 */
53
	static boost::shared_ptr<XdmfGridCollection> New();
54

55 56
	virtual ~XdmfGridCollection();

57
	LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid)
58
	static const std::string ItemTag;
59 60 61

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

62
	std::string getItemTag() const;
63

64 65 66 67 68 69 70
	/**
	 * Get the XdmfGridCollectionType associated with this grid collection.
	 *
	 * @return XdmfGridCollectionType of this collection.
	 */
	boost::shared_ptr<const XdmfGridCollectionType> getType() const;

71 72
	using XdmfDomain::insert;
	using XdmfGrid::insert;
73

74 75 76 77 78 79 80
	/**
	 * 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);

81 82 83
	/**
	 * Set the XdmfGridCollectionType associated with this grid collection.
	 *
84
	 * @param type the XdmfGridCollectionType to set.
85
	 */
86
	void setType(const boost::shared_ptr<const XdmfGridCollectionType> type);
87

88 89
	void traverse(const boost::shared_ptr<XdmfBaseVisitor> visitor);

90 91 92
protected:

	XdmfGridCollection();
93
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
94 95 96 97 98 99

private:

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

100
	boost::shared_ptr<const XdmfGridCollectionType> mType;
101 102
};

103 104 105 106
#ifdef _WIN32
    XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfGridCollectionType>;
#endif

107
#endif /* XDMFGRID_HPP_ */