Galerkin FEM for elliptic PDEs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rectilinearstructuredgrid.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // ===========================================================================
  2. //
  3. // Filename: rectilinearstructuredgrid.h
  4. //
  5. // Description:
  6. //
  7. // Version: 0.0
  8. // Created: 09/16/2013 01:49:40 PM
  9. // Revision: none
  10. // Compiler: Tested with g++
  11. //
  12. // Author: M. Andy Kass (MAK)
  13. //
  14. // Organisation: US Geological Survey
  15. //
  16. //
  17. // Email: mkass@usgs.gov
  18. //
  19. // This program is free software: you can redistribute it and/or modify
  20. // it under the terms of the GNU General Public License as published by
  21. // the Free Software Foundation, either version 3 of the License, or
  22. // (at your option) any later version.
  23. //
  24. // This program is distributed in the hope that it will be useful,
  25. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. // GNU General Public License for more details.
  28. //
  29. // You should have received a copy of the GNU General Public License
  30. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  31. //
  32. // ===========================================================================
  33. #ifndef __RECTILINEARSTRUCTUREDGRID_H
  34. #define __RECTILINEARSTRUCTUREDGRID_H
  35. #include "formalhaut.h"
  36. #include "structuredgrid.h"
  37. #include "exceptions.h"
  38. namespace formalhaut {
  39. // ===================================================================
  40. // Class: RectilinearStructuredGrid
  41. /// \brief
  42. /// \details
  43. // ===================================================================
  44. class RectilinearStructuredGrid : public StructuredGrid {
  45. friend std::ostream &operator<<(std::ostream &stream,
  46. const RectilinearStructuredGrid &ob);
  47. public:
  48. // ==================== LIFECYCLE =======================
  49. static RectilinearStructuredGrid* New();
  50. void Delete();
  51. // ==================== OPERATORS =======================
  52. // ==================== OPERATIONS =======================
  53. /// Compute the centroid of each vectorized cell
  54. void ComputeCentroids();
  55. /// Set the dimensions of the cells
  56. void SetCellDims(const std::vector<VectorXr>& dx3v);
  57. // ==================== ACCESS =======================
  58. /// Return actors containing the mesh (7 actors returned. 1st is
  59. /// bounding box and the next 6 are prism faces)
  60. std::vector<vtkActor*> ReturnMeshActor();
  61. // ==================== INQUIRY =======================
  62. /// Return dx,dy,dz
  63. std::vector<VectorXr> GetCellDims();
  64. /// Return a particular set of corners
  65. VectorXr GetCorners(const int& vecpos);
  66. /// Display the grid
  67. void DisplayMesh();
  68. protected:
  69. // ==================== LIFECYCLE =======================
  70. /// Default protected constructor.
  71. RectilinearStructuredGrid ();
  72. /// Default protected constructor.
  73. ~RectilinearStructuredGrid ();
  74. /// Vectorized cell widths. Not the most memory efficient, but
  75. /// efficient computationally (by that I mean I'm lazy and tired
  76. /// and this seems like the easiest way).
  77. Vector3Xr CW;
  78. // ==================== DATA MEMBERS =========================
  79. private:
  80. }; // ----- end of class RectilinearStructuredGrid -----
  81. } // end of namespace formalhaut
  82. #endif