Ignore:
Timestamp:
Apr 16, 2013, 11:27:31 AM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
177495
Parents:
e58835d
Message:

Save the whole domain decomposition instead of just the part for the current process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/grid/multigrid.cpp

    re58835d rd6a338  
    4343using namespace VMG;
    4444
    45 Multigrid::Multigrid(Comm* comm, const Interface* interface)
     45Multigrid::Multigrid(const Comm& comm, const Interface& interface)
    4646{
    4747  Index points, remainder;
    4848  LocalIndices local_l;
    49   std::vector<GlobalIndices> global_separated;
    50 
    51   const std::vector<GlobalIndices>& global = interface->Global();
    52   const std::vector<SpatialExtent>& extent = interface->Extent();
    53 
    54   comm->GetDomainDecomposition().Compute(comm, interface, global_separated);
    55 
    56   for (unsigned int i=0; i<global.size(); ++i) {
     49
     50  const std::vector<SpatialExtent>& extent = interface.Extent();
     51  const std::vector<GlobalIndices>& global_separated = comm.DecomposedGlobalMe();
     52
     53  for (unsigned int i=0; i<global_separated.size(); ++i) {
    5754
    5855    /*
    5956     * Check if this level is the finest global level
    6057     */
    61     if (global[i].BoundaryType() == GlobalMax)
    62       levelGlobalMax = interface->MaxLevel() - i;
    63 
     58    if (global_separated[i].BoundaryType() == GlobalMax)
     59      levelGlobalMax = interface.MaxLevel() - i;
    6460
    6561    if (global_separated[i].LocalSize().Product() > 0) {
     
    8278      for (int j=0; j<3; ++j) {
    8379
    84         if (comm->BoundaryConditions()[j] == Dirichlet ||
    85             comm->BoundaryConditions()[j] == Open) {
     80        if (comm.BoundaryConditions()[j] == Dirichlet ||
     81            comm.BoundaryConditions()[j] == Open) {
    8682
    8783          local_l.SizeTotal()[j] = global_separated[i].LocalSize()[j];
     
    109105          }
    110106
    111         }else if (comm->BoundaryConditions()[j] == Periodic) {
     107        }else if (comm.BoundaryConditions()[j] == Periodic) {
    112108
    113109          local_l.SizeTotal()[j] = global_separated[i].LocalSize()[j] + 2;
     
    161157    }
    162158
    163     grids.push_back(new Grid(global_separated[i], local_l, extent[i], interface->MaxLevel()-i, this));
     159    grids.push_back(new Grid(global_separated[i], local_l, extent[i], interface.MaxLevel()-i, this));
    164160
    165161  }
     
    167163  numLevels = grids.size();
    168164
    169   levelMax = interface->MaxLevel();
     165  levelMax = interface.MaxLevel();
    170166  levelMin = levelMax - numLevels + 1;
    171167
Note: See TracChangeset for help on using the changeset viewer.