------------------------------------------------------------------------------
| 114 | |
| 115 | //------------------------------------------------------------------------------ |
| 116 | void vtkPStructuredGridConnectivity::CreateGhostLayers(int N) |
| 117 | { |
| 118 | assert("pre: Instance has not been initialized!" && this->Initialized); |
| 119 | if (N == 0) |
| 120 | { |
| 121 | vtkWarningMacro("N=0 ghost layers requested! No ghost layers will be created!"); |
| 122 | this->Controller->Barrier(); |
| 123 | return; |
| 124 | } |
| 125 | |
| 126 | this->NumberOfGhostLayers += N; |
| 127 | this->AllocateInternalDataStructures(); |
| 128 | this->GhostedExtents.resize(this->NumberOfGrids * 6, -1); |
| 129 | |
| 130 | // STEP 0: Compute neighbor send and receive extent |
| 131 | for (unsigned int i = 0; i < this->NumberOfGrids; ++i) |
| 132 | { |
| 133 | this->CreateGhostedExtent(i, N); |
| 134 | this->ComputeNeighborSendAndRcvExtent(i, N); |
| 135 | } |
| 136 | |
| 137 | // BEGIN DEBUG |
| 138 | // std::ostringstream oss; |
| 139 | // oss << "Process" << this->Rank << "-neis.log"; |
| 140 | // vtksys::ofstream ofs; |
| 141 | // ofs.open( oss.str().c_str() ); |
| 142 | // assert("ERROR: cannot write log file" && ofs.is_open() ); |
| 143 | // this->Print( ofs ); |
| 144 | // ofs.close(); |
| 145 | // END DEBUG |
| 146 | |
| 147 | this->Controller->Barrier(); |
| 148 | |
| 149 | // STEP 1: Exchange ghost-data |
| 150 | this->ExchangeGhostData(); |
| 151 | this->Controller->Barrier(); |
| 152 | |
| 153 | // STEP 4: Create ghost-layers |
| 154 | for (unsigned int i = 0; i < this->NumberOfGrids; ++i) |
| 155 | { |
| 156 | if (this->IsGridLocal(i)) |
| 157 | { |
| 158 | this->CreateGhostedMaskArrays(i); |
| 159 | this->InitializeGhostData(i); |
| 160 | this->TransferRegisteredDataToGhostedData(i); |
| 161 | this->TransferGhostDataFromNeighbors(i); |
| 162 | } |
| 163 | } // END for all grids |
| 164 | |
| 165 | // STEP 5: Synchronize |
| 166 | this->Controller->Barrier(); |
| 167 | } |
| 168 | |
| 169 | //------------------------------------------------------------------------------ |
| 170 | void vtkPStructuredGridConnectivity::TransferRemoteNeighborData( |