Changeset 8180d8 for src/level/level_operator_cs.cpp
- Timestamp:
- Apr 5, 2013, 12:39:30 PM (13 years ago)
- Children:
- 4a709e
- Parents:
- f57182
- File:
-
- 1 edited
-
src/level/level_operator_cs.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/level/level_operator_cs.cpp
rf57182 r8180d8 32 32 #include "base/index.hpp" 33 33 #include "comm/comm.hpp" 34 #include "grid/grid_index_translations.hpp" 34 35 #include "grid/grid_iterator.hpp" 35 36 #include "grid/multigrid.hpp" … … 53 54 const Stencil& op = OperatorRestrict(); 54 55 55 const Index begin_f_global = rhs_f.Global().LocalSize().Product() > 0 56 ? rhs_f.Global().LocalBegin() + rhs_f.Global().LocalBegin() % 2 57 : rhs_f.Global().LocalBegin(); 58 const Index end_f_global = rhs_f.Global().LocalSize().Product() > 0 59 ? rhs_f.Global().LocalEnd() - (rhs_f.Global().LocalEnd() - 1) % 2 60 : rhs_f.Global().LocalBegin(); 61 62 Index begin_f = begin_f_global - rhs_f.Global().LocalBegin() + rhs_f.Local().Begin(); 63 Index end_f = end_f_global - rhs_f.Global().LocalBegin() + rhs_f.Local().Begin(); 64 65 /* Modify fine begin/end to align the points on both levels correctly */ 66 if (rhs_c_undist.Global().BoundaryType() == GlobalCoarsened) { 67 begin_f += rhs_f.Local().BoundarySize1(); 68 end_f -= rhs_f.Local().BoundarySize2(); 69 } 70 71 const Index begin_c = rhs_c_undist.Local().Begin() + begin_f_global / 2 - rhs_c_undist.Global().LocalBegin(); 72 const Index end_c = rhs_c_undist.Local().Begin() + end_f_global / 2 - rhs_c_undist.Global().LocalBegin() + 1; 73 74 const GridIteratorSet bounds_f(begin_f, end_f); 75 const GridIteratorSet bounds_c(begin_c, end_c); 56 GridIteratorSet bounds_c, bounds_f; 57 GridIndexTranslations::GetGridAlignment(rhs_c_undist, bounds_c, rhs_f, bounds_f); 76 58 77 59 assert(bounds_c.Begin().GetEnd()-bounds_c.Begin().GetBegin() == ((bounds_f.Begin().GetEnd()-bounds_f.Begin().GetBegin())-1)/2+1); … … 106 88 Grid& sol_f_dist = sol(sol.Level()+1); 107 89 Grid& sol_f_undist = comm.GetFinerGrid(sol); 108 Grid& rhs_f_undist = comm.GetFinerGrid(rhs);109 90 110 91 const Stencil& op = OperatorProlongate(); 111 92 112 Index begin_f = sol_f_undist.Local().Begin() + 2*sol_c.Global().LocalBegin() - sol_f_undist.Global().LocalBegin(); 113 Index end_f = sol_f_undist.Local().End(); 114 115 if (sol_c.Global().BoundaryType() == GlobalCoarsened) { 116 begin_f += rhs_f_undist.Local().BoundarySize1(); 117 end_f -= rhs_f_undist.Local().BoundarySize2(); 118 } 119 120 const GridIteratorSet bounds_f(begin_f, end_f); 121 const GridIteratorSet bounds_c(sol_c.Local().FinerBegin(), sol_c.Local().FinerEnd()); 93 GridIteratorSet bounds_c, bounds_f; 94 GridIndexTranslations::GetGridAlignment(sol_c, bounds_c, sol_f_undist, bounds_f); 122 95 123 96 assert(bounds_c.Begin().GetEnd()-bounds_c.Begin().GetBegin() == ((bounds_f.Begin().GetEnd()-bounds_f.Begin().GetBegin())-1)/2+1); … … 132 105 for (stencil_iter = op.begin(); stencil_iter != op.end(); ++stencil_iter) 133 106 sol_f_undist(iter_f->X() + stencil_iter->Disp().X(), 134 iter_f->Y() + stencil_iter->Disp().Y(),135 iter_f->Z() + stencil_iter->Disp().Z()) += stencil_iter->Val() * val;107 iter_f->Y() + stencil_iter->Disp().Y(), 108 iter_f->Z() + stencil_iter->Disp().Z()) += stencil_iter->Val() * val; 136 109 } 137 110
Note:
See TracChangeset
for help on using the changeset viewer.
