Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
mortar_coupling_manager.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2025-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_core_mortar_coupling_manager_h
5#define lethe_core_mortar_coupling_manager_h
6
7#include <deal.II/base/config.h>
8
10#include <core/parameters.h>
11#include <core/utilities.h>
12
13#include <deal.II/base/mpi_noncontiguous_partitioner.h>
14
15#include <deal.II/fe/fe_system.h>
16
17#include <deal.II/matrix_free/fe_point_evaluation.h>
18
19using namespace dealii;
20
21/**
22 * @brief Base class for the mortar manager
23 */
24template <int dim>
26{
27public:
28 /**
29 * @brief Mortar manager base constructor
30 *
31 * @tparam dim2 Quadrature dimension
32 * @param[in] n_subdivisions Number of cells at the interface between inner
33 * and outer domains
34 * @param[in] interface_dimensions Vector containing the radius at the mortar
35 * interface and the domain length in the direction of the rotation axis
36 * @param[in] quadrature Quadrature for local cell operations
37 * @param[in] rotation_angle Rotation angle for the inner domain
38 * @param[in] rotation_axis_direction Direction of the rotation axis
39 * @param[in] stage_heights Vector containing the unique vertex heights at the
40 * mortar interface
41 */
42 template <int dim2>
43 MortarManagerBase(const std::vector<unsigned int> &n_subdivisions,
44 const std::vector<double> &interface_dimensions,
45 const Quadrature<dim2> &quadrature,
46 const double rotation_angle,
47 const unsigned int rotation_axis_direction = 2,
48 const std::vector<double> &stage_heights = {0.0, 1.0});
49
50 /**
51 * @brief Default destructor
52 */
53 virtual ~MortarManagerBase() = default;
54
55 /**
56 * @brief Verify if cells of the inner and outer domains are aligned
57 */
58 bool
59 is_mesh_aligned() const;
60
61 /**
62 * @brief Returns the total number of mortars
63 */
64 unsigned int
65 get_n_total_mortars() const;
66
67 /**
68 * @brief Returns the number of mortar cells connecting rotor-stator regular cells at the interface
69 * 1 = rotor-stator meshes are aligned. Only one mortar cell is needed to
70 * connect each rotor-stator regular cell pair
71 * 2 = rotor-stator meshes are not aligned. Two mortar cells are linked to
72 * each rotor or stator regular cell
73 */
74 unsigned int
75 get_n_mortars() const;
76
77 /**
78 * @brief Returns the indices of all mortars at both sides of the interface
79 *
80 * @param[in] face_center Face center
81 * @param[in] is_inner Boolean that indicates whether the face is part of the
82 * rotor (inner) side of the mortar interface
83 */
84 std::vector<unsigned int>
85 get_mortar_indices(const Point<dim> &face_center, const bool is_inner) const;
86
87 /**
88 * @brief Returns the total number of quadrature points at all mortar cells
89 */
90 unsigned int
91 get_n_total_points() const;
92
93 /**
94 * @brief Returns the number of quadrature points at the mortar cells connected to a given cell
95 */
96 unsigned int
97 get_n_points() const;
98
99 /**
100 * @brief Returns the coordinates of the quadrature points at both sides of the interface in the real space
101 *
102 * @param[in] face_center Face center
103 * @param[in] is_inner Boolean that indicates whether the face is part of the
104 * rotor (inner) side of the mortar interface
105 *
106 * @return points Coordinate of quadrature points of the cell in the real space
107 */
108 std::vector<Point<dim>>
109 get_points(const Point<dim> &face_center, const bool is_inner) const;
110
111 /**
112 * @brief Returns the coordinates of the quadrature points at both sides of the interface in the reference space
113 *
114 * @param[in] face_center Face center
115 * @param[in] is_inner Boolean that indicates whether the face is part of the
116 * rotor (inner) side of the mortar interface
117 *
118 * @return points Coordinate of quadrature points of the cell in the reference space
119 */
120 std::vector<Point<std::max(1, dim - 1)>>
121 get_points_ref(const Point<dim> &face_center, const bool is_inner) const;
122
123 /**
124 * @brief Returns the weights of the quadrature points at both sides of the interface
125 *
126 * @param[in] face_center Face center
127 * @param[in] is_inner Boolean that indicates whether the face is part of the
128 * rotor (inner) side of the mortar interface
129 *
130 * @return points Angular weights of quadrature points of the cell
131 */
132 std::vector<double>
133 get_weights(const Point<dim> &face_center, const bool is_inner) const;
134
135 /**
136 * @brief Returns the normal vector for the quadrature points
137 *
138 * @param[in] face_center Face center
139 * @param[in] is_inner Boolean that indicates whether the face is part of the
140 * rotor (inner) side of the mortar interface
141 *
142 * @return result Normal vectors of the cell quadrature points
143 */
144 std::vector<Tensor<1, dim, double>>
145 get_normals(const Point<dim> &face_center, const bool is_inner) const;
146
147 /// Number of cells at the interface between inner and outer domains
148 std::vector<unsigned int> n_subdivisions;
149 /// Vector containing the radius at the mortar interface and the domain length
150 /// in the direction of the rotation axis
151 std::vector<double> interface_dimensions;
152
153protected:
154 /**
155 * @brief Returns the mesh alignment type and cell index
156 *
157 * @param[in] face_center Face center
158 * @param[in] is_inner Boolean that indicates whether the face is part of the
159 * rotor (inner) side of the mortar interface
160 *
161 * @return type Cell configuration type at the interface
162 * type = 0: mesh aligned
163 * type = 1: mesh not aligned, inner domain (allows rotation)
164 * type = 2: mesh not aligned, outer domain (fixed)
165 * @return id_in_plane Index of the cell in which lies the rotated cell center
166 * @return id_out_plane Second index of the cell in which lies the rotated cell center.
167 *
168 * The id_out_plane corresponds to indexes along the rotation axis, and it is
169 * necessary only for 3D problems
170 */
171 std::tuple<unsigned int, unsigned int, unsigned int>
172 get_config(const Point<dim> &face_center, const bool is_inner) const;
173
174 /**
175 * @brief Convert angle (in radians) to quadrature point in real space
176 *
177 * @param[in] angle_rad Angle (in radians)
178 * @return Point in cartesian coordinates
179 */
180 virtual Point<dim>
181 from_1D(const double angle_rad) const = 0;
182
183 /**
184 * @brief Convert quadrature point in real space to angle (in radians)
185 *
186 * @param[in] point Point in cartesian coordinates
187 * @return Angle (in radians)
188 */
189 virtual double
190 to_1D(const Point<dim> &point) const = 0;
191
192 /**
193 * @brief Return the normal for a given quadrature point
194 *
195 * @param[in] point Point in cartesian coordinates
196 * @return Corresponding outward normal vector
197 */
198 virtual Tensor<1, dim, double>
199 get_normal(const Point<dim> &point) const = 0;
200
201 /// Mortar quadrature
202 Quadrature<std::max(1, dim - 1)> quadrature;
203 /// Number of quadrature points per cell
204 const unsigned int n_quadrature_points;
205 /// Rotation angle for the inner domain
206 const double rotation_angle;
207 /// Direction of the rotation axis (x=0, y=1, z=2)
208 const unsigned int rotation_axis_direction;
209 /// Stage heights at the mortar interface along the rotation axis
210 /// in 3D problems. A stage is defined as a plane perpendicular to the
211 /// rotation axis containing vertices of the same height.
212 const std::vector<double> stage_heights;
213};
214
215/**
216 * @brief Compute the number of cells located at the mortar interface
217 *
218 * @param[in] triangulation The triangulation object
219 * @param[in] mortar_parameters The information about the mortar method
220 * control, including the rotor mesh parameters
221 *
222 * @return number_interface_cells Number of cells at the interface between inner
223 * and outer domains
224 */
225template <int dim>
226std::vector<unsigned int>
228 const Triangulation<dim> &triangulation,
229 const Parameters::Mortar<dim> &mortar_parameters);
230
231/**
232 * @brief Compute circular mortar interface dimensions and the rotor mesh pre-rotation angle
233 * @param[in] triangulation The triangulation object
234 * @param[in] mapping Mapping associated to the domain
235 * @param[in] mortar_parameters The information about the mortar method control,
236 * including the rotor mesh parameters
237 *
238 * @return interface_dimensions Vector containing the radius at the mortar interface and the
239 * domain length in the direction of the rotation axis
240 * @return pre_rotation_angle Rotation angle of the initial mesh configuration
241 */
242template <int dim>
243std::tuple<std::vector<double>, double>
245 const Triangulation<dim> &triangulation,
246 const Mapping<dim> &mapping,
247 const Parameters::Mortar<dim> &mortar_parameters);
248
249/**
250 * @brief Compute linear mortar interface dimensions
251 * @param[in] triangulation The triangulation object
252 * @param[in] mapping Mapping associated to the domain
253 * @param[in] mortar_parameters The information about the mortar method control,
254 * including the rotor mesh parameters
255 *
256 * @return interface_dimensions Vector containing the minimum and maximum
257 * y coordinates of the vertices at the extremeties of the mortar interface
258 */
259template <int dim>
260std::pair<double, double>
262 const Triangulation<dim> &triangulation,
263 const Mapping<dim> &mapping,
264 const Parameters::Mortar<dim> &mortar_parameters);
265
266/**
267 * @brief Construct oversampled quadrature
268 *
269 * @param[in] quadrature Quadrature for local cell operations
270 * @param[in] mortar_parameters The information about the mortar method
271 * control, including the rotor mesh parameters
272 *
273 * @return Quadrature oversampled
274 */
275template <int dim>
276Quadrature<dim>
277construct_quadrature(const Quadrature<dim> &quadrature,
278 const Parameters::Mortar<dim> &mortar_parameters);
279
280/**
281 * @brief Compute the stage heights in the direction of the
282 * rotation axis at the mortar interface. Stages are defined as planes
283 * perpendicular to the rotation axis containing vertices of the same
284 * height. There will always be one more stage than the number of
285 * cells in the rotation axis direction.
286 * @param[in] triangulation The triangulation object
287 * @param[in] mortar_parameters The information about the mortar method
288 * control, including the rotor mesh parameters
289 *
290 * @return Vector of stage heights in the rotation axis direction.
291 */
292template <int dim>
293std::vector<double>
294compute_stage_heights(const Triangulation<dim> &triangulation,
295 const Parameters::Mortar<dim> &mortar_parameters);
296
297/**
298 * @brief Compute workload imbalance of mortar cells
299 *
300 * @param[in] triangulation The triangulation object
301 * @param[in] mortar_parameters The information about the mortar method
302 * control, including the rotor mesh parameters
303 * @param[in] pcout Parallel conditional output stream used to print the
304 * information
305 */
306template <int dim>
307void
308mortar_workload_imbalance(const Triangulation<dim> &triangulation,
309 const Parameters::Mortar<dim> &mortar_parameters,
310 const ConditionalOStream &pcout);
311
312/**
313 * @brief Mortar manager class for circular interface
314 */
315template <int dim>
317{
318public:
319 /**
320 * @brief Class constructor for circular mortar interface used in
321 * Poisson/Stokes test cases
322 * TODO: Move Poisson/Stokes tests to prototypes and remove this constructor
323 *
324 * @tparam dim2 Quadrature dimension
325 * @param[in] n_subdivisions Number of cells at the interface between inner
326 * and outer domains
327 * @param[in] interface_dimensions Vector containing the radius at the mortar
328 * interface and the domain length in the direction of the rotation axis
329 * @param[in] quadrature Quadrature for local cell operations
330 * @param[in] rotation_angle Rotation angle for the inner domain
331 * @param[in] rotation_axis_direction Direction of the rotation axis
332 * @param[in] stage_heights Vector containing the unique vertex heights at the
333 * mortar interface
334 * @param[in] center_of_rotation Center of rotation of the inner domain
335 * @param[in] pre_rotation_angle Initial rotation angle used for computing
336 * mortar locations, accounting for cases here the element edges are not
337 * aligned with the x axis
338 */
339 template <int dim2>
340 MortarManagerCircle(const std::vector<unsigned int> &n_subdivisions,
341 const std::vector<double> &interface_dimensions,
342 const Quadrature<dim2> &quadrature,
343 const double rotation_angle,
344 const unsigned int rotation_axis_direction = 2,
345 const std::vector<double> &stage_heights = {0.0, 1.0},
346 const Point<dim> &center_of_rotation = Point<dim>(),
347 const double pre_rotation_angle = 0.0);
348
349 /**
350 * @brief Class constructor for circular interface used within the Navier-Stokes
351 * base
352 *
353 * @tparam dim2 Quadrature dimension
354 * @param[in] quadrature Quadrature for local cell operations
355 * @param[in] mapping Mapping associated to the domain
356 * @param[in] dof_handler DoFHandler associated to the triangulation
357 * @param[in] mortar_parameters The information about the mortar method
358 * control, including the rotor mesh parameters
359 */
360 template <int dim2>
361 MortarManagerCircle(const Quadrature<dim2> &quadrature,
362 const Mapping<dim> &mapping,
363 const DoFHandler<dim> &dof_handler,
364 const Parameters::Mortar<dim> &mortar_parameters);
365
366protected:
367 Point<dim>
368 from_1D(const double angle_rad) const override;
369
370 double
371 to_1D(const Point<dim> &point) const override;
372
373 Tensor<1, dim, double>
374 get_normal(const Point<dim> &point) const override;
375
376 /// Initial rotation angle used for computing mortar locations, accounting for
377 /// cases here the element edges are not aligned with the x axis
378 const double pre_rotation_angle;
379
380 /// Center of rotation of the inner domain
381 const Point<dim> center_of_rotation;
382};
383
384/**
385 * @brief Mortar manager class for linear interface
386 */
387template <int dim>
389{
390public:
391 /**
392 * @brief Class constructor for linear interface used within the Navier-Stokes
393 * base
394 *
395 * @tparam dim2 Quadrature dimension
396 * @param[in] quadrature Quadrature for local cell operations
397 * @param[in] mapping Mapping associated to the domain
398 * @param[in] dof_handler DoFHandler associated to the triangulation
399 * @param[in] mortar_parameters The information about the mortar method
400 * control, including the rotor mesh parameters
401 */
402 template <int dim2>
403 MortarManagerLinear(const Quadrature<dim2> &quadrature,
404 const Mapping<dim> &mapping,
405 const DoFHandler<dim> &dof_handler,
406 const Parameters::Mortar<dim> &mortar_parameters);
407
408protected:
409 Point<dim>
410 from_1D(const double angle_rad) const override;
411
412 double
413 to_1D(const Point<dim> &point) const override;
414
415 Tensor<1, dim, double>
416 get_normal(const Point<dim> &) const override;
417
418 /// Minimum y coordinate of interface nodes
419 double coord_min;
420 /// Maximum y coordinate of interface nodes
421 double coord_max;
422};
423
424template <int dim>
425template <int dim2>
427 const std::vector<unsigned int> &n_subdivisions,
428 const std::vector<double> &interface_dimensions,
429 const Quadrature<dim2> &quadrature_in,
430 const double rotation_angle,
431 const unsigned int rotation_axis_direction,
432 const std::vector<double> &stage_heights)
435 , quadrature(quadrature_in.get_tensor_basis()[0])
440{}
441
442template <int dim>
443template <int dim2>
445 const std::vector<unsigned int> &n_subdivisions,
446 const std::vector<double> &interface_dimensions,
447 const Quadrature<dim2> &quadrature,
448 const double rotation_angle,
449 const unsigned int rotation_axis_direction,
450 const std::vector<double> &stage_heights,
451 const Point<dim> &center_of_rotation,
452 const double pre_rotation_angle)
461{}
462
463
464template <int dim>
465template <int dim2>
467 const Quadrature<dim2> &quadrature,
468 const Mapping<dim> &mapping,
469 const DoFHandler<dim> &dof_handler,
470 const Parameters::Mortar<dim> &mortar_parameters)
472 compute_number_interface_cells(dof_handler.get_triangulation(),
473 mortar_parameters),
474 std::get<0>(
475 compute_interface_dimensions_circular(dof_handler.get_triangulation(),
476 mapping,
477 mortar_parameters)),
478 construct_quadrature(quadrature, mortar_parameters),
479 mortar_parameters.rotor_rotation_angle->value(Point<dim>()),
480 mortar_parameters.rotation_axis_direction,
481 compute_stage_heights(dof_handler.get_triangulation(), mortar_parameters),
482 mortar_parameters.center_of_rotation,
483 std::get<1>(
484 compute_interface_dimensions_circular(dof_handler.get_triangulation(),
485 mapping,
486 mortar_parameters)))
487{}
488
489template <int dim>
490template <int dim2>
492 const Quadrature<dim2> &quadrature,
493 const Mapping<dim> &mapping,
494 const DoFHandler<dim> &dof_handler,
495 const Parameters::Mortar<dim> &mortar_parameters)
496 : MortarManagerBase<dim>(
497 compute_number_interface_cells(dof_handler.get_triangulation(),
498 mortar_parameters),
499 std::vector<double>{
500 (std::get<1>(
501 compute_interface_dimensions_linear(dof_handler.get_triangulation(),
502 mapping,
503 mortar_parameters)) -
504 std::get<0>(
505 compute_interface_dimensions_linear(dof_handler.get_triangulation(),
506 mapping,
507 mortar_parameters))) /
508 (2.0 * numbers::PI),
509 1.0},
510 construct_quadrature(quadrature, mortar_parameters),
511 0.0,
512 2,
513 std::vector<double>{0.0, 1.0})
514{
515 std::tie(this->coord_min, this->coord_max) =
516 compute_interface_dimensions_linear(dof_handler.get_triangulation(),
517 mapping,
518 mortar_parameters);
519}
520
521/**
522 * @brief Compute inner product
523 *
524 * @param[in] grad Rank-1 tensor
525 * @param[in] normal Rank-1 tensor
526 *
527 * @return Rank-0 tensor
528 */
529template <int dim, typename Number>
530inline Number
531contract(const Tensor<1, dim, Number> &grad,
532 const Tensor<1, dim, Number> &normal)
533{
534 return grad * normal;
535}
536
537/**
538 * @brief Compute inner product
539 *
540 * @param[in] grad Rank-2 tensor
541 * @param[in] normal Rank-1 tensor
542 *
543 * @return Rank-1 tensor
544 */
545template <int dim, typename Number>
546inline Tensor<1, dim, Number>
547contract(const Tensor<2, dim, Number> &grad,
548 const Tensor<1, dim, Number> &normal)
549{
550 return grad * normal;
551}
552
553/**
554 * @brief Compute outer product for the multicomponent case
555 *
556 * @param[in] grad Rank-1 tensor
557 * @param[in] normal Rank-1 tensor
558 *
559 * @return Rank-0 tensor
560 *
561 */
562template <int n_components, int dim, typename Number>
563inline Tensor<1, n_components, Number>
564contract(const Tensor<1, n_components, Tensor<1, dim, Number>> &grad,
565 const Tensor<1, dim, Number> &normal)
566{
567 Tensor<1, n_components, Number> result;
568
569 for (int r = 0; r < n_components; ++r)
570 result[r] = grad[r] * normal;
571
572 return result;
573}
574
575/**
576 * @brief Compute outer product
577 *
578 * @param[in] value Rank-0 tensor
579 * @param[in] normal Rank-1 tensor
580 *
581 * @return Rank-1 tensor
582 */
583template <int dim, typename Number>
584inline Tensor<1, dim, Number>
585outer(const Number &value, const Tensor<1, dim, Number> &normal)
586{
587 return value * normal;
588}
589
590
591/**
592 * @brief Compute outer product
593 *
594 * @param[in] value Rank-1 tensor
595 * @param[in] normal Rank-1 tensor
596 *
597 * @return Rank-2 tensor
598 */
599template <int dim, typename Number>
600inline Tensor<2, dim, Number>
601outer(const Tensor<1, dim, Number> &value, const Tensor<1, dim, Number> &normal)
602{
603 Tensor<2, dim, Number> result;
604
605 for (int c = 0; c < dim; ++c)
606 result[c] = value[c] * normal;
607
608 return result;
609}
610
611/**
612 * @brief Compute outer product
613 *
614 * @param[in] value Rank-1 tensor for n_components
615 * @param[in] normal Rank-1 tensor
616 *
617 * @return Rank-2 tensor for n_components
618 */
619template <int n_components, int dim, typename Number>
620inline Tensor<1, n_components, Tensor<1, dim, Number>>
621outer(const Tensor<1, n_components, Number> &value,
622 const Tensor<1, dim, Number> &normal)
623{
624 Tensor<1, n_components, Tensor<1, dim, Number>> result;
625
626 for (int c = 0; c < n_components; ++c)
627 result[c] = value[c] * normal;
628
629 return result;
630}
631
632/**
633 * @brief Compute scalar product
634 *
635 * @param[in, out] v_gradient Rank-1 tensor within rank-1 tensor where result is
636 * stored
637 * @param[in] u_gradient Rank-2 tensor
638 * @param[in] factor Scalar factor
639 */
640template <int dim, int dim_, typename Number>
641inline DEAL_II_ALWAYS_INLINE void
642symm_scalar_product_add(Tensor<1, dim_, Tensor<1, dim, Number>> &v_gradient,
643 const Tensor<2, dim, Number> &u_gradient,
644 const Number &factor)
645{
646 for (int d = 0; d < dim; ++d)
647 v_gradient[d][d] += u_gradient[d][d] * factor;
648
649 for (int e = 0; e < dim; ++e)
650 for (int d = e + 1; d < dim; ++d)
651 {
652 const auto tmp = (u_gradient[d][e] + u_gradient[e][d]) * (factor * 0.5);
653 v_gradient[d][e] += tmp;
654 v_gradient[e][d] += tmp;
655 }
656}
657
658/**
659 * @brief Compute scalar product
660 *
661 * @param[in, out] v_gradient Rank-2 tensor where result is stored
662 * @param[in] u_gradient Rank-2 tensor
663 * @param[in] factor Scalar factor
664 */
665template <int dim, typename Number>
666inline DEAL_II_ALWAYS_INLINE void
667symm_scalar_product_add(Tensor<2, dim, Number> &v_gradient,
668 const Tensor<2, dim, Number> &u_gradient,
669 const Number &factor)
670{
671 for (int d = 0; d < dim; ++d)
672 v_gradient[d][d] += u_gradient[d][d] * factor;
673
674 for (int e = 0; e < dim; ++e)
675 for (int d = e + 1; d < dim; ++d)
676 {
677 const auto tmp = (u_gradient[d][e] + u_gradient[e][d]) * (factor * 0.5);
678 v_gradient[d][e] += tmp;
679 v_gradient[e][d] += tmp;
680 }
681}
682
683/**
684 * @brief Compute scalar product
685 *
686 * @param[in, out] v_gradient Rank-2 tensor where result is stored
687 * @param[in] u_gradient Rank-2 tensor
688 * @param[in] factor Scalar factor
689 */
690template <typename Number>
691inline DEAL_II_ALWAYS_INLINE void
692symm_scalar_product_add(Tensor<1, 1, Number> &v_gradient,
693 const Tensor<1, 1, Number> &u_gradient,
694 const Number &factor)
695{
696 v_gradient[0] += u_gradient[0] * factor;
697}
698
699
700
701template <int dim, typename Number>
703{
704 /// Penalty factor (akin to penalty factor in SIPG)
706 /// Penalty parameter in symmetric interior penalty Galerkin (SIPG) method
707 std::vector<Number> all_penalty_parameter;
708 /// Weights of quadrature points
709 std::vector<Number> all_weights;
710 // Normal vectors of quadrature points
711 std::vector<Tensor<1, dim, Number>> all_normals;
712};
713
714
715
716/**
717 * @brief Base class for coupling evaluation routines.
718 */
719template <int dim, typename Number>
721{
722public:
723 virtual ~CouplingEvaluationBase() = default;
724 /**
725 * Number of data points of type Number associated to a quadrature point.
726 */
727 virtual unsigned int
728 data_size() const = 0;
729
730 /**
731 * @brief Return relevant dof indices.
732 */
733 virtual const std::vector<unsigned int> &
735
736 /**
737 * @brief Set up mapping information
738 *
739 * @param[in] cell Cell iterator
740 * @param[in] points List of points where FEPointIntegrator should be
741 * evaluated
742 */
743 virtual void
744 local_reinit(const typename Triangulation<dim>::cell_iterator &cell,
745 const ArrayView<const Point<dim, Number>> &points) const = 0;
746
747 /**
748 * @brief Evaluate values and gradients at the coupling entries
749 *
750 * @param[in] data Coupling evaluation data containing values of normals,
751 * weights, and penalty parameters at each integration point
752 * @param[in,out] buffer Temporary vector where data is stored before being
753 * passes to the system matrix
754 * @param[in] ptr_q Pointer for the quadrature point index related to the
755 * rotor-stator interface
756 * @param[in] q_stride Pointer for the cell index in which the quadrature
757 * point lies in
758 * @param[in] all_value_m Number of values stored in the mortar side of the
759 * interface
760 */
761 virtual void
763 const Vector<Number> &buffer,
764 const unsigned int ptr_q,
765 const unsigned int q_stride,
766 Number *all_value_m) const = 0;
767
768 /**
769 * @brief Perform integral of mortar elements at the rotor-stator interface
770 *
771 * @param[in] data Coupling evaluation data containing values of normals,
772 * weights, and penalty parameters at each integration point
773 * @param[in] buffer Temporary vector where data is stored before being passes
774 * to the system matrix
775 * @param[in] ptr_q Pointer for the quadrature point index related to the
776 * rotor-stator interface
777 * @param[in] q_stride Pointer for the cell index in which the quadrature
778 * point lies in
779 * @param[in] all_value_m Number of values stored in the mortar side of the
780 * interface
781 * @param[in] all_value_p Number of values stored in the non-mortar side of
782 * the interface
783 *
784 * Notation referring to quantities on both mortar sides:
785 * {{.}} = avg(.), and [.] = jump(.) *
786 */
787 virtual void
789 Vector<Number> &buffer,
790 const unsigned int ptr_q,
791 const unsigned int q_stride,
792 Number *all_value_m,
793 Number *all_value_p) const = 0;
794};
795
796
797
798/**
799 * @brief Base class for the Coupling Operator Base
800 */
801template <int dim, typename Number>
803{
804public:
805 /**
806 * @brief Mortar coupling operator constructor
807 *
808 * @param[in] mapping Mapping associated to the domain
809 * @param[in] dof_handler DoFHandler associated to the triangulation
810 * @param[in] constraints Constraints object
811 * @param[in] evaluator Mortar evaluation data
812 * @param[in] mortar_manager Mortar manager
813 * @param[in] bid_m Boundary ID of the face whose outwards-pointing
814 * normal shows in the same direction as the normal provided by
815 * @p mortar_manager.
816 * @param[in] bid_p Boundary ID of the face whose outwards-pointing normal
817 * shows in the opposite direction as the normal provided by
818 * @p mortar_manager.
819 * @param[in] sip_factor Penalty factor used in SIPG term
820 */
822 const Mapping<dim> &mapping,
823 const DoFHandler<dim> &dof_handler,
824 const AffineConstraints<Number> &constraints,
825 const std::shared_ptr<CouplingEvaluationBase<dim, Number>> &evaluator,
826 const std::shared_ptr<MortarManagerBase<dim>> &mortar_manager,
827 const unsigned int bid_m,
828 const unsigned int bid_p,
829 const double sip_factor);
830
831 /**
832 * @brief Return object containing problem constraints
833 *
834 * @return AffineConstraints
835 */
836 const AffineConstraints<Number> &
838
839 /**
840 * @brief Add matrix-vector multiplication
841 *
842 * @param[in, out] dst Destination vector holding the result
843 * @param[in] src Input source vector
844 */
845 template <typename VectorType>
846 void
847 vmult_add(VectorType &dst, const VectorType &src) const;
848
849 /**
850 * @brief Add mortar coupling terms in diagonal entries
851 *
852 * @param[in, out] diagonal Matrix diagonal
853 */
854 template <typename VectorType>
855 void
856 add_diagonal_entries(VectorType &diagonal) const;
857
858 /**
859 * @brief Add mortar coupling terms in the sparsity pattern
860 *
861 * @param[in, out] dsp Dynamic Sparsity Pattern object
862 */
863 void
864 add_sparsity_pattern_entries(SparsityPatternBase &dsp) const;
865
866 /**
867 * @brief Add mortar coupling terms in the system matrix
868 *
869 * @param[in, out] system_matrix System matrix
870 */
871 void
873 TrilinosWrappers::SparseMatrix &system_matrix) const;
874
875private:
876 /**
877 * @brief Compute penalty factor used in weak imposition of coupling at the rotor-stator interface
878 *
879 * @param[in] degree Polynomial degree of the FE approximation
880 * @param[in] factor Penalty factor (akin to penalty factor in SIPG)
881 *
882 * @return penalty factor value
883 * penalty_factor = (degree + 1)^2
884 */
885 static Number
886 compute_penalty_factor(const unsigned int degree, const Number factor);
887
888 /**
889 * @brief Compute penalty parameter in a cell
890 *
891 * @param[in] cell Cell iterator
892 * @return Penalty parameter
893 *
894 * @return penalty parameter value from SIPG method
895 * penalty_parameter = (A(∂Ω_e \ Γ_h)/2 + A(∂Ω_e ∩ Γ_h))/V(Ω_e)
896 */
897 Number
899 const typename Triangulation<dim>::cell_iterator &cell) const;
900
901 /**
902 * @brief Returns the point corresponding to the cell center
903 *
904 * @param[in] cell Cell iterator
905 * @param[in] face Face iterator
906 *
907 * @return Cell center in cartesian coordinates
908 */
909 Point<dim>
910 get_face_center(const typename Triangulation<dim>::cell_iterator &cell,
911 const typename Triangulation<dim>::face_iterator &face) const;
912
913 /**
914 * @brief Returns dof indices
915 *
916 * @param[in] cell Cell iterator
917 *
918 * @return Vector of global dof indices
919 */
920 std::vector<types::global_dof_index>
922 const typename DoFHandler<dim>::active_cell_iterator &cell) const;
923
924
925 /// Mapping associated to the domain
926 const Mapping<dim> &mapping;
927 /// DoFHandler associated to the triangulation
928 const DoFHandler<dim> &dof_handler;
929
930 std::vector<std::tuple<std::vector<double>,
931 typename Triangulation<dim>::active_cell_iterator,
932 std::vector<Point<dim>>,
933 typename Triangulation<dim>::active_cell_iterator,
934 std::vector<Point<dim>>,
935 std::vector<Tensor<1, dim, Number>>,
936 Number>>
938
939protected:
940 /// Number of data points per quadrature point
941 unsigned int q_data_size;
942
943 /// Boundary ID of the face whose outwards-pointing normal shows in the
944 /// same direction as the normal provided by @p mortar_manager
945 const unsigned int bid_m;
946 /// Boundary ID of the face whose outwards-pointing normal shows in the
947 /// opposite direction as the normal provided by @p mortar_manager
948 const unsigned int bid_p;
949
950 /// List of relevant DoF indices per cell
951 std::vector<unsigned int> relevant_dof_indices;
952 /// Number of DoFs per cell
953 unsigned int n_dofs_per_cell;
954
955 Utilities::MPI::NoncontiguousPartitioner partitioner;
956
957 std::vector<types::global_dof_index> dof_indices;
958 std::vector<types::global_dof_index> dof_indices_ghost;
959
960 /// Vectors storing information at quadrature points for all cells at the
961 /// rotor-stator interface
962 std::vector<Point<dim, Number>> all_points_ref;
964
965 /// Constraints extended according to mortar entries
966 AffineConstraints<Number> constraints_extended;
967 std::shared_ptr<const Utilities::MPI::Partitioner> partitioner_extended;
968
969 std::shared_ptr<CouplingEvaluationBase<dim, Number>> evaluator;
970 std::shared_ptr<MortarManagerBase<dim>> mortar_manager;
971};
972
973/**
974 * @brief Create a temporary vector where mortar evaluation data is stored
975 * before being passed to the system matrix
976 */
977template <typename T>
979{
980public:
981 /**
982 * @brief Class constructor
983 *
984 * @param[in] ptr Vector of values on one of the mortar sides
985 * @param[in] offset Number of components to offset the ptr vector
986 */
987 BufferRW(T *ptr, const unsigned int offset)
988 : ptr(ptr ? (ptr + offset) : nullptr)
989 {}
990
991 inline void
992 write(const T &in)
993 {
994 ptr[0] = in;
995 ptr += 1;
996 }
997
998 template <int dim>
999 inline void
1000 write(const Tensor<1, dim, T> &in)
1001 {
1002 for (int i = 0; i < dim; ++i)
1003 ptr[i] = in[i];
1004
1005 ptr += dim;
1006 }
1007
1008 template <typename T0>
1009 inline T0
1010 read() const
1011 {
1012 T0 result = {};
1013
1014 if (ptr)
1015 read(result);
1016
1017 return result;
1018 }
1019
1020private:
1021 mutable T *ptr;
1022
1023 template <int dim>
1024 inline void
1025 read(Tensor<1, dim, T> &out) const
1026 {
1027 for (int i = 0; i < dim; ++i)
1028 out[i] = ptr[i];
1029
1030 ptr += dim;
1031 }
1032
1033 inline void
1034 read(T &out) const
1035 {
1036 out = ptr[0];
1037 ptr += 1;
1038 }
1039};
1040
1041
1042
1043template <int dim, int n_components, typename Number>
1045{
1046public:
1047 using FEPointIntegrator = FEPointEvaluation<n_components, dim, dim, Number>;
1048 using value_type = typename FEPointIntegrator::value_type;
1049
1050 ScalarCouplingEvaluationSIPG(const Mapping<dim> &mapping,
1051 const DoFHandler<dim> &dof_handler,
1052 const unsigned int first_selected_component = 0);
1053
1054 unsigned int
1055 data_size() const override;
1056
1057 const std::vector<unsigned int> &
1058 get_relevant_dof_indices() const override;
1059
1060 void
1062 const typename Triangulation<dim>::cell_iterator &cell,
1063 const ArrayView<const Point<dim, Number>> &points) const override;
1064
1065 void
1067 const Vector<Number> &buffer,
1068 const unsigned int ptr_q,
1069 const unsigned int q_stride,
1070 Number *all_value_m) const override;
1071
1072 void
1074 Vector<Number> &buffer,
1075 const unsigned int ptr_q,
1076 const unsigned int q_stride,
1077 Number *all_value_m,
1078 Number *all_value_p) const override;
1079
1080 /// Finite element that matches the components `n_components` components
1081 /// starting at component with index `first_selected_component`
1082 const FESystem<dim> fe_sub;
1083
1084 /// Interface to the evaluation of mortar coupling interpolated solution
1086
1087 /// Relevant dof indices
1088 std::vector<unsigned int> relevant_dof_indices;
1089};
1090
1091template <int dim, typename Number>
1093 : public CouplingEvaluationBase<dim, Number>
1094{
1095public:
1096 using FEPointIntegratorU = FEPointEvaluation<dim, dim, dim, Number>;
1097 using FEPointIntegratorP = FEPointEvaluation<1, dim, dim, Number>;
1098
1099 using u_value_type = typename FEPointIntegratorU::value_type;
1100
1101 /**
1102 * @brief Class constructor
1103 * @param[in] mapping Mapping associated to the domain
1104 * @param[in] dof_handler DoFHandler associated to the triangulation
1105 * @param[in] kinematic_vicosity Kinematic viscosity
1106 */
1107 NavierStokesCouplingEvaluationSIPG(const Mapping<dim> &mapping,
1108 const DoFHandler<dim> &dof_handler,
1109 const double kinematic_viscosity);
1110
1111 /**
1112 * @brief Default destructor
1113 */
1115
1116 unsigned int
1117 data_size() const override;
1118
1119 const std::vector<unsigned int> &
1120 get_relevant_dof_indices() const override;
1121
1122 void
1124 const typename Triangulation<dim>::cell_iterator &cell,
1125 const ArrayView<const Point<dim, Number>> &points) const override;
1126
1127 void
1129 const Vector<Number> &buffer,
1130 const unsigned int ptr_q,
1131 const unsigned int q_stride,
1132 Number *all_values_local) const override;
1133
1134 void
1136 Vector<Number> &buffer,
1137 const unsigned int ptr_q,
1138 const unsigned int q_stride,
1139 Number *all_values_m,
1140 Number *all_values_p) const override;
1141
1142 /// Finite element that matches the components `n_components` components
1143 /// starting at component with index `first_selected_component`.
1144 const FESystem<dim> fe_sub_u;
1145 const FESystem<dim> fe_sub_p;
1146
1147 /// Interface to the evaluation of mortar coupling interpolated solution
1150
1151 /// Relevant dof indices
1152 std::vector<unsigned int> relevant_dof_indices;
1153
1154 /// Kinematic viscosity
1156};
1157
1158#endif
void read(T &out) const
BufferRW(T *ptr, const unsigned int offset)
Class constructor.
void write(const Tensor< 1, dim, T > &in)
void read(Tensor< 1, dim, T > &out) const
void write(const T &in)
Base class for coupling evaluation routines.
virtual void local_reinit(const typename Triangulation< dim >::cell_iterator &cell, const ArrayView< const Point< dim, Number > > &points) const =0
Set up mapping information.
virtual void local_evaluate(const CouplingEvaluationData< dim, Number > &data, const Vector< Number > &buffer, const unsigned int ptr_q, const unsigned int q_stride, Number *all_value_m) const =0
Evaluate values and gradients at the coupling entries.
virtual void local_integrate(const CouplingEvaluationData< dim, Number > &data, Vector< Number > &buffer, const unsigned int ptr_q, const unsigned int q_stride, Number *all_value_m, Number *all_value_p) const =0
Perform integral of mortar elements at the rotor-stator interface.
virtual ~CouplingEvaluationBase()=default
virtual const std::vector< unsigned int > & get_relevant_dof_indices() const =0
Return relevant dof indices.
virtual unsigned int data_size() const =0
std::shared_ptr< CouplingEvaluationBase< dim, Number > > evaluator
CouplingEvaluationData< dim, Number > data
CouplingOperator(const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const AffineConstraints< Number > &constraints, const std::shared_ptr< CouplingEvaluationBase< dim, Number > > &evaluator, const std::shared_ptr< MortarManagerBase< dim > > &mortar_manager, const unsigned int bid_m, const unsigned int bid_p, const double sip_factor)
Mortar coupling operator constructor.
void add_diagonal_entries(VectorType &diagonal) const
Add mortar coupling terms in diagonal entries.
const DoFHandler< dim > & dof_handler
DoFHandler associated to the triangulation.
const AffineConstraints< Number > & get_affine_constraints() const
Return object containing problem constraints.
static Number compute_penalty_factor(const unsigned int degree, const Number factor)
Compute penalty factor used in weak imposition of coupling at the rotor-stator interface.
std::vector< types::global_dof_index > dof_indices
unsigned int q_data_size
Number of data points per quadrature point.
void vmult_add(VectorType &dst, const VectorType &src) const
Add matrix-vector multiplication.
const unsigned int bid_m
std::shared_ptr< const Utilities::MPI::Partitioner > partitioner_extended
std::vector< std::tuple< std::vector< double >, typename Triangulation< dim >::active_cell_iterator, std::vector< Point< dim > >, typename Triangulation< dim >::active_cell_iterator, std::vector< Point< dim > >, std::vector< Tensor< 1, dim, Number > >, Number > > all_intersections
const Mapping< dim > & mapping
Mapping associated to the domain.
void add_system_matrix_entries(TrilinosWrappers::SparseMatrix &system_matrix) const
Add mortar coupling terms in the system matrix.
std::vector< types::global_dof_index > dof_indices_ghost
AffineConstraints< Number > constraints_extended
Constraints extended according to mortar entries.
Point< dim > get_face_center(const typename Triangulation< dim >::cell_iterator &cell, const typename Triangulation< dim >::face_iterator &face) const
Returns the point corresponding to the cell center.
void add_sparsity_pattern_entries(SparsityPatternBase &dsp) const
Add mortar coupling terms in the sparsity pattern.
std::shared_ptr< MortarManagerBase< dim > > mortar_manager
std::vector< types::global_dof_index > get_dof_indices(const typename DoFHandler< dim >::active_cell_iterator &cell) const
Returns dof indices.
Utilities::MPI::NoncontiguousPartitioner partitioner
Number compute_penalty_parameter(const typename Triangulation< dim >::cell_iterator &cell) const
Compute penalty parameter in a cell.
std::vector< Point< dim, Number > > all_points_ref
std::vector< unsigned int > relevant_dof_indices
List of relevant DoF indices per cell.
unsigned int n_dofs_per_cell
Number of DoFs per cell.
const unsigned int bid_p
Base class for the mortar manager.
const unsigned int n_quadrature_points
Number of quadrature points per cell.
virtual double to_1D(const Point< dim > &point) const =0
Convert quadrature point in real space to angle (in radians).
unsigned int get_n_mortars() const
Returns the number of mortar cells connecting rotor-stator regular cells at the interface 1 = rotor-s...
MortarManagerBase(const std::vector< unsigned int > &n_subdivisions, const std::vector< double > &interface_dimensions, const Quadrature< dim2 > &quadrature, const double rotation_angle, const unsigned int rotation_axis_direction=2, const std::vector< double > &stage_heights={0.0, 1.0})
Mortar manager base constructor.
std::vector< Point< std::max(1, dim - 1)> > get_points_ref(const Point< dim > &face_center, const bool is_inner) const
Returns the coordinates of the quadrature points at both sides of the interface in the reference spac...
bool is_mesh_aligned() const
Verify if cells of the inner and outer domains are aligned.
const unsigned int rotation_axis_direction
Direction of the rotation axis (x=0, y=1, z=2).
virtual Tensor< 1, dim, double > get_normal(const Point< dim > &point) const =0
Return the normal for a given quadrature point.
const double rotation_angle
Rotation angle for the inner domain.
const std::vector< double > stage_heights
std::vector< unsigned int > n_subdivisions
Number of cells at the interface between inner and outer domains.
unsigned int get_n_points() const
Returns the number of quadrature points at the mortar cells connected to a given cell.
std::vector< double > get_weights(const Point< dim > &face_center, const bool is_inner) const
Returns the weights of the quadrature points at both sides of the interface.
std::tuple< unsigned int, unsigned int, unsigned int > get_config(const Point< dim > &face_center, const bool is_inner) const
Returns the mesh alignment type and cell index.
Quadrature< std::max(1, dim - 1)> quadrature
Mortar quadrature.
std::vector< double > interface_dimensions
std::vector< Point< dim > > get_points(const Point< dim > &face_center, const bool is_inner) const
Returns the coordinates of the quadrature points at both sides of the interface in the real space.
virtual ~MortarManagerBase()=default
Default destructor.
std::vector< Tensor< 1, dim, double > > get_normals(const Point< dim > &face_center, const bool is_inner) const
Returns the normal vector for the quadrature points.
std::vector< unsigned int > get_mortar_indices(const Point< dim > &face_center, const bool is_inner) const
Returns the indices of all mortars at both sides of the interface.
virtual Point< dim > from_1D(const double angle_rad) const =0
Convert angle (in radians) to quadrature point in real space.
unsigned int get_n_total_points() const
Returns the total number of quadrature points at all mortar cells.
unsigned int get_n_total_mortars() const
Returns the total number of mortars.
MortarManagerCircle(const std::vector< unsigned int > &n_subdivisions, const std::vector< double > &interface_dimensions, const Quadrature< dim2 > &quadrature, const double rotation_angle, const unsigned int rotation_axis_direction=2, const std::vector< double > &stage_heights={0.0, 1.0}, const Point< dim > &center_of_rotation=Point< dim >(), const double pre_rotation_angle=0.0)
Class constructor for circular mortar interface used in Poisson/Stokes test cases TODO: Move Poisson/...
Point< dim > from_1D(const double angle_rad) const override
Convert angle (in radians) to quadrature point in real space.
const Point< dim > center_of_rotation
Center of rotation of the inner domain.
double to_1D(const Point< dim > &point) const override
Convert quadrature point in real space to angle (in radians).
Tensor< 1, dim, double > get_normal(const Point< dim > &point) const override
Return the normal for a given quadrature point.
MortarManagerLinear(const Quadrature< dim2 > &quadrature, const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const Parameters::Mortar< dim > &mortar_parameters)
Class constructor for linear interface used within the Navier-Stokes base.
double to_1D(const Point< dim > &point) const override
Convert quadrature point in real space to angle (in radians).
double coord_min
Minimum y coordinate of interface nodes.
Tensor< 1, dim, double > get_normal(const Point< dim > &) const override
Return the normal for a given quadrature point.
Point< dim > from_1D(const double angle_rad) const override
Convert angle (in radians) to quadrature point in real space.
double coord_max
Maximum y coordinate of interface nodes.
void local_reinit(const typename Triangulation< dim >::cell_iterator &cell, const ArrayView< const Point< dim, Number > > &points) const override
Set up mapping information.
FEPointEvaluation< dim, dim, dim, Number > FEPointIntegratorU
virtual ~NavierStokesCouplingEvaluationSIPG()=default
Default destructor.
FEPointEvaluation< 1, dim, dim, Number > FEPointIntegratorP
NavierStokesCouplingEvaluationSIPG(const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const double kinematic_viscosity)
Class constructor.
const std::vector< unsigned int > & get_relevant_dof_indices() const override
Return relevant dof indices.
void local_integrate(const CouplingEvaluationData< dim, Number > &data, Vector< Number > &buffer, const unsigned int ptr_q, const unsigned int q_stride, Number *all_values_m, Number *all_values_p) const override
Perform integral of mortar elements at the rotor-stator interface.
FEPointIntegratorU phi_u_m
Interface to the evaluation of mortar coupling interpolated solution.
typename FEPointIntegratorU::value_type u_value_type
void local_evaluate(const CouplingEvaluationData< dim, Number > &data, const Vector< Number > &buffer, const unsigned int ptr_q, const unsigned int q_stride, Number *all_values_local) const override
Evaluate values and gradients at the coupling entries.
const double kinematic_viscosity
Kinematic viscosity.
std::vector< unsigned int > relevant_dof_indices
Relevant dof indices.
typename FEPointIntegrator::value_type value_type
void local_integrate(const CouplingEvaluationData< dim, Number > &data, Vector< Number > &buffer, const unsigned int ptr_q, const unsigned int q_stride, Number *all_value_m, Number *all_value_p) const override
Perform integral of mortar elements at the rotor-stator interface.
std::vector< unsigned int > relevant_dof_indices
Relevant dof indices.
const std::vector< unsigned int > & get_relevant_dof_indices() const override
Return relevant dof indices.
void local_reinit(const typename Triangulation< dim >::cell_iterator &cell, const ArrayView< const Point< dim, Number > > &points) const override
Set up mapping information.
FEPointEvaluation< n_components, dim, dim, Number > FEPointIntegrator
unsigned int data_size() const override
ScalarCouplingEvaluationSIPG(const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const unsigned int first_selected_component=0)
FEPointIntegrator phi_m
Interface to the evaluation of mortar coupling interpolated solution.
void local_evaluate(const CouplingEvaluationData< dim, Number > &data, const Vector< Number > &buffer, const unsigned int ptr_q, const unsigned int q_stride, Number *all_value_m) const override
Evaluate values and gradients at the coupling entries.
std::vector< unsigned int > compute_number_interface_cells(const Triangulation< dim > &triangulation, const Parameters::Mortar< dim > &mortar_parameters)
Compute the number of cells located at the mortar interface.
Tensor< 1, dim, Number > outer(const Number &value, const Tensor< 1, dim, Number > &normal)
Compute outer product.
Number contract(const Tensor< 1, dim, Number > &grad, const Tensor< 1, dim, Number > &normal)
Compute inner product.
std::pair< double, double > compute_interface_dimensions_linear(const Triangulation< dim > &triangulation, const Mapping< dim > &mapping, const Parameters::Mortar< dim > &mortar_parameters)
Compute linear mortar interface dimensions.
std::vector< double > compute_stage_heights(const Triangulation< dim > &triangulation, const Parameters::Mortar< dim > &mortar_parameters)
Compute the stage heights in the direction of the rotation axis at the mortar interface....
void mortar_workload_imbalance(const Triangulation< dim > &triangulation, const Parameters::Mortar< dim > &mortar_parameters, const ConditionalOStream &pcout)
Compute workload imbalance of mortar cells.
std::tuple< std::vector< double >, double > compute_interface_dimensions_circular(const Triangulation< dim > &triangulation, const Mapping< dim > &mapping, const Parameters::Mortar< dim > &mortar_parameters)
Compute circular mortar interface dimensions and the rotor mesh pre-rotation angle.
Quadrature< dim > construct_quadrature(const Quadrature< dim > &quadrature, const Parameters::Mortar< dim > &mortar_parameters)
Construct oversampled quadrature.
DEAL_II_ALWAYS_INLINE void symm_scalar_product_add(Tensor< 1, dim_, Tensor< 1, dim, Number > > &v_gradient, const Tensor< 2, dim, Number > &u_gradient, const Number &factor)
Compute scalar product.
std::vector< Tensor< 1, dim, Number > > all_normals
Number penalty_factor
Penalty factor (akin to penalty factor in SIPG).
std::vector< Number > all_weights
Weights of quadrature points.
std::vector< Number > all_penalty_parameter
Penalty parameter in symmetric interior penalty Galerkin (SIPG) method.
Mortar - Defines parameters used to construct mortar elements.
GlobalVectorType VectorType