| 113 | /////////////////////////////// PUBLIC /////////////////////////////////////// |
| 114 | |
| 115 | KrylovMobilitySolver::KrylovMobilitySolver(std::string object_name, |
| 116 | Pointer<INSStaggeredHierarchyIntegrator> navier_stokes_integrator, |
| 117 | Pointer<CIBStrategy> cib_strategy, |
| 118 | Pointer<Database> input_db, |
| 119 | std::string default_options_prefix, |
| 120 | MPI_Comm petsc_comm) |
| 121 | : d_object_name(std::move(object_name)), |
| 122 | d_options_prefix(std::move(default_options_prefix)), |
| 123 | d_petsc_comm(petsc_comm), |
| 124 | d_samrai_temp(2, Pointer<SAMRAIVectorReal<NDIM, PetscScalar>>(nullptr)), |
| 125 | d_ins_integrator(navier_stokes_integrator), |
| 126 | d_cib_strategy(cib_strategy) |
| 127 | { |
| 128 | // Get values from the input database. |
| 129 | if (input_db) getFromInput(input_db); |
| 130 | |
| 131 | // Create the Stokes solver (LInv) for the linear operator. |
| 132 | // Create databases for setting up LInv solver. |
| 133 | std::string stokes_solver_type = StaggeredStokesSolverManager::PETSC_KRYLOV_SOLVER; |
| 134 | Pointer<Database> stokes_solver_db = nullptr; |
| 135 | if (input_db->keyExists("stokes_solver_type")) |
| 136 | { |
| 137 | stokes_solver_type = input_db->getString("stokes_solver_type"); |
| 138 | if (input_db->keyExists("stokes_solver_db")) |
| 139 | { |
| 140 | stokes_solver_db = input_db->getDatabase("stokes_solver_db"); |
| 141 | } |
| 142 | } |
| 143 | if (!stokes_solver_db) |
| 144 | { |
| 145 | stokes_solver_db = new MemoryDatabase("stokes_solver_db"); |
| 146 | stokes_solver_db->putString("ksp_type", "fgmres"); |
| 147 | } |
| 148 | |
| 149 | std::string stokes_precond_type = StaggeredStokesSolverManager::DEFAULT_BLOCK_PRECONDITIONER; |
| 150 | Pointer<Database> stokes_precond_db = nullptr; |
| 151 | if (input_db->keyExists("stokes_precond_type")) |
| 152 | { |
| 153 | stokes_precond_type = input_db->getString("stokes_precond_type"); |
| 154 | if (input_db->keyExists("stokes_precond_db")) |
| 155 | { |
| 156 | stokes_precond_db = input_db->getDatabase("stokes_precond_db"); |
| 157 | } |
| 158 | } |
| 159 | if (!stokes_precond_db) |
| 160 | { |
| 161 | stokes_precond_db = new MemoryDatabase("stokes_precond_db"); |
| 162 | stokes_precond_db->putInteger("max_iterations", 1); |
| 163 | } |
| 164 | |
| 165 | std::string velocity_solver_type = IBTK::SCPoissonSolverManager::PETSC_KRYLOV_SOLVER; |
| 166 | Pointer<Database> velocity_solver_db = nullptr; |
| 167 | if (input_db->keyExists("velocity_solver_type")) |
| 168 | { |
| 169 | velocity_solver_type = input_db->getString("velocity_solver_type"); |
| 170 | if (input_db->keyExists("velocity_solver_db")) |
| 171 | { |
| 172 | velocity_solver_db = input_db->getDatabase("velocity_solver_db"); |
nothing calls this directly
no test coverage detected