deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
immersed_surface_quadrature.cc
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2017 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#include <deal.II/base/config.h>
14
17#include <deal.II/base/point.h>
19#include <deal.II/base/tensor.h>
20
22
23#include <Kokkos_Macros.hpp>
24
25#include <cstdlib>
26#include <string>
27#include <vector>
28
29
31namespace NonMatching
32{
33 template <int dim, int spacedim>
35 const std::vector<Point<dim>> &points,
36 const std::vector<double> &weights,
37 const std::vector<Tensor<1, spacedim>> &normals)
38 : Quadrature<dim>(points, weights)
39 , normals(normals)
40 {
41 AssertDimension(weights.size(), points.size());
42 AssertDimension(normals.size(), points.size());
43 for (const auto &normal : normals)
44 {
45 (void)normal;
46 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
47 ExcMessage("Normal is not normalized."));
48 }
49 }
50
51
52
53 template <int dim, int spacedim>
54 void
56 {
57 this->quadrature_points.clear();
58 this->weights.clear();
59 this->normals.clear();
60 }
61
62
63
64 template <int dim, int spacedim>
65 void
67 const Point<dim> &point,
68 const double weight,
69 const Tensor<1, spacedim> &normal)
70 {
71 this->quadrature_points.push_back(point);
72 this->weights.push_back(weight);
73 this->normals.push_back(normal);
74 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
75 ExcMessage("Normal is not normalized."));
76 }
77
78
79
80 template <int dim, int spacedim>
83 const unsigned int i) const
84 {
85 AssertIndexRange(i, this->size());
86 return normals[i];
87 }
88
89
90
91 template <int dim, int spacedim>
92 const std::vector<Tensor<1, spacedim>> &
97
98
99
100 template class ImmersedSurfaceQuadrature<1, 1>;
101 template class ImmersedSurfaceQuadrature<2, 2>;
102 template class ImmersedSurfaceQuadrature<3, 3>;
103 template class ImmersedSurfaceQuadrature<0, 1>;
104 template class ImmersedSurfaceQuadrature<1, 2>;
105 template class ImmersedSurfaceQuadrature<2, 3>;
106
107} // namespace NonMatching
std::vector< Tensor< 1, spacedim > > normals
void push_back(const Point< dim > &point, const double weight, const Tensor< 1, spacedim > &normal)
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
Definition point.h:111
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
std::size_t size
Definition mpi.cc:733
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)