| 344 | } // deallocateSolverState |
| 345 | |
| 346 | bool |
| 347 | CIBMobilitySolver::solveMobilitySystem(Vec x, Vec b) |
| 348 | { |
| 349 | IBAMR_TIMER_START(t_solve_mobility_system); |
| 350 | |
| 351 | // Initialize the solver, when necessary. |
| 352 | const bool deallocate_after_solve = !d_is_initialized; |
| 353 | if (deallocate_after_solve) initializeSolverState(x, b); |
| 354 | |
| 355 | // Solve for x. |
| 356 | bool converged = false; |
| 357 | if (d_mobility_solver_type == KRYLOV) |
| 358 | { |
| 359 | converged = d_krylov_mob_solver->solveSystem(x, b); |
| 360 | } |
| 361 | else if (d_mobility_solver_type == DIRECT) |
| 362 | { |
| 363 | converged = d_direct_mob_solver->solveSystem(x, b); |
| 364 | const double scale = 1.0 / (d_interp_scale * d_spread_scale); |
| 365 | VecScale(x, scale); |
| 366 | } |
| 367 | else |
| 368 | { |
| 369 | TBOX_ERROR("This statment should not be reached\n"); |
| 370 | } |
| 371 | |
| 372 | // Deallocate the solver, when necessary. |
| 373 | if (deallocate_after_solve) deallocateSolverState(); |
| 374 | |
| 375 | IBAMR_TIMER_STOP(t_solve_mobility_system); |
| 376 | return converged; |
| 377 | } // solveMobilitySystem |
| 378 | |
| 379 | bool |
| 380 | CIBMobilitySolver::solveBodyMobilitySystem(Vec x, Vec b) |
no test coverage detected