Reference documentation for deal.II version 9.6.0
\(\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
16
18namespace NonMatching
19{
20 template <int dim, int spacedim>
22 const std::vector<Point<dim>> &points,
23 const std::vector<double> &weights,
24 const std::vector<Tensor<1, spacedim>> &normals)
25 : Quadrature<dim>(points, weights)
26 , normals(normals)
27 {
28 AssertDimension(weights.size(), points.size());
29 AssertDimension(normals.size(), points.size());
30 for (const auto &normal : normals)
31 {
32 (void)normal;
33 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
34 ExcMessage("Normal is not normalized."));
35 }
36 }
37
38
39
40 template <int dim, int spacedim>
41 inline void
43 {
44 this->quadrature_points.clear();
45 this->weights.clear();
46 this->normals.clear();
47 }
48
49
50
51 template <int dim, int spacedim>
52 void
54 const Point<dim> &point,
55 const double weight,
56 const Tensor<1, spacedim> &normal)
57 {
58 this->quadrature_points.push_back(point);
59 this->weights.push_back(weight);
60 this->normals.push_back(normal);
61 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
62 ExcMessage("Normal is not normalized."));
63 }
64
65
66
67 template <int dim, int spacedim>
70 const unsigned int i) const
71 {
72 AssertIndexRange(i, this->size());
73 return normals[i];
74 }
75
76
77
78 template <int dim, int spacedim>
79 const std::vector<Tensor<1, spacedim>> &
84
85
86
93
94} // 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:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)