Reference documentation for deal.II version GIT edc7d5c3ce 2023-09-25 07:10:03+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\}}\)
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 
19 namespace 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  inline void
44  {
45  this->quadrature_points.clear();
46  this->weights.clear();
47  this->normals.clear();
48  }
49 
50 
51 
52  template <int dim, int spacedim>
53  void
55  const Point<dim> &point,
56  const double weight,
57  const Tensor<1, spacedim> &normal)
58  {
59  this->quadrature_points.push_back(point);
60  this->weights.push_back(weight);
61  this->normals.push_back(normal);
62  Assert(std::abs(normal.norm() - 1.0) < 1e-9,
63  ExcMessage("Normal is not normalized."));
64  }
65 
66 
67 
68  template <int dim, int spacedim>
69  const Tensor<1, spacedim> &
71  const unsigned int i) const
72  {
73  AssertIndexRange(i, this->size());
74  return normals[i];
75  }
76 
77 
78 
79  template <int dim, int spacedim>
80  const std::vector<Tensor<1, spacedim>> &
82  {
83  return normals;
84  }
85 
86 
87 
88  template class ImmersedSurfaceQuadrature<1, 1>;
89  template class ImmersedSurfaceQuadrature<2, 2>;
90  template class ImmersedSurfaceQuadrature<3, 3>;
91  template class ImmersedSurfaceQuadrature<0, 1>;
92  template class ImmersedSurfaceQuadrature<1, 2>;
93  template class ImmersedSurfaceQuadrature<2, 3>;
94 
95 } // 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:345
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
#define Assert(cond, exc)
Definition: exceptions.h:1616
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1789
#define AssertIndexRange(index, range)
Definition: exceptions.h:1857
static ::ExceptionBase & ExcMessage(std::string arg1)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Definition: utilities.cc:192
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim >>> &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double >> &properties={})
Definition: generators.cc:490
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)