28 const ext::shared_ptr<FdmMesher>& mesher)
31 for (
const auto& iter : *mesher->layout()) {
32 const Size i = iter.index();
33 const Real hm_d0 = mesher->dminus(iter,
d0_);
34 const Real hp_d0 = mesher->dplus(iter,
d0_);
35 const Real hm_d1 = mesher->dminus(iter,
d1_);
36 const Real hp_d1 = mesher->dplus(iter,
d1_);
38 const Real zetam1 = hm_d0*(hm_d0+hp_d0);
39 const Real zeta0 = hm_d0*hp_d0;
40 const Real zetap1 = hp_d0*(hm_d0+hp_d0);
41 const Real phim1 = hm_d1*(hm_d1+hp_d1);
42 const Real phi0 = hm_d1*hp_d1;
43 const Real phip1 = hp_d1*(hm_d1+hp_d1);
45 const Size c0 = iter.coordinates()[
d0_];
46 const Size c1 = iter.coordinates()[
d1_];
47 if (c0 == 0 && c1 == 0) {
52 else if (c0 == mesher->layout()->dim()[
d0_]-1 && c1 == 0) {
57 else if (c0 == 0 && c1 == mesher->layout()->dim()[
d1_]-1) {
62 else if (c0 == mesher->layout()->dim()[
d0_]-1 && c1 == mesher->layout()->dim()[
d1_]-1) {
71 a20_[i] = -(
a10_[i] = hp_d1/(hp_d0*phim1));
72 a11_[i] = -(
a21_[i] = (hp_d1-hm_d1)/(hp_d0*phi0));
73 a12_[i] = -(
a22_[i] = hm_d1/(hp_d0*phip1));
75 else if (c0 == mesher->layout()->dim()[
d0_]-1) {
79 a10_[i] = -(
a00_[i] = hp_d1/(hm_d0*phim1));
80 a01_[i] = -(
a11_[i] = (hp_d1-hm_d1)/(hm_d0*phi0));
81 a02_[i] = -(
a12_[i] = hm_d1/(hm_d0*phip1));
87 a02_[i] = -(
a01_[i] = hp_d0/(zetam1*hp_d1));
88 a11_[i] = -(
a12_[i] = (hp_d0-hm_d0)/(zeta0*hp_d1));
89 a21_[i] = -(
a22_[i] = hm_d0/(zetap1*hp_d1));
91 else if (c1 == mesher->layout()->dim()[
d1_]-1) {
95 a01_[i] = -(
a00_[i] = hp_d0/(zetam1*hm_d1));
96 a10_[i] = -(
a11_[i] = (hp_d0-hm_d0)/(zeta0*hm_d1));
97 a20_[i] = -(
a21_[i] = hm_d0/(zetap1*hm_d1));
100 a00_[i] = hp_d0*hp_d1/(zetam1*phim1);
101 a10_[i] = -(hp_d0-hm_d0)*hp_d1/(zeta0*phim1);
102 a20_[i] = -hm_d0*hp_d1/(zetap1*phim1);
103 a01_[i] = -hp_d0*(hp_d1-hm_d1)/(zetam1*phi0);
104 a11_[i] = (hp_d0-hm_d0)*(hp_d1-hm_d1)/(zeta0*phi0);
105 a21_[i] = hm_d0*(hp_d1-hm_d1)/(zetap1*phi0);
106 a02_[i] = -hp_d0*hm_d1/(zetam1*phip1);
107 a12_[i] = hm_d1*(hp_d0-hm_d0)/(zeta0*phip1);
108 a22_[i] = hm_d0*hm_d1/(zetap1*phip1);
std::unique_ptr< Real[]> a20_
std::unique_ptr< Real[]> a11_
std::unique_ptr< Real[]> a00_
std::unique_ptr< Real[]> a02_
std::unique_ptr< Real[]> a22_
std::unique_ptr< Real[]> a10_
std::unique_ptr< Real[]> a12_
std::unique_ptr< Real[]> a21_
std::unique_ptr< Real[]> a01_
SecondOrderMixedDerivativeOp(Size d0, Size d1, const ext::shared_ptr< FdmMesher > &mesher)
memory layout of a fdm linear operator
std::size_t Size
size of a container
second order mixed derivative linear operator