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,
254 bool const assemble_matrix);
259 return operator_data;
263 calculate_penalty_parameter(dealii::MatrixFree<dim, Number>
const & matrix_free,
264 unsigned int const dof_index);
267 update_penalty_parameter();
272 set_inhomogeneous_constrained_values(VectorType & solution)
const final;
279 rhs_add_dirichlet_bc_from_dof_vector(VectorType & dst, VectorType
const & src)
const;
283 reinit_face_derived(IntegratorFace & integrator_m,
284 IntegratorFace & integrator_p,
285 unsigned int const face)
const final;
288 reinit_boundary_face_derived(IntegratorFace & integrator_m,
unsigned int const face)
const final;
291 reinit_face_cell_based_derived(IntegratorFace & integrator_m,
292 IntegratorFace & integrator_p,
293 unsigned int const cell,
294 unsigned int const face,
295 dealii::types::boundary_id
const boundary_id)
const final;
298 do_cell_integral(IntegratorCell & integrator)
const final;
301 do_face_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p)
const final;
304 do_face_int_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p)
const final;
307 do_face_ext_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p)
const final;
310 do_boundary_integral(IntegratorFace & integrator_m,
311 OperatorType
const & operator_type,
312 dealii::types::boundary_id
const & boundary_id)
const final;
315 cell_loop_empty(dealii::MatrixFree<dim, Number>
const & matrix_free,
317 VectorType
const & src,
318 Range
const & range)
const;
321 face_loop_empty(dealii::MatrixFree<dim, Number>
const & matrix_free,
323 VectorType
const & src,
324 Range
const & range)
const;
328 boundary_face_loop_inhom_operator_dirichlet_bc_from_dof_vector(
329 dealii::MatrixFree<dim, Number>
const & matrix_free,
331 VectorType
const & src,
332 Range
const & range)
const;
336 do_boundary_integral_dirichlet_bc_from_dof_vector(
337 IntegratorFace & integrator_m,
338 OperatorType
const & operator_type,
339 dealii::types::boundary_id
const & boundary_id)
const;
343 do_boundary_integral_continuous(IntegratorFace & integrator_m,
344 dealii::types::boundary_id
const & boundary_id)
const final;