Reference documentation for deal.II version GIT d91250a7db 2022-12-07 13:00:01+00:00
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
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
16
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)
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  {
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>
58  const Tensor<1, 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:111
std::vector< double > weights
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:458
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:459
#define Assert(cond, exc)
Definition: exceptions.h:1501
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1695
#define AssertIndexRange(index, range)
Definition: exceptions.h:1760
static ::ExceptionBase & ExcMessage(std::string arg1)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Definition: utilities.cc:189
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:493
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)