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

Method initializeSolverState

src/IB/CIBMobilitySolver.cpp:258–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256} // getMobilitySolvers
257
258void
259CIBMobilitySolver::initializeSolverState(Vec x, Vec b)
260{
261 IBAMR_TIMER_START(t_initialize_solver_state);
262
263 // Deallocate the solver state if the solver is already initialized.
264 if (d_is_initialized)
265 {
266 d_reinitializing_solver = true;
267 deallocateSolverState();
268 }
269
270 if (d_mobility_solver_type == KRYLOV)
271 {
272 d_krylov_mob_solver->initializeSolverState(x, b);
273 }
274 else if (d_mobility_solver_type == DIRECT)
275 {
276 d_direct_mob_solver->initializeSolverState(x, b);
277 }
278 else
279 {
280 TBOX_ERROR("CIBMobilitySolver::initializeSolverState() Unknown mobility solver type" << std::endl);
281 }
282
283 d_has_free_parts = false;
284 for (unsigned part = 0; part < d_num_rigid_parts && !d_has_free_parts; ++part)
285 {
286 int num_free_dofs;
287 d_cib_strategy->getSolveRigidBodyVelocity(part, num_free_dofs);
288 if (num_free_dofs)
289 {
290 d_has_free_parts = true;
291 }
292 }
293 if (d_has_free_parts)
294 {
295 d_krylov_freebody_mob_solver->initializeSolverState(x, b);
296 }
297
298 // Indicate that the solver is initialized.
299 d_reinitializing_solver = false;
300 d_is_initialized = true;
301
302 IBAMR_TIMER_STOP(t_initialize_solver_state);
303
304 return;
305} // initializeSolverState
306
307void
308CIBMobilitySolver::deallocateSolverState()

Callers 12

applyProjectionMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
initializeSolverMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected