Changeset 6e10f33 for src/base


Ignore:
Timestamp:
Apr 12, 2013, 8:41:41 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
e5d779b
Parents:
b3075a
Message:

Some work...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/base/interface.cpp

    rb3075a r6e10f33  
    4242{
    4343  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
    4753
    4854  const Vector box_center = box_offset + 0.5 * box_size;
     
    6672       num_cells = Helper::intpow(2,levelMax-global.size()+1) * size_factor;
    6773
    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();
    6976       extent.back().Begin() = box_center - 0.5 * extent.back().Size();
    7077       extent.back().End() = extent.back().Begin() + extent.back().Size();
    71        extent.back().MeshWidth() = extent.back().Size() / num_cells;
    7278
    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;
    7682
    7783       global.back().GlobalSizeNew() = global.back().LocalSize();
     
    7985       global.back().GlobalEnd() = global.back().LocalEnd();
    8086
    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
    8492
    8593       global.back().BoundaryType() = LocallyRefined;
     
    8795     }
    8896
    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
    9799   } else {
    98100
     
    122124
    123125   }
    124 
    125126
    126127   while (global.back().GlobalSizeNew().Min() > Helper::intpow(2, levelMin)+1) {
Note: See TracChangeset for help on using the changeset viewer.