SundanceHNMesher3D.hpp
Go to the documentation of this file.
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 #ifndef SUNDANCE_HNMESHER3D_H_
00032 #define SUNDANCE_HNMESHER3D_H_
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMeshSourceBase.hpp"
00036 #include "SundanceHNMesh3D.hpp"
00037 #include "SundanceRefinementBase.hpp"
00038 #include "SundanceRefinementClass.hpp"
00039 #include "SundanceDomainDefinition.hpp"
00040 
00041 namespace Sundance
00042 {
00043   /** forward declaration */
00044   class RefinementClass;
00045   class MeshDomainDef;
00046 
00047 class HNMesher3D : public MeshSourceBase
00048   {
00049   public:
00050     /**     */
00051   HNMesher3D(
00052          double position_x , double position_y , double position_z,
00053                double offset_x , double offset_y, double offset_z,
00054                int resolution_x , int resolution_y , int resolution_z,
00055                const MeshType& meshType,
00056                const MPIComm& comm = MPIComm::world())
00057       :
00058     MeshSourceBase(meshType, 0, comm),
00059       _position_x(position_x), _position_y(position_y), _position_z(position_z),
00060       _offset_x(offset_x), _offset_y(offset_y), _offset_z(offset_z),
00061       _resolution_x(resolution_x) , _resolution_y(resolution_y) , _resolution_z(resolution_z) ,
00062       refineClass_(dummyRefineClass_) ,
00063       meshDomain_(dummyMeshDomain_) {;}
00064 
00065     /**     */
00066   HNMesher3D(
00067          double position_x, double position_y, double position_z,
00068                double offset_x , double offset_y, double offset_z,
00069                int resolution_x , int resolution_y , int resolution_z ,
00070                const MeshType& meshType,
00071                const RefinementClass& refineClass ,
00072                const MPIComm& comm = MPIComm::world())
00073       :
00074     MeshSourceBase(meshType, 0, comm),
00075       _position_x(position_x), _position_y(position_y),_position_z(position_z),
00076       _offset_x(offset_x), _offset_y(offset_y), _offset_z(offset_z),
00077       _resolution_x(resolution_x) , _resolution_y(resolution_y) ,_resolution_z(resolution_z) ,
00078       refineClass_(refineClass) ,
00079       meshDomain_(dummyMeshDomain_) {;}
00080 
00081     /**     */
00082   HNMesher3D(
00083          double position_x, double position_y, double position_z,
00084                double offset_x , double offset_y, double offset_z,
00085                int resolution_x , int resolution_y , int resolution_z ,
00086                const MeshType& meshType,
00087                const MeshDomainDef& meshDomain ,
00088                const MPIComm& comm = MPIComm::world())
00089       :
00090     MeshSourceBase(meshType, 0,comm),
00091       _position_x(position_x), _position_y(position_y), _position_z(position_z),
00092       _offset_x(offset_x), _offset_y(offset_y), _offset_z(offset_z),
00093       _resolution_x(resolution_x) , _resolution_y(resolution_y) , _resolution_z(resolution_z) ,
00094       refineClass_(dummyRefineClass_) ,
00095       meshDomain_(meshDomain) {;}
00096 
00097     /**     */
00098   HNMesher3D(
00099          double position_x, double position_y,  double position_z,
00100                double offset_x , double offset_y, double offset_z,
00101                int resolution_x , int resolution_y , int resolution_z ,
00102                const MeshType& meshType,
00103                const RefinementClass& refineClass ,
00104                const MeshDomainDef& meshDomain ,
00105                const MPIComm& comm = MPIComm::world())
00106       :
00107     MeshSourceBase(meshType, 0, comm),
00108       _position_x(position_x), _position_y(position_y), _position_z(position_z),
00109       _offset_x(offset_x), _offset_y(offset_y), _offset_z(offset_z),
00110       _resolution_x(resolution_x) , _resolution_y(resolution_y) , _resolution_z(resolution_z) ,
00111       refineClass_(refineClass) ,
00112       meshDomain_(meshDomain) {;}
00113 
00114     /** Create a rectangle mesher from a ParameterList */
00115   HNMesher3D(const ParameterList& params);
00116 
00117     /** */
00118     virtual ~HNMesher3D() {;}
00119 
00120     /** Print a short descriptive std::string */
00121     virtual std::string description() const
00122     {return "HNMesher3D[pos x =" + Teuchos::toString(_position_x)
00123        + ", pos y=" + Teuchos::toString(_position_y)
00124        + ", pos z=" + Teuchos::toString(_position_z)
00125        + ", offset x=" + Teuchos::toString(_offset_x) +
00126        + ", offset y=" + Teuchos::toString(_offset_y)
00127        + ", offset z=" + Teuchos::toString(_offset_z)
00128        + ", resolution_x=" + Teuchos::toString(_resolution_x)
00129        + ", resolution_y=" + Teuchos::toString(_resolution_y)
00130        + ", resolution_z=" + Teuchos::toString(_resolution_z)
00131        +"]";}
00132 
00133 
00134     /** Return a ref count pointer to self */
00135     virtual RCP<MeshSourceBase> getRcp() {return rcp(this);}
00136 
00137 
00138   protected:
00139 
00140     /** The method which all Mesher should have */
00141     virtual Mesh fillMesh() const ;
00142 
00143   private:
00144 
00145     /** X coordinate of the origin point (lower left)*/
00146     double _position_x;
00147     /** Y coordinate of the origin point (lower left)*/
00148     double _position_y;
00149     /** Z coordinate of the origin point (lower left)*/
00150     double _position_z;
00151     /** offset (length) of the grid in the X direction*/
00152     double _offset_x;
00153     /** offset (length) of the grid in the Y direction*/
00154     double _offset_y;
00155     /** offset (length) of the grid in the Z direction*/
00156     double _offset_z;
00157     /** On the coarse level the resolution on the X axis */
00158     int _resolution_x;
00159     /** On the coarse level the resolution on the Y axis */
00160     int _resolution_y;
00161     /** On the coarse level the resolution on the Z axis */
00162     int _resolution_z;
00163 
00164     /** refinement class */
00165     const RefinementClass refineClass_;
00166 
00167     /** mesh domain (which must not coincide with the whole mesh)*/
00168     const MeshDomainDef meshDomain_;
00169 
00170 
00171     /** static dummy class if the user does not provide refinement class */
00172     static const RefinementClass dummyRefineClass_;
00173 
00174     /** static domain class if the user does not provide one */
00175     static const MeshDomainDef dummyMeshDomain_;
00176   };
00177 }
00178 #endif /* SUNDANCE_HNMESHER3D_H_ */

Site Contact