1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include "grid.h"
19
20 using Scal_FEfun = Esfem::Grid::Scal_FEfun;
21 using Vec_FEfun = Esfem::Grid::Vec_FEfun;
22
23
24
25
26 Scal_FEfun::Scal_FEfun(const std::string& fun_name, const Grid_and_time& gt)
27 : fun {fun_name, gt.fe_space()}
28 {
29 fun.clear();
30 }
31 Scal_FEfun& Scal_FEfun::operator=(const Scal_FEfun& other){
32 fun.assign(other.fun);
33 return *this;
34 }
35 Scal_FEfun& Scal_FEfun::operator+=(const double d){
36 for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it += d;
37 return *this;
38 }
39 Scal_FEfun& Scal_FEfun::operator*=(const double d){
40 for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it *= d;
41 return *this;
42 }
43 Scal_FEfun::Scal_FEfun(const Scal_FEfun& other, const Grid_and_time& gt)
44 : fun {other.name() + "+", gt.fe_space()}
45 {
46 fun.assign(other.fun);
47 }
48
49
50
51
52 Vec_FEfun::Vec_FEfun(const std::string& fun_name, const Grid_and_time& gt)
53 : fun {fun_name, gt.vec_fe_space()}
54 {
55 fun.clear();
56 }
57 Vec_FEfun::Vec_FEfun(const Vec_FEfun& other, const Grid_and_time& gt)
58 : fun {other.name() + "+", gt.vec_fe_space()}
59 {
60 fun.assign(other.fun);
61 }
62 Vec_FEfun& Vec_FEfun::operator=(const Vec_FEfun& other){
63 fun.assign(other.fun);
64 return *this;
65 }
66
67 Vec_FEfun& Vec_FEfun::operator+=(const double d){
68 for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it += d;
69 return *this;
70 }
71 Vec_FEfun& Vec_FEfun::operator*=(const double d){
72 for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it *= d;
73 return *this;
74 }