| 224 | } // solveSystem |
| 225 | |
| 226 | void |
| 227 | BGaussSeidelPreconditioner::initializeSolverState(const SAMRAIVectorReal<NDIM, double>& x, |
| 228 | const SAMRAIVectorReal<NDIM, double>& b) |
| 229 | { |
| 230 | #if !defined(NDEBUG) |
| 231 | Pointer<PatchHierarchy<NDIM>> hierarchy = x.getPatchHierarchy(); |
| 232 | const int coarsest_ln = x.getCoarsestLevelNumber(); |
| 233 | const int finest_ln = x.getFinestLevelNumber(); |
| 234 | TBOX_ASSERT(hierarchy == b.getPatchHierarchy()); |
| 235 | TBOX_ASSERT(coarsest_ln == b.getCoarsestLevelNumber()); |
| 236 | TBOX_ASSERT(finest_ln == b.getFinestLevelNumber()); |
| 237 | TBOX_ASSERT(x.getNumberOfComponents() == b.getNumberOfComponents()); |
| 238 | #endif |
| 239 | // Setup SAMRAIVectorReal objects to correspond to the individual vector |
| 240 | // components. |
| 241 | std::vector<Pointer<SAMRAIVectorReal<NDIM, double>>> x_comps = |
| 242 | getComponentVectors(ConstPointer<SAMRAIVectorReal<NDIM, double>>(&x, false)); |
| 243 | std::vector<Pointer<SAMRAIVectorReal<NDIM, double>>> b_comps = |
| 244 | getComponentVectors(ConstPointer<SAMRAIVectorReal<NDIM, double>>(&b, false)); |
| 245 | |
| 246 | // Initialize the component operators and preconditioners. |
| 247 | const int ncomps = x.getNumberOfComponents(); |
| 248 | for (int comp = 0; comp < ncomps; ++comp) |
| 249 | { |
| 250 | for (int c = 0; c < ncomps; ++c) |
| 251 | { |
| 252 | // Skip the diagonal operators. |
| 253 | if (c == comp) continue; |
| 254 | d_linear_ops_map[comp][c]->initializeOperatorState(*x_comps[comp], *b_comps[comp]); |
| 255 | } |
| 256 | d_pc_map[comp]->initializeSolverState(*x_comps[comp], *b_comps[comp]); |
| 257 | } |
| 258 | |
| 259 | // Indicate that the preconditioner is initialized. |
| 260 | d_is_initialized = true; |
| 261 | return; |
| 262 | } // initializeSolverState |
| 263 | |
| 264 | void |
| 265 | BGaussSeidelPreconditioner::deallocateSolverState() |
nothing calls this directly
no test coverage detected