41 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
42 typedef dealii::LinearAlgebra::distributed::BlockVector<Number> BlockVectorType;
48 : pde_operator(
nullptr), rhs_vector(
nullptr), time(0.0), scaling_factor_mass(1.0)
55 this->pde_operator = &pde_operator;
59 update(VectorType
const & rhs_vector,
double const & time,
double const & scaling_factor)
61 this->rhs_vector = &rhs_vector;
63 this->scaling_factor_mass = scaling_factor;
71 evaluate_residual(BlockVectorType & dst, BlockVectorType
const & src)
const
73 pde_operator->evaluate_nonlinear_residual(dst, src, rhs_vector, time, scaling_factor_mass);
79 VectorType
const * rhs_vector;
81 double scaling_factor_mass;
88 typedef dealii::LinearAlgebra::distributed::BlockVector<Number> BlockVectorType;
100 this->pde_operator = &pde_operator;
108 set_solution_linearization(BlockVectorType
const & solution_linearization)
const
110 pde_operator->set_velocity_ptr(solution_linearization.block(0));
119 vmult(BlockVectorType & dst, BlockVectorType
const & src)
const
121 pde_operator->apply_linearized_problem(dst, src);
132 typedef dealii::LinearAlgebra::distributed::BlockVector<Number> BlockVectorType;
144 pde_operator = pde_operator_in;
150 pde_operator->update_block_preconditioner();
152 this->update_needed =
false;
158 return update_needed;
162 vmult(BlockVectorType & dst, BlockVectorType
const & src)
const
164 AssertThrow(this->update_needed ==
false,
166 "BlockPreconditioner can not be applied because it is not up-to-date."));
168 pde_operator->apply_block_preconditioner(dst, src);
171 std::shared_ptr<TimerTree>
176 "Function get_timings() is not implemented for BlockPreconditioner."));
178 return std::make_shared<TimerTree>();
196 typedef typename Base::VectorType VectorType;
198 typedef typename Base::BlockVectorType BlockVectorType;
205 std::shared_ptr<dealii::Mapping<dim>
const> mapping,
210 std::string
const & field,
211 MPI_Comm
const & mpi_comm);
220 setup_derived()
final;
223 setup_preconditioners_and_solvers()
final;
231 update_divergence_penalty_operator(VectorType
const & velocity);
238 update_continuity_penalty_operator(VectorType
const & velocity);
249 set_scaling_factor_continuity(
double const scaling_factor);
262 solve_linear_stokes_problem(BlockVectorType & dst,
263 BlockVectorType
const & src,
264 bool const & update_preconditioner,
265 double const & scaling_factor_mass = 1.0);
274 std::tuple<unsigned int, unsigned int>
275 solve_nonlinear_problem(BlockVectorType & dst,
276 VectorType
const & rhs_vector,
277 bool const & update_preconditioner,
278 double const & time = 0.0,
279 double const & scaling_factor_mass = 1.0);
286 evaluate_nonlinear_residual(BlockVectorType & dst,
287 BlockVectorType
const & src,
288 VectorType
const * rhs_vector,
290 double const & scaling_factor_mass)
const;
299 evaluate_nonlinear_residual_steady(BlockVectorType & dst,
300 BlockVectorType
const & src,
301 double const & time)
const;
307 apply_linearized_problem(BlockVectorType & dst, BlockVectorType
const & src)
const;
316 rhs_stokes_problem(BlockVectorType & dst,
double const & time = 0.0)
const;
322 update_block_preconditioner();
325 apply_block_preconditioner(BlockVectorType & dst, BlockVectorType
const & src)
const;
329 setup_solver_coupled();
335 setup_block_preconditioner();
338 initialize_vectors();
341 initialize_preconditioner_velocity_block();
344 setup_multigrid_preconditioner_momentum();
347 setup_iterative_solver_momentum();
350 initialize_preconditioner_pressure_block();
353 setup_multigrid_preconditioner_schur_complement();
356 setup_iterative_solver_schur_complement();
359 setup_pressure_convection_diffusion_operator();
362 apply_preconditioner_velocity_block(VectorType & dst, VectorType
const & src)
const;
365 apply_preconditioner_pressure_block(VectorType & dst, VectorType
const & src)
const;
368 apply_inverse_negative_laplace_operator(VectorType & dst, VectorType
const & src)
const;
375 VectorType
mutable temp_vector;
377 double scaling_factor_continuity;
393 std::shared_ptr<Krylov::SolverBase<BlockVectorType>> linear_solver;
402 std::shared_ptr<PreconditionerBase<Number>> preconditioner_momentum;
404 std::shared_ptr<Krylov::SolverBase<VectorType>> solver_velocity_block;
407 std::shared_ptr<PreconditionerBase<Number>> multigrid_preconditioner_schur_complement;
408 std::shared_ptr<PreconditionerBase<Number>> inverse_mass_preconditioner_schur_complement;
410 std::shared_ptr<ConvDiff::CombinedOperator<dim, Number>> pressure_conv_diff_operator;
412 std::shared_ptr<Poisson::LaplaceOperator<dim, Number, 1>> laplace_operator;
414 std::shared_ptr<Krylov::SolverBase<VectorType>> solver_pressure_block;
417 VectorType
mutable vec_tmp_pressure;
418 VectorType
mutable vec_tmp_velocity, vec_tmp_velocity_2;
421 VectorType
mutable tmp_scp_pressure;
422 VectorType
mutable tmp_scp_velocity, tmp_scp_velocity_2;