This source file includes following definitions.
- Init_data
- interpolate
- new_1ssef
- new_ssef
- new_sms
- new_sls
- new_v_sls
- new_sd
- interpolate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include <config.h>
17 #include <dune/fem/operator/lagrangeinterpolation.hh>
18 #include "secOrd_op_initData.h"
19 #include "secOrd_op_initData_impl.h"
20 #include "io_dof.h"
21 #include "esfem_error.h"
22
23 using namespace std;
24 using Esfem::SecOrd_op::Init_data;
25 using Esfem::SecOrd_op::sIdata;
26 using Esfem::SecOrd_op::vIdata;
27 using Esfem::SecOrd_op::Exact_velocity;
28
29
30
31
32 Esfem::SecOrd_op::Init_data::
33 Init_data(const Grid::Grid_and_time& gt, const Growth type)
34 :d_ptr {make_unique<Data>(gt, type)}
35 {}
36
37 Esfem::SecOrd_op::Init_data::Init_data(const Io::Parameter& p,
38 const Growth type)
39 :d_ptr {make_unique<Data>(p, type)}
40 {}
41
42 Esfem::SecOrd_op::Init_data::~Init_data() = default;
43
44
45 void Esfem::SecOrd_op::Init_data::interpolate(Grid::Scal_FEfun& fef) const{
46 using std::begin;
47 using std::end;
48 using FE_function = Esfem::Grid::Scal_FEfun::Dune_FEfun;
49
50 const auto& eid_ptr = d_ptr -> eid_ptr;
51 const auto& rid_ptr = d_ptr -> rid_ptr;
52
53
54 if(eid_ptr)
55 Dune::LagrangeInterpolation<FE_function>::
56 interpolateFunction(*eid_ptr, fef);
57 else if(rid_ptr){
58 Dune::LagrangeInterpolation<FE_function>::
59 interpolateFunction(*rid_ptr, fef);
60
61 }
62 else
63 throw InitData_error {Assert::compose(__FILE__, __LINE__, "Null pointer")};
64 }
65
66
67
68
69 sIdata* sIdata::new_1ssef(const Grid::Grid_and_time& gt){
70 return new Impl::sphere_1EF {gt};
71 }
72
73
74
75
76
77
78
79
80
81
82 vIdata* vIdata::new_ssef(const Grid::Grid_and_time& gt){
83 return new Impl::sphere_eigenFun {gt};
84 }
85
86 vIdata* vIdata::new_sms(const Grid::Grid_and_time& gt){
87 return new Impl::sphere_mcf_sol {gt};
88 }
89
90 vIdata* vIdata::new_sls(const Grid::Grid_and_time& gt){
91 return new Impl::sls_iData {gt};
92 }
93
94 vIdata* vIdata::new_v_sls(const Grid::Grid_and_time& gt){
95 return new Impl::sls_v_iData {gt};
96 }
97
98 vIdata* vIdata::new_sd(const Grid::Grid_and_time& gt){
99 return new Impl::sd_iData {gt};
100 }
101
102
103
104 Exact_velocity::Exact_velocity(const Grid::Grid_and_time& gt)
105 :d_ptr {std::make_unique<Data>(gt)}
106 {}
107
108 Exact_velocity::~Exact_velocity() = default;
109
110
111 void Exact_velocity::interpolate(Grid::Vec_FEfun& vfef) const{
112 using FE_function = Esfem::Grid::Vec_FEfun::Dune_FEfun;
113 Dune::LagrangeInterpolation<FE_function>::
114 interpolateFunction(d_ptr -> v_fun, vfef);
115 }