boundary.hh

Go to the documentation of this file.
1 
6 #ifndef boundary_hh
7 #define boundary_hh
8 
9 #include <memory>
10 #include <sstream>
11 #include "basics/outputOperator.hh"
13 
14 namespace concepts {
15 
16  // forward declaration
17  template<class F>
18  class Formula;
19 
20  // ************************************************************** Boundary **
21 
35  class Boundary : public virtual OutputOperator {
36  public:
39 
44 
50 
57  Boundary(const enum boundaryTypes type, const Formula<Real>& frm);
58 
66  Boundary(const enum boundaryTypes type, const char* frm);
67 
69  Boundary(const Boundary& bnd);
70 
71  virtual ~Boundary();
72 
74  enum boundaryTypes type() const { return type_; }
75 
77  std::string typeStr() const;
78 
80  virtual Boundary& operator=(const Boundary& bnd);
81 
82  bool isNull() { return frm_.get()==0; }
83 
84 // /// Application operator. Returns the formula.
85 // const Formula& operator()() const { return *frm_; }
89  Real operator()(const Real x, const Real t = 0.0) const;
90 
94  Real operator()(const Real2d& x, const Real t = 0.0) const;
95 
99  Real operator()(const Real3d& x, const Real t = 0.0) const;
100  protected:
101  virtual std::ostream& info(std::ostream& os) const;
102  private:
104  enum boundaryTypes type_;
106  std::unique_ptr<const Formula<Real> > frm_;
107  };
108 
109 } // namespace concepts
110 
111 #endif // boundary_hh
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Boundary(const enum boundaryTypes type)
Constructor.
Boundary(const enum boundaryTypes type, const Formula< Real > &frm)
Constructor.
Real operator()(const Real2d &x, const Real t=0.0) const
Application operator.
Class to describe an element of the boundary.
Definition: boundary.hh:35
enum boundaryTypes type_
Type of the boundary.
Definition: boundary.hh:104
boundaryTypes
The different boundary condition types.
Definition: boundary.hh:38
Real operator()(const Real3d &x, const Real t=0.0) const
Application operator.
Boundary(const Boundary &bnd)
Copy constructor.
Real operator()(const Real x, const Real t=0.0) const
Application operator.
Boundary(const enum boundaryTypes type, const char *frm)
Constructor.
enum boundaryTypes type() const
Returns the type of the boundary condition.
Definition: boundary.hh:74
Boundary()
Default constructor.
std::string typeStr() const
Return the type of the boundary condition as output string.
Class providing an output operator.
virtual Boundary & operator=(const Boundary &bnd)
Assignment operator.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
std::unique_ptr< const Formula< Real > > frm_
The function of the boundary condition.
Definition: boundary.hh:106
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich