Reference documentation for deal.II version 9.5.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// Copyright (C) 1998 - 2022 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
17
19namespace NonMatching
20{
21 template <int dim, int spacedim>
23 const std::vector<Point<dim>> & points,
24 const std::vector<double> & weights,
25 const std::vector<Tensor<1, spacedim>> &normals)
26 : Quadrature<dim>(points, weights)
27 , normals(normals)
28 {
29 AssertDimension(weights.size(), points.size());
30 AssertDimension(normals.size(), points.size());
31 for (const auto &normal : normals)
32 {
33 (void)normal;
34 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
35 ExcMessage("Normal is not normalized."));
36 }
37 }
38
39
40
41 template <int dim, int spacedim>
42 void
44 const Point<dim> & point,
45 const double weight,
46 const Tensor<1, spacedim> &normal)
47 {
48 this->quadrature_points.push_back(point);
49 this->weights.push_back(weight);
50 this->normals.push_back(normal);
51 Assert(std::abs(normal.norm() - 1.0) < 1e-9,
52 ExcMessage("Normal is not normalized."));
53 }
54
55
56
57 template <int dim, int spacedim>
60 const unsigned int i) const
61 {
62 AssertIndexRange(i, this->size());
63 return normals[i];
64 }
65
66
67
68 template <int dim, int spacedim>
69 const std::vector<Tensor<1, spacedim>> &
71 {
72 return normals;
73 }
74
75
76
83
84} // 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:112
std::vector< double > weights
Definition quadrature.h:339
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#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 > &)