deal.II version GIT relicensing-2888-ge8e3b84039 2025-03-21 18:30:00+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: LGPL-2.1-or-later
4// Copyright (C) 2017 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#include <deal.II/base/point.h>
16#include <deal.II/base/tensor.h>
17
19
20
22namespace NonMatching
23{
24 template <int dim, int spacedim>
26 const std::vector<Point<dim>> &points,
27 const std::vector<double> &weights,
28 const std::vector<Tensor<1, spacedim>> &normals)
29 : Quadrature<dim>(points, weights)
30 , normals(normals)
31 {
32 AssertDimension(weights.size(), points.size());
33 AssertDimension(normals.size(), points.size());
34 for (const auto &normal : normals)
35 {
36 (void)normal;
37 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
38 ExcMessage("Normal is not normalized."));
39 }
40 }
41
42
43
44 template <int dim, int spacedim>
45 inline void
47 {
48 this->quadrature_points.clear();
49 this->weights.clear();
50 this->normals.clear();
51 }
52
53
54
55 template <int dim, int spacedim>
56 void
58 const Point<dim> &point,
59 const double weight,
60 const Tensor<1, spacedim> &normal)
61 {
62 this->quadrature_points.push_back(point);
63 this->weights.push_back(weight);
64 this->normals.push_back(normal);
65 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
66 ExcMessage("Normal is not normalized."));
67 }
68
69
70
71 template <int dim, int spacedim>
74 const unsigned int i) const
75 {
76 AssertIndexRange(i, this->size());
77 return normals[i];
78 }
79
80
81
82 template <int dim, int spacedim>
83 const std::vector<Tensor<1, spacedim>> &
88
89
90
97
98} // 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:113
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:40
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:41
#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:745
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)