| 47 | ////////////////////////////// PUBLIC //////////////////////////////////////// |
| 48 | |
| 49 | CIBMobilitySolver::CIBMobilitySolver(std::string object_name, |
| 50 | Pointer<Database> input_db, |
| 51 | Pointer<INSStaggeredHierarchyIntegrator> navier_stokes_integrator, |
| 52 | Pointer<CIBStrategy> cib_strategy) |
| 53 | : d_object_name(std::move(object_name)), |
| 54 | d_num_rigid_parts(cib_strategy->getNumberOfRigidStructures()), |
| 55 | d_cib_strategy(cib_strategy) |
| 56 | { |
| 57 | // Get from input. |
| 58 | if (input_db) getFromInput(input_db); |
| 59 | |
| 60 | // Create the mobility solvers. |
| 61 | if (d_mobility_solver_type == KRYLOV) |
| 62 | { |
| 63 | d_krylov_mob_solver = new KrylovMobilitySolver(d_object_name + "KrylovMobilitySolver", |
| 64 | navier_stokes_integrator, |
| 65 | d_cib_strategy, |
| 66 | input_db->getDatabase("KrylovMobilitySolver"), |
| 67 | "KMInv_"); |
| 68 | } |
| 69 | if (d_mobility_solver_type == DIRECT) |
| 70 | { |
| 71 | d_direct_mob_solver = new DirectMobilitySolver( |
| 72 | d_object_name + "DirectMobilitySolver", input_db->getDatabase("DirectMobilitySolver"), cib_strategy); |
| 73 | d_direct_mob_solver->setStokesSpecifications(*navier_stokes_integrator->getStokesSpecifications()); |
| 74 | } |
| 75 | |
| 76 | // Create solver for free parts moving under external forces. |
| 77 | { |
| 78 | d_krylov_freebody_mob_solver = |
| 79 | new KrylovFreeBodyMobilitySolver(d_object_name + "FreeBodyMobilitySolver", |
| 80 | input_db->getDatabase("KrylovFreeBodyMobilitySolver"), |
| 81 | "KFBMInv_", |
| 82 | cib_strategy); |
| 83 | d_krylov_freebody_mob_solver->setMobilitySolver(this); |
| 84 | d_krylov_freebody_mob_solver->setStokesSpecifications(*navier_stokes_integrator->getStokesSpecifications()); |
| 85 | } |
| 86 | |
| 87 | IBAMR_DO_ONCE(t_solve_mobility_system = |
| 88 | TimerManager::getManager()->getTimer("IBAMR::CIBMobilitySolver::solveMobilitySystem()"); |
| 89 | t_solve_body_mobility_system = |
| 90 | TimerManager::getManager()->getTimer("IBAMR::CIBMobilitySolver::solveBodyMobilitySystem()"); |
| 91 | t_initialize_solver_state = |
| 92 | TimerManager::getManager()->getTimer("IBAMR::CIBMobilitySolver::initializeSolverState()"); |
| 93 | t_deallocate_solver_state = |
| 94 | TimerManager::getManager()->getTimer("IBAMR::CIBMobilitySolver::deallocateSolverState()");); |
| 95 | |
| 96 | return; |
| 97 | } // CIBMobilitySolver |
| 98 | |
| 99 | CIBMobilitySolver::~CIBMobilitySolver() |
| 100 | { |
nothing calls this directly
no test coverage detected