00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 #ifndef SUNDANCE_HNMESHER2D_H_
00032 #define SUNDANCE_HNMESHER2D_H_
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMeshSourceBase.hpp"
00036 #include "SundanceHNMesh2D.hpp"
00037 #include "SundanceRefinementBase.hpp"
00038 #include "SundanceRefinementClass.hpp"
00039 #include "SundanceDomainDefinition.hpp"
00040 
00041 namespace Sundance
00042 {
00043 
00044 class RefinementClass;
00045 class MeshDomainDef;
00046 
00047 class HNMesher2D : public MeshSourceBase
00048 {
00049 public:
00050 
00051   HNMesher2D(
00052     double position_x, double position_y,
00053     double offset_x , double offset_y,
00054     int resolution_x , int resolution_y ,
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),
00060     _offset_x(offset_x), _offset_y(offset_y),
00061     _resolution_x(resolution_x) , _resolution_y(resolution_y) ,
00062     refineClass_(dummyRefineClass_) ,
00063     meshDomain_(dummyMeshDomain_) {;}
00064 
00065 
00066   HNMesher2D(
00067     double position_x, double position_y,
00068     double offset_x , double offset_y,
00069     int resolution_x , int resolution_y ,
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),
00076     _offset_x(offset_x), _offset_y(offset_y),
00077     _resolution_x(resolution_x) , _resolution_y(resolution_y) ,
00078     refineClass_(refineClass) ,
00079     meshDomain_(dummyMeshDomain_) {;}
00080 
00081 
00082   HNMesher2D(
00083     double position_x, double position_y,
00084     double offset_x , double offset_y,
00085     int resolution_x , int resolution_y ,
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),
00092     _offset_x(offset_x), _offset_y(offset_y),
00093     _resolution_x(resolution_x) , _resolution_y(resolution_y) ,
00094     refineClass_(dummyRefineClass_) ,
00095     meshDomain_(meshDomain) {;}
00096 
00097 
00098   HNMesher2D(
00099     double position_x, double position_y,
00100     double offset_x , double offset_y,
00101     int resolution_x , int resolution_y ,
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),
00109     _offset_x(offset_x), _offset_y(offset_y),
00110     _resolution_x(resolution_x) , _resolution_y(resolution_y) ,
00111     refineClass_(refineClass) ,
00112     meshDomain_(meshDomain) {;}
00113 
00114 
00115   HNMesher2D(const ParameterList& params);
00116 
00117 
00118   virtual ~HNMesher2D() {;}
00119 
00120 
00121   virtual std::string description() const
00122     {return "HNMesher2D[pos x =" + Teuchos::toString(_position_x)
00123         + ", pos y=" + Teuchos::toString(_position_y)
00124         + ", offset x=" + Teuchos::toString(_offset_x) +
00125         + ", offset y=" + Teuchos::toString(_offset_y)
00126         + ", resolution_x=" + Teuchos::toString(_resolution_x)
00127         + ", resolution_y=" + Teuchos::toString(_resolution_y)+"]";}
00128 
00129 
00130 
00131   virtual RCP<MeshSourceBase> getRcp() {return rcp(this);}
00132 
00133 
00134 protected:
00135 
00136 
00137   virtual Mesh fillMesh() const ;
00138 
00139 private:
00140 
00141 
00142   double _position_x;
00143 
00144   double _position_y;
00145 
00146   double _offset_x;
00147 
00148   double _offset_y;
00149 
00150   int _resolution_x;
00151 
00152   int _resolution_y;
00153 
00154 
00155   const RefinementClass refineClass_;
00156 
00157 
00158   const MeshDomainDef meshDomain_;
00159 
00160 
00161 
00162   static const RefinementClass dummyRefineClass_;
00163 
00164 
00165   static const MeshDomainDef dummyMeshDomain_;
00166 };
00167 }
00168 #endif