XdmfRegularGrid.hpp 5.45 KB
 1 2 ``````#ifndef XDMFREGULARGRID_HPP_ #define XDMFREGULARGRID_HPP_ `````` Kenneth Leiter committed Sep 16, 2010 3 `````` `````` Kenneth Leiter committed Oct 26, 2010 4 5 6 ``````// Forward Declarations class XdmfArray; `````` Kenneth Leiter committed Sep 16, 2010 7 ``````// Includes `````` Brian Panneton committed Jan 03, 2011 8 ``````#include "Xdmf.hpp" `````` Kenneth Leiter committed Sep 16, 2010 9 10 11 ``````#include "XdmfGrid.hpp" /** `````` Kenneth Leiter committed Oct 07, 2010 12 `````` * @brief A regular grid consisting of congruent points arranged regularly in space. `````` Kenneth Leiter committed Sep 16, 2010 13 `````` * `````` 14 `````` * XdmfRegularGrid represents a regular mesh of congruent points arranged in space. `````` Kenneth Leiter committed Sep 16, 2010 15 16 17 18 19 20 `````` * In order to define a regular grid, three sets of terms need to be supplied: * * Brick Size (Dx, Dy, (Dz)) - Size of an individual brick. * Dimensions (X, Y, (Z)) - Number of points in X, Y, and Z directions * Origin Location (X, Y, (Z)) - Location of the origin of the mesh in space. */ `````` Brian Panneton committed Jan 03, 2011 21 ``````class XDMF_EXPORT XdmfRegularGrid : public XdmfGrid { `````` Kenneth Leiter committed Sep 16, 2010 22 23 24 25 26 27 `````` public: /** * Create a new structured grid (Two dimensional). * `````` Kenneth Leiter committed Oct 07, 2010 28 29 30 31 32 33 `````` * @param xBrickSize the size of the brick in the x direction. * @param yBrickSize the size of the brick in the y direction. * @param xNumPoints the number of points in the x direction. * @param yNumPoints the number of points in the y direction. * @param xOrigin the x coordinate of the origin. * @param yOrigin the y coordinate of the origin. `````` Kenneth Leiter committed Sep 16, 2010 34 35 36 `````` * * @return constructed structured grid. */ `````` 37 `````` static boost::shared_ptr New(const double xBrickSize, const double yBrickSize, const unsigned int xNumPoints, `````` Kenneth Leiter committed Oct 07, 2010 38 `````` const unsigned int yNumPoints, const double xOrigin, const double yOrigin); `````` Kenneth Leiter committed Sep 16, 2010 39 40 41 42 `````` /** * Create a new structured grid (Three dimensional). * `````` Kenneth Leiter committed Oct 07, 2010 43 44 45 46 47 48 49 50 51 `````` * @param xBrickSize the size of the brick in the x direction. * @param yBrickSize the size of the brick in the y direction. * @param zBrickSize the size of the brick in the z direction. * @param xNumPoints the number of points in the x direction. * @param yNumPoints the number of points in the y direction. * @param zNumPoints the number of points in the z direction. * @param xOrigin the x coordinate of the origin. * @param yOrigin the y coordinate of the origin. * @param zOrigin the z coordinate of the origin. `````` Kenneth Leiter committed Sep 16, 2010 52 53 54 `````` * * @return constructed structured grid. */ `````` 55 `````` static boost::shared_ptr New(const double xBrickSize, const double yBrickSize, const double zBrickSize, `````` Kenneth Leiter committed Oct 07, 2010 56 57 `````` const unsigned int xNumPoints, const unsigned int yNumPoints, const unsigned int zNumPoints, const double xOrigin, const double yOrigin, const double zOrigin); `````` Kenneth Leiter committed Sep 16, 2010 58 `````` `````` 59 60 61 62 63 64 65 66 67 `````` /** * Create a new structured grid (N dimensional). * * @param brickSize the size of the brick in each direction. * @param numPoints the number of points in each direction. * @param origin the coordinates of the origin. * * @return constructed structured grid. */ `````` 68 `````` static boost::shared_ptr New(const boost::shared_ptr brickSize, const boost::shared_ptr numPoints, `````` 69 70 `````` const boost::shared_ptr origin); `````` 71 `````` virtual ~XdmfRegularGrid(); `````` Kenneth Leiter committed Sep 16, 2010 72 `````` `````` 73 `````` LOKI_DEFINE_VISITABLE(XdmfRegularGrid, XdmfGrid) `````` Kenneth Leiter committed Sep 16, 2010 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 `````` static const std::string ItemTag; /** * Get the size of the points composing the grid. * * @return XdmfArray containing brick sizes for this grid. */ boost::shared_ptr getBrickSize(); /** * Get the size of the points composing the grid (const version). * * @return XdmfArray containing brick sizes for this grid. */ boost::shared_ptr getBrickSize() const; /** * Get the dimensions of the grid, the number of points in each direction. * * @return XdmfArray containing dimensions of this grid. */ boost::shared_ptr getDimensions(); /** `````` 98 `````` * Get the dimensions of the grid, the number of points in each direction (const version). `````` Kenneth Leiter committed Sep 16, 2010 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 `````` * * @return XdmfArray containing the dimensions of this grid. */ boost::shared_ptr getDimensions() const; /** * Get the location of the origin of the grid. * * @return XdmfArray containing the location of the origin of the grid. */ boost::shared_ptr getOrigin(); /** * Get the location of the origin of the grid. * `````` 114 `````` * @return XdmfArray containing the location of the origin of the grid (const version). `````` Kenneth Leiter committed Sep 16, 2010 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 `````` */ boost::shared_ptr getOrigin() const; /** * Set the size of the points composing the grid. * * @param brickSize the sizes of the points composing the mesh. This should * have the same number of terms as the dimensionality of the mesh. */ void setBrickSize(const boost::shared_ptr brickSize); /** * 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 dimensions); /** * Set the origin of the grid. * * @param origin location of the origin of the grid. This should have * the same number of terms as the dimensionality of the mesh. */ void setOrigin(const boost::shared_ptr origin); protected: `````` 143 `````` XdmfRegularGrid(const boost::shared_ptr brickSize, const boost::shared_ptr numPoints, `````` 144 145 `````` const boost::shared_ptr origin); `````` Kenneth Leiter committed Sep 16, 2010 146 `````` void populateItem(const std::map & itemProperties, std::vector > & childItems, const XdmfCoreReader * const reader); `````` Kenneth Leiter committed Sep 16, 2010 147 148 149 150 151 152 `````` private: /** * PIMPL */ `````` 153 `````` class XdmfRegularGridImpl; `````` Kenneth Leiter committed Sep 16, 2010 154 `````` `````` 155 156 `````` XdmfRegularGrid(const XdmfRegularGrid & grid); // Not implemented. void operator=(const XdmfRegularGrid & grid); // Not implemented. `````` Kenneth Leiter committed Sep 16, 2010 157 `````` `````` 158 `````` XdmfRegularGridImpl * mImpl; `````` Kenneth Leiter committed Sep 16, 2010 159 160 161 `````` }; `````` Brian Panneton committed Jan 03, 2011 162 163 164 165 166 ``````#ifdef _WIN32 XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr; XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr; #endif `````` 167 ``#endif /* XDMFREGULARGRID_HPP_ */``