MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / solveMobilitySystem

Method solveMobilitySystem

src/IB/CIBMobilitySolver.cpp:346–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344} // deallocateSolverState
345
346bool
347CIBMobilitySolver::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
379bool
380CIBMobilitySolver::solveBodyMobilitySystem(Vec x, Vec b)

Callers 2

MatVecMult_KFBMSolverMethod · 0.80
PCApply_SaddlePointMethod · 0.80

Calls 1

solveSystemMethod · 0.45

Tested by

no test coverage detected