Changeset 6e10f33 for src/base/interface.cpp
- Timestamp:
- Apr 12, 2013, 8:41:41 PM (13 years ago)
- Children:
- e5d779b
- Parents:
- b3075a
- File:
-
- 1 edited
-
src/base/interface.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/base/interface.cpp
rb3075a r6e10f33 42 42 { 43 43 Index num_cells, size_factor; 44 Index add_node = Index(bc[0]==Periodic ? 0 : 1, 45 bc[1]==Periodic ? 0 : 1, 46 bc[2]==Periodic ? 0 : 1); 44 45 const Index add_node = Index(bc[0]==Periodic ? 0 : 1, 46 bc[1]==Periodic ? 0 : 1, 47 bc[2]==Periodic ? 0 : 1); 48 49 const Index inner_boundary = Index(bc[0]==Open ? 2 : 0, 50 bc[1]==Open ? 2 : 0, 51 bc[2]==Open ? 2 : 0); 52 47 53 48 54 const Vector box_center = box_offset + 0.5 * box_size; … … 66 72 num_cells = Helper::intpow(2,levelMax-global.size()+1) * size_factor; 67 73 68 extent.back().Size() = box_size * static_cast<Vector>(size_factor); 74 extent.back().MeshWidth() = box_size * static_cast<Vector>(size_factor) / num_cells; 75 extent.back().Size() = (num_cells + inner_boundary) * extent.back().MeshWidth(); 69 76 extent.back().Begin() = box_center - 0.5 * extent.back().Size(); 70 77 extent.back().End() = extent.back().Begin() + extent.back().Size(); 71 extent.back().MeshWidth() = extent.back().Size() / num_cells;72 78 73 global.back().LocalSize() = num_cells + add_node ;74 global.back().LocalBegin() = -1 * num_cells/ 2;75 global.back().LocalEnd() = num_cells/2 + add_node;79 global.back().LocalSize() = num_cells + add_node + inner_boundary; 80 global.back().LocalBegin() = -1 * (num_cells + inner_boundary) / 2; 81 global.back().LocalEnd() = (num_cells + inner_boundary) / 2 + add_node; 76 82 77 83 global.back().GlobalSizeNew() = global.back().LocalSize(); … … 79 85 global.back().GlobalEnd() = global.back().LocalEnd(); 80 86 81 global.back().GlobalSizeFinest() = Helper::intpow(2, global.size()-1)*num_cells + add_node; 82 global.back().GlobalBeginFinest() = -1 * ((Helper::intpow(2, global.size()-1)*num_cells) / 2); 83 global.back().GlobalEndFinest() = (Helper::intpow(2, global.size()-1)*num_cells) / 2 + add_node; 87 global.back().GlobalSizeFinest() = Helper::intpow(2, global.size()-1) * (num_cells+inner_boundary) + add_node; 88 global.back().GlobalBeginFinest() = -1 * ((Helper::intpow(2, global.size()-1) * (num_cells + inner_boundary)) / 2); 89 global.back().GlobalEndFinest() = (Helper::intpow(2, global.size()-1) * (num_cells + inner_boundary)) / 2 + add_node; 90 91 84 92 85 93 global.back().BoundaryType() = LocallyRefined; … … 87 95 } 88 96 89 for (int i=global.size()-1; i>0; --i) { 90 if (global[i].GlobalSizeFinest().Max() > global[i-1].GlobalSizeFinest().Max()) { 91 global[i].BoundaryType() = GlobalMax; 92 break; 93 }else { 94 global[i].BoundaryType() = GlobalCoarsened; 95 } 96 } 97 global.back().BoundaryType() = GlobalMax; 98 97 99 } else { 98 100 … … 122 124 123 125 } 124 125 126 126 127 while (global.back().GlobalSizeNew().Min() > Helper::intpow(2, levelMin)+1) {
Note:
See TracChangeset
for help on using the changeset viewer.
