Class documentation of Concepts

Loading...
Searching...
No Matches
vectors.hh
Go to the documentation of this file.
1
6#ifndef timestepVectors_hh
7#define timestepVectors_hh
8
10#include "function/vector.hh"
11
12// debugging
13#include "basics/debug.hh"
14
15#define TimeVector_D 0
16
17namespace concepts {
18
19 // forward declaration
20 template<class F>
21 class Formula; // declared in formula/formula.hh
22}
23
24namespace timestepping {
25
26 using concepts::Real;
27
28
29 // ******************************************************** TimeLinearForm **
30
35 class TimeLinearForm : public concepts::LinearForm<Real> {
36 public:
37 TimeLinearForm() : time_(0) {}
39 virtual void time(Real time) { time_ = time; }
41 Real time() { return time_; }
42 protected:
44 Real time_;
45 };
46
47 // ************************************************************ TimeVector **
48
53 class TimeVector : public concepts::Vector<Real> {
54 public:
61 : concepts::Vector<Real>(spc, tlf), spc_(&spc), tlf_(&tlf)
62 , time_(tlf.time()), frm_(0), template_(0) {}
68 : concepts::Vector<Real>(spc), spc_(&spc), tlf_(0)
69 , time_(0), frm_(0), template_(0) {}
75 : concepts::Vector<Real>(vec), spc_(0), tlf_(0)
76 , time_(0), frm_(0), template_(0) {}
83 const concepts::Formula<Real>& frm, const Real time = 0);
84
85 ~TimeVector() {if (template_) delete template_; }
86
88 Real time() const { return time_; }
92 void time(Real time);
93 private:
95 const concepts::Space<Real>* spc_;
97 TimeLinearForm* tlf_;
99 Real time_;
101 const concepts::Formula<Real>* frm_;
103 const concepts::Vector<Real>* template_;
104
106 void updateEntries_() {
108 if (time_ != tlf_->time()) {
109 tlf_->time(time_);
110 DEBUGL(TimeVector_D, "new time: " << tlf_->time() << std::endl);
112 fillEntries_(*spc_, *tlf_);
113 DEBUGL(TimeVector_D, "new vector(1): " << *this << std::endl);
114 }
115 }
116
121 void set_(const concepts::Vector<Real>& vec);
122 };
123
124} // namespace timestepping
125
126#endif // timestepVectors_hh
Vector(const Vector< Real > &f)
Copy constructor.
virtual void time(Real time)
Sets time_.
Definition vectors.hh:39
Real time()
Returns time_.
Definition vectors.hh:41
Real time_
The current time.
Definition vectors.hh:44
TimeVector(const concepts::Vector< Real > &vec)
Definition vectors.hh:74
TimeVector(const concepts::Space< Real > &spc)
Definition vectors.hh:67
void time(Real time)
Real time() const
Returns the current time_.
Definition vectors.hh:88
TimeVector(const concepts::Vector< Real > &vec, const concepts::Formula< Real > &frm, const Real time=0)
TimeVector(const concepts::Space< Real > &spc, TimeLinearForm &tlf)
Definition vectors.hh:60
#define conceptsAssert(cond, exc)
#define DEBUGL(doit, msg)
Definition debug.hh:40
double Real
Definition typedefs.hh:39