XdmfGridCurvilinear.hpp 3.31 KB
Newer Older
1 2 3
#ifndef XDMFGRIDCURVILINEAR_HPP_
#define XDMFGRIDCURVILINEAR_HPP_

4 5 6
// Forward Declarations
class XdmfArray;

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
// Includes
#include "XdmfGrid.hpp"

/**
 * @brief A curvilinear (or structured) grid consisting of cells and points arranged on a regular lattice in space.
 *
 * XdmfGridCurvilinear represents a mesh of cells and points arranged with regular topology in space.  A curvilinear grid
 * contains regular topology but irregular geometry.
 *
 * In order to define a curvilinear grid, the dimensions of the grid must be supplied and the coordinates of each point
 * must be specified.
 *
 */
class XdmfGridCurvilinear : public XdmfGrid {

public:

	/**
	 * Create a new curvilinear grid (Two dimensional).
	 *
	 * @param xNumPoints the number of points in the x direction.
	 * @param yNumPoints the number of points in the y direction.
	 *
	 * @return constructed curvilinear grid.
	 */
	static boost::shared_ptr<XdmfGridCurvilinear> New(const unsigned int xNumPoints, const unsigned int yNumPoints);

	/**
	 * Create a new curvilinear grid (Three dimensional).
	 *
	 * @param xNumPoints the number of points in the x direction.
	 * @param yNumPoints the number of points in the y direction.
	 * @param yNumPoints the number of points in the z direction.
	 *
	 * @return constructed curvilinear grid.
	 */
	static boost::shared_ptr<XdmfGridCurvilinear> New(const unsigned int xNumPoints, const unsigned int yNumPoints,
		const unsigned int zNumPounts);

	/**
	 * Create a new curvilinear grid (N dimensional).
	 *
	 * @param numPoints the number of points in each direction.
	 *
	 * @return constructed curvilinear grid.
	 */
	static boost::shared_ptr<XdmfGridCurvilinear> New(const boost::shared_ptr<XdmfArray> numPoints);

	virtual ~XdmfGridCurvilinear();

	LOKI_DEFINE_VISITABLE(XdmfGridCurvilinear, XdmfGrid)
	static const std::string ItemTag;

	/**
	 * Get the dimensions of the grid, the number of points in each direction.
	 *
	 * @return XdmfArray containing dimensions of this grid.
	 */
	boost::shared_ptr<XdmfArray> getDimensions();

	/**
	 * Get the dimensions of the grid, the number of points in each direction (const version).
	 *
	 * @return XdmfArray containing the dimensions of this grid.
	 */
	boost::shared_ptr<const XdmfArray> getDimensions() const;

74 75 76 77 78 79 80
	/**
	 * Get the geometry associated with this grid.
	 *
	 * @return the geometry associated with this grid.
	 */
	boost::shared_ptr<XdmfGeometry> getGeometry();

81 82 83 84 85 86 87
	/**
	 * Set the dimensions of the grid, the number of points in each direction.
	 *
	 * @param dimensions the dimension of the grid.
	 */
	void setDimensions(const boost::shared_ptr<XdmfArray> dimensions);

88 89 90 91 92 93 94
	/**
	 * Set the geometry associated with this grid.
	 *
	 * @param geometry an XdmfGeometry to associate with this grid.
	 */
	void setGeometry(const boost::shared_ptr<XdmfGeometry> geometry);

95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
protected:

	XdmfGridCurvilinear(const boost::shared_ptr<XdmfArray> numPoints);

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

private:

	/**
	 * PIMPL
	 */
	class XdmfGridCurvilinearImpl;

	XdmfGridCurvilinear(const XdmfGridCurvilinear & grid);  // Not implemented.
	void operator=(const XdmfGridCurvilinear & grid);  // Not implemented.

	XdmfGridCurvilinearImpl * mImpl;

};

#endif /* XDMFGRIDRECTILINEAR_HPP_ */