51 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
53 typedef dealii::VectorizedArray<Number> scalar;
55 typedef FaceIntegrator<dim, n_components, Number> IntegratorFace;
58 LaplaceKernel() : degree(1), tau(dealii::make_vectorized_array<Number>(0.0))
63 reinit(dealii::MatrixFree<dim, Number>
const & matrix_free,
65 unsigned int const dof_index)
69 dealii::FiniteElement<dim>
const & fe = matrix_free.get_dof_handler(dof_index).get_fe();
72 calculate_penalty_parameter(matrix_free, dof_index);
76 calculate_penalty_parameter(dealii::MatrixFree<dim, Number>
const & matrix_free,
77 unsigned int const dof_index)
79 IP::calculate_penalty_parameter<dim, Number>(array_penalty_parameter, matrix_free, dof_index);
83 get_integrator_flags(
bool const is_dg)
const
87 flags.cell_evaluate = dealii::EvaluationFlags::gradients;
88 flags.cell_integrate = dealii::EvaluationFlags::gradients;
92 flags.face_evaluate = dealii::EvaluationFlags::values | dealii::EvaluationFlags::gradients;
93 flags.face_integrate = dealii::EvaluationFlags::values | dealii::EvaluationFlags::gradients;
98 flags.face_evaluate = dealii::EvaluationFlags::nothing;
99 flags.face_integrate = dealii::EvaluationFlags::values;
106 get_mapping_flags(
bool const compute_interior_face_integrals,
107 bool const compute_boundary_face_integrals)
111 flags.cells = dealii::update_gradients | dealii::update_JxW_values;
113 if(compute_interior_face_integrals)
116 dealii::update_gradients | dealii::update_JxW_values | dealii::update_normal_vectors;
119 if(compute_boundary_face_integrals)
121 flags.boundary_faces = dealii::update_gradients | dealii::update_JxW_values |
122 dealii::update_normal_vectors | dealii::update_quadrature_points;
129 reinit_face(IntegratorFace & integrator_m,
130 IntegratorFace & integrator_p,
131 unsigned int const dof_index)
const
133 tau = std::max(integrator_m.read_cell_data(array_penalty_parameter),
134 integrator_p.read_cell_data(array_penalty_parameter)) *
135 IP::get_penalty_factor<dim, Number>(
138 integrator_m.get_matrix_free().get_dof_handler(dof_index).get_triangulation()),
143 reinit_boundary_face(IntegratorFace & integrator_m,
unsigned int const dof_index)
const
145 tau = integrator_m.read_cell_data(array_penalty_parameter) *
146 IP::get_penalty_factor<dim, Number>(
149 integrator_m.get_matrix_free().get_dof_handler(dof_index).get_triangulation()),
154 reinit_face_cell_based(dealii::types::boundary_id
const boundary_id,
155 IntegratorFace & integrator_m,
156 IntegratorFace & integrator_p,
157 unsigned int const dof_index)
const
159 if(boundary_id == dealii::numbers::internal_face_boundary_id)
161 tau = std::max(integrator_m.read_cell_data(array_penalty_parameter),
162 integrator_p.read_cell_data(array_penalty_parameter)) *
163 IP::get_penalty_factor<dim, Number>(
166 integrator_m.get_matrix_free().get_dof_handler(dof_index).get_triangulation()),
171 tau = integrator_m.read_cell_data(array_penalty_parameter) *
172 IP::get_penalty_factor<dim, Number>(
175 integrator_m.get_matrix_free().get_dof_handler(dof_index).get_triangulation()),
181 inline DEAL_II_ALWAYS_INLINE
183 calculate_gradient_flux(T
const & value_m, T
const & value_p)
const
185 return -0.5 * (value_m - value_p);
189 inline DEAL_II_ALWAYS_INLINE
191 calculate_value_flux(T
const & normal_gradient_m,
192 T
const & normal_gradient_p,
194 T
const & value_p)
const
196 return 0.5 * (normal_gradient_m + normal_gradient_p) - tau * (value_m - value_p);
204 dealii::AlignedVector<scalar> array_penalty_parameter;
232 static unsigned int const rank =
233 (n_components == 1) ? 0 : ((n_components == dim) ? 1 : dealii::numbers::invalid_unsigned_int);
235 typedef OperatorBase<dim, Number, n_components> Base;
238 typedef typename Base::IntegratorCell IntegratorCell;
239 typedef typename Base::IntegratorFace IntegratorFace;
241 typedef typename Base::Range Range;
243 typedef dealii::Tensor<rank, dim, dealii::VectorizedArray<Number>> value;
245 typedef typename Base::VectorType VectorType;
248 typedef Number value_type;
251 initialize(dealii::MatrixFree<dim, Number>
const & matrix_free,
252 dealii::AffineConstraints<Number>
const & affine_constraints,
258 return operator_data;
262 calculate_penalty_parameter(dealii::MatrixFree<dim, Number>
const & matrix_free,
263 unsigned int const dof_index);
266 update_penalty_parameter();
271 set_inhomogeneous_boundary_values(VectorType & solution)
const final;
278 rhs_add_dirichlet_bc_from_dof_vector(VectorType & dst, VectorType
const & src)
const;
282 reinit_face_derived(IntegratorFace & integrator_m,
283 IntegratorFace & integrator_p,
284 unsigned int const face)
const final;
287 reinit_boundary_face_derived(IntegratorFace & integrator_m,
unsigned int const face)
const final;
290 reinit_face_cell_based_derived(IntegratorFace & integrator_m,
291 IntegratorFace & integrator_p,
292 unsigned int const cell,
293 unsigned int const face,
294 dealii::types::boundary_id
const boundary_id)
const final;
297 do_cell_integral(IntegratorCell & integrator)
const final;
300 do_face_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p)
const final;
303 do_face_int_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p)
const final;
306 do_face_ext_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p)
const final;
309 do_boundary_integral(IntegratorFace & integrator_m,
310 OperatorType
const & operator_type,
311 dealii::types::boundary_id
const & boundary_id)
const final;
314 cell_loop_empty(dealii::MatrixFree<dim, Number>
const & matrix_free,
316 VectorType
const & src,
317 Range
const & range)
const;
320 face_loop_empty(dealii::MatrixFree<dim, Number>
const & matrix_free,
322 VectorType
const & src,
323 Range
const & range)
const;
327 boundary_face_loop_inhom_operator_dirichlet_bc_from_dof_vector(
328 dealii::MatrixFree<dim, Number>
const & matrix_free,
330 VectorType
const & src,
331 Range
const & range)
const;
335 do_boundary_integral_dirichlet_bc_from_dof_vector(
336 IntegratorFace & integrator_m,
337 OperatorType
const & operator_type,
338 dealii::types::boundary_id
const & boundary_id)
const;
342 do_boundary_integral_continuous(IntegratorFace & integrator_m,
343 dealii::types::boundary_id
const & boundary_id)
const final;