67class SpatialOperatorBase :
public dealii::Subscriptor
70 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
71 typedef dealii::LinearAlgebra::distributed::BlockVector<Number> BlockVectorType;
73 typedef SpatialOperatorBase<dim, Number> This;
75 typedef dealii::VectorizedArray<Number> scalar;
76 typedef dealii::Tensor<1, dim, dealii::VectorizedArray<Number>> vector;
77 typedef dealii::Tensor<2, dim, dealii::VectorizedArray<Number>> tensor;
79 typedef std::pair<unsigned int, unsigned int> Range;
81 typedef FaceIntegrator<dim, dim, Number> FaceIntegratorU;
82 typedef FaceIntegrator<dim, 1, Number> FaceIntegratorP;
90 SpatialOperatorBase(std::shared_ptr<
Grid<dim> const> grid,
91 std::shared_ptr<dealii::Mapping<dim>
const> mapping,
96 std::string
const & field,
97 MPI_Comm
const & mpi_comm);
102 virtual ~SpatialOperatorBase(){};
120 setup(std::shared_ptr<dealii::MatrixFree<dim, Number>
const> matrix_free,
122 std::string
const & dof_index_temperature =
"");
131 setup_preconditioners_and_solvers()
146 dealii::MatrixFree<dim, Number>
const &
147 get_matrix_free()
const;
150 get_dof_name_velocity()
const;
153 get_dof_index_velocity()
const;
156 get_dof_index_pressure()
const;
159 get_quad_index_velocity_standard()
const;
162 get_quad_index_pressure()
const;
166 get_dof_index_velocity_scalar()
const;
169 get_quad_index_velocity_overintegration()
const;
172 get_quad_index_velocity_nodal_points()
const;
175 get_quad_index_pressure_nodal_points()
const;
178 get_quad_index_velocity_linearized()
const;
181 std::shared_ptr<dealii::Mapping<dim>
const>
184 dealii::FiniteElement<dim>
const &
187 dealii::FiniteElement<dim>
const &
190 dealii::DoFHandler<dim>
const &
191 get_dof_handler_u()
const;
193 dealii::DoFHandler<dim>
const &
194 get_dof_handler_u_scalar()
const;
196 dealii::DoFHandler<dim>
const &
197 get_dof_handler_p()
const;
199 dealii::AffineConstraints<Number>
const &
200 get_constraint_p()
const;
202 dealii::AffineConstraints<Number>
const &
203 get_constraint_u()
const;
205 dealii::types::global_dof_index
206 get_number_of_dofs()
const;
208 dealii::VectorizedArray<Number>
209 get_viscosity_boundary_face(
unsigned int const face,
unsigned int const q)
const;
212 std::shared_ptr<ContainerInterfaceData<1, dim, double>>
213 get_container_interface_data();
216 set_velocity_ptr(VectorType
const & velocity)
const;
222 initialize_vector_velocity(VectorType & src)
const;
225 initialize_vector_velocity_scalar(VectorType & src)
const;
228 initialize_vector_pressure(VectorType & src)
const;
231 initialize_block_vector_velocity_pressure(BlockVectorType & src)
const;
237 prescribe_initial_conditions(VectorType & velocity,
238 VectorType & pressure,
239 double const time)
const;
245 interpolate_functions(VectorType & velocity,
246 std::shared_ptr<dealii::Function<dim>>
const & f_velocity,
247 VectorType & pressure,
248 std::shared_ptr<dealii::Function<dim>>
const & f_pressure,
249 double const time)
const;
255 interpolate_analytical_solution(VectorType & velocity,
256 VectorType & pressure,
257 double const time)
const;
262 interpolate_stress_bc(VectorType & stress,
263 VectorType
const & velocity,
264 VectorType
const & pressure)
const;
274 calculate_time_step_max_efficiency(
unsigned int const order_time_integrator)
const;
278 calculate_time_step_cfl_global()
const;
282 calculate_time_step_cfl(VectorType
const & velocity)
const;
286 calculate_cfl_from_time_step(VectorType & cfl,
287 VectorType
const & velocity,
288 double const time_step_size)
const;
294 get_characteristic_element_length()
const;
305 is_pressure_level_undefined()
const;
310 adjust_pressure_level_if_undefined(VectorType & pressure,
double const & time)
const;
316 set_temperature(VectorType
const & temperature);
325 compute_vorticity(VectorType & dst, VectorType
const & src)
const;
329 compute_divergence(VectorType & dst, VectorType
const & src)
const;
333 compute_shear_rate(VectorType & dst, VectorType
const & src)
const;
337 compute_velocity_magnitude(VectorType & dst, VectorType
const & src)
const;
341 compute_vorticity_magnitude(VectorType & dst, VectorType
const & src)
const;
345 compute_streamfunction(VectorType & dst, VectorType
const & src)
const;
349 compute_q_criterion(VectorType & dst, VectorType
const & src)
const;
353 get_viscosity(VectorType & dst, VectorType
const & src)
const;
361 apply_mass_operator(VectorType & dst, VectorType
const & src)
const;
364 apply_mass_operator_add(VectorType & dst, VectorType
const & src)
const;
368 evaluate_add_body_force_term(VectorType & dst,
double const time)
const;
372 evaluate_convective_term(VectorType & dst, VectorType
const & src, Number
const time)
const;
376 evaluate_pressure_gradient_term(VectorType & dst,
377 VectorType
const & src,
378 double const time)
const;
382 evaluate_velocity_divergence_term(VectorType & dst,
383 VectorType
const & src,
384 double const time)
const;
388 apply_inverse_mass_operator(VectorType & dst, VectorType
const & src)
const;
394 update_viscosity(VectorType
const & velocity)
const;
400 update_projection_operator(VectorType
const & velocity,
double const time_step_size)
const;
403 rhs_add_projection_operator(VectorType & dst,
double const time)
const;
406 solve_projection(VectorType & dst,
407 VectorType
const & src,
408 bool const & update_preconditioner)
const;
414 calculate_dissipation_convective_term(VectorType
const & velocity,
double const time)
const;
417 calculate_dissipation_viscous_term(VectorType
const & velocity)
const;
420 calculate_dissipation_divergence_term(VectorType
const & velocity)
const;
423 calculate_dissipation_continuity_term(VectorType
const & velocity)
const;
429 update_after_grid_motion(
bool const update_matrix_free);
435 set_grid_velocity(VectorType
const & velocity);
441 distribute_constraint_u(VectorType & velocity)
const;
448 setup_projection_solver();
451 unsteady_problem_has_to_be_solved()
const;
456 std::shared_ptr<Grid<dim>
const> grid;
462 std::shared_ptr<dealii::Mapping<dim>
const> mapping;
464 std::shared_ptr<MultigridMappings<dim, Number>>
const multigrid_mappings;
469 std::shared_ptr<BoundaryDescriptor<dim>
const> boundary_descriptor;
470 std::shared_ptr<FieldFunctions<dim>
const> field_functions;
480 std::string
const field;
496 std::shared_ptr<Poisson::BoundaryDescriptor<0, dim>> boundary_descriptor_laplace;
501 dealii::Point<dim> first_point;
502 dealii::types::global_dof_index dof_index_first_point;
508 mutable double evaluation_time;
514 std::shared_ptr<dealii::FiniteElement<dim>> fe_u;
515 std::shared_ptr<dealii::FiniteElement<dim>> fe_p;
516 std::shared_ptr<dealii::FiniteElement<dim>> fe_u_scalar;
518 dealii::DoFHandler<dim> dof_handler_u;
519 dealii::DoFHandler<dim> dof_handler_p;
520 dealii::DoFHandler<dim> dof_handler_u_scalar;
522 dealii::AffineConstraints<Number> constraint_u, constraint_p, constraint_u_scalar;
524 std::string
const dof_index_u =
"velocity";
525 std::string
const dof_index_p =
"pressure";
526 std::string
const dof_index_u_scalar =
"velocity_scalar";
528 std::string
const quad_index_u =
"velocity";
529 std::string
const quad_index_p =
"pressure";
530 std::string
const quad_index_u_overintegration =
"velocity_overintegration";
531 std::string
const quad_index_u_nodal_points =
"velocity_nodal_points";
532 std::string
const quad_index_p_nodal_points =
"pressure_nodal_points";
534 std::shared_ptr<MatrixFreeData<dim, Number>
const> matrix_free_data;
535 std::shared_ptr<dealii::MatrixFree<dim, Number>
const> matrix_free;
540 std::shared_ptr<dealii::MatrixFree<dim, Number>> matrix_free_own_storage;
542 bool pressure_level_is_undefined;
547 std::shared_ptr<ContainerInterfaceData<1, dim, double>> interface_data_dirichlet_cached;
556 std::shared_ptr<Operators::ConvectiveKernel<dim, Number>> convective_kernel;
557 std::shared_ptr<Operators::ViscousKernel<dim, Number>> viscous_kernel;
559 std::shared_ptr<Operators::DivergencePenaltyKernel<dim, Number>> div_penalty_kernel;
560 std::shared_ptr<Operators::ContinuityPenaltyKernel<dim, Number>> conti_penalty_kernel;
583 InverseMassOperator<dim, dim, Number> inverse_mass_velocity;
584 InverseMassOperator<dim, 1, Number> inverse_mass_velocity_scalar;
595 std::shared_ptr<ProjOperator> projection_operator;
604 std::shared_ptr<ELEMENTWISE_PROJ_OPERATOR> elementwise_projection_operator;
607 ELEMENTWISE_PRECONDITIONER;
608 std::shared_ptr<ELEMENTWISE_PRECONDITIONER> elementwise_preconditioner_projection;
611 std::shared_ptr<Krylov::SolverBase<VectorType>> projection_solver;
612 std::shared_ptr<PreconditionerBase<Number>> preconditioner_projection;
624 MPI_Comm
const mpi_comm;
626 dealii::ConditionalOStream pcout;
631 calculate_minimum_element_length()
const;
637 initialize_boundary_descriptor_laplace();
640 initialize_dof_handler_and_constraints();
643 initialize_dirichlet_cached_bc();
646 initialize_operators(std::string
const & dof_index_temperature);
649 initialize_calculators_for_derived_quantities();
652 initialization_pure_dirichlet_bc();
655 cell_loop_empty(dealii::MatrixFree<dim, Number>
const &,
663 face_loop_empty(dealii::MatrixFree<dim, Number>
const &,
671 local_interpolate_stress_bc_boundary_face(dealii::MatrixFree<dim, Number>
const & matrix_free,
673 VectorType
const & src,
674 Range
const & face_range)
const;
679 mutable VectorType
const * velocity_ptr;
680 mutable VectorType
const * pressure_ptr;