00001 /* @HEADER@ */ 00002 // ************************************************************************ 00003 // 00004 // Sundance 00005 // Copyright (2005) Sandia Corporation 00006 // 00007 // Copyright (year first published) Sandia Corporation. Under the terms 00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 00009 // retains certain rights in this software. 00010 // 00011 // This library is free software; you can redistribute it and/or modify 00012 // it under the terms of the GNU Lesser General Public License as 00013 // published by the Free Software Foundation; either version 2.1 of the 00014 // License, or (at your option) any later version. 00015 // 00016 // This library is distributed in the hope that it will be useful, but 00017 // WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00024 // USA 00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 00026 // Sandia National Laboratories, Livermore, California, USA 00027 // 00028 // ************************************************************************ 00029 /* @HEADER@ */ 00030 00031 00032 /* 00033 * SundancePeanoMesher3D.h 00034 * 00035 * Created on: Dec 3, 2009 00036 * Author: benk 00037 */ 00038 00039 #ifndef SUNDANCE_PEANOMESHER3D_H_ 00040 #define SUNDANCE_PEANOMESHER3D_H_ 00041 00042 #include "SundanceDefs.hpp" 00043 #include "SundanceMeshSourceBase.hpp" 00044 #include "SundancePeanoMesh3D.hpp" 00045 00046 00047 namespace Sundance 00048 { 00049 class PeanoMesher3D : public MeshSourceBase 00050 { 00051 public: 00052 /** 00053 * Set up meshing, for the Peano mesh 00054 * position_x 00055 * position_y 00056 * position_z 00057 * offset_x 00058 * offset_y 00059 * offset_z 00060 * resolution, 00061 */ 00062 PeanoMesher3D(double position_x, double position_y, double position_z, 00063 double offset_x , double offset_y, double offset_z, 00064 double resolution, 00065 const MeshType& meshType, 00066 const MPIComm& comm = MPIComm::world()) 00067 : 00068 MeshSourceBase(meshType, 0, comm), 00069 _position_x(position_x), _position_y(position_y), _position_z(position_z), 00070 _offset_x(offset_x), _offset_y(offset_y), _offset_z(offset_z), 00071 _resolution(resolution) {;} 00072 00073 00074 /** Create a rectangle mesher from a ParameterList */ 00075 PeanoMesher3D(const ParameterList& params); 00076 00077 /** */ 00078 virtual ~PeanoMesher3D() {;} 00079 00080 /** Print a short descriptive std::string */ 00081 virtual std::string description() const 00082 {return "SundancePeanoMesher[pos x =" + Teuchos::toString(_position_x) 00083 + ", pos y=" + Teuchos::toString(_position_y) 00084 + ", pos z=" + Teuchos::toString(_position_z) 00085 + ", offset x=" + Teuchos::toString(_offset_x) 00086 + ", offset y=" + Teuchos::toString(_offset_y) 00087 + ", offset z=" + Teuchos::toString(_offset_z) 00088 + ", resolution=" + Teuchos::toString(_resolution)+ "]";} 00089 00090 00091 /** Return a ref count pointer to self */ 00092 virtual RCP<MeshSourceBase> getRcp() {return rcp(this);} 00093 00094 00095 protected: 00096 00097 /** The method which all Mesher should have */ 00098 virtual Mesh fillMesh() const ; 00099 00100 private: 00101 00102 /** The X coordinate of the origin point (lower left)*/ 00103 double _position_x; 00104 /** The Y coordinate of the origin point (lower left)*/ 00105 double _position_y; 00106 /** The Z coordinate of the origin point (lower left)*/ 00107 double _position_z; 00108 /** The offset (length) of the grid in the X direction*/ 00109 double _offset_x; 00110 /** The offset (length) of the grid in the Y direction*/ 00111 double _offset_y; 00112 /** The offset (length) of the grid in the Z direction*/ 00113 double _offset_z; 00114 /** The resolution in each dimension, since we do not want to have stretched elements*/ 00115 double _resolution; 00116 00117 00118 }; 00119 } 00120 #endif /* SUNDANCE_PEANOMESHER3D_H_ */