00001 /* The boundary class is used the describe an element on the boundary 00002 */ 00003 00004 #ifndef boundary_hh 00005 #define boundary_hh 00006 00007 #include <memory> 00008 #include <sstream> 00009 #include "basics/outputOperator.hh" 00010 #include "basics/vectorsMatricesForward.hh" 00011 00012 namespace concepts { 00013 00014 // forward declaration 00015 template<class F> 00016 class Formula; 00017 00018 // ************************************************************** Boundary ** 00019 00033 class Boundary : public OutputOperator { 00034 public: 00036 enum boundaryTypes { FREE = 0, DIRICHLET, NEUMANN, CONNECT, MAX_TYPE }; 00037 00041 Boundary(); 00042 00047 Boundary(const enum boundaryTypes type); 00048 00055 Boundary(const enum boundaryTypes type, const Formula<Real>& frm); 00056 00064 Boundary(const enum boundaryTypes type, const char* frm); 00065 00067 Boundary(const Boundary& bnd); 00068 00069 virtual ~Boundary(); 00070 00072 enum boundaryTypes type() const { return type_; } 00073 00075 std::string typeStr() const; 00076 00078 virtual Boundary& operator=(const Boundary& bnd); 00079 00080 bool isNull() { return frm_.get()==0; } 00081 00082 // /// Application operator. Returns the formula. 00083 // const Formula& operator()() const { return *frm_; } 00087 Real operator()(const Real x, const Real t = 0.0) const; 00088 00092 Real operator()(const Real2d& x, const Real t = 0.0) const; 00093 00097 Real operator()(const Real3d& x, const Real t = 0.0) const; 00098 protected: 00099 virtual std::ostream& info(std::ostream& os) const; 00100 private: 00102 enum boundaryTypes type_; 00104 std::auto_ptr<const Formula<Real> > frm_; 00105 }; 00106 00107 } // namespace concepts 00108 00109 #endif // boundary_hh