Reference documentation for deal.II version 8.5.1
composition_manifold.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2016 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__composition_manifold_h
17 #define dealii__composition_manifold_h
18 
19 
20 /*---------------------------- composition_manifold.h ------------*/
21 
22 #include <deal.II/base/config.h>
23 #include <deal.II/base/subscriptor.h>
24 #include <deal.II/base/quadrature_lib.h>
25 #include <deal.II/base/thread_management.h>
26 #include <deal.II/base/point.h>
27 #include <deal.II/base/derivative_form.h>
28 #include <deal.II/grid/tria.h>
29 #include <deal.II/grid/tria_iterator.h>
30 #include <deal.II/grid/tria_accessor.h>
31 #include <deal.II/grid/manifold.h>
32 
33 DEAL_II_NAMESPACE_OPEN
34 
66 template <int dim, int spacedim=dim, int chartdim=dim,
67  int intermediate_dim=dim, int dim1=dim, int dim2=dim>
68 class CompositionManifold : public ChartManifold<dim, spacedim, chartdim>
69 {
70 public:
71 
77 
83  virtual
85  pull_back(const Point<spacedim> &space_point) const;
86 
87 
93  virtual
95  push_forward(const Point<chartdim> &chart_point) const;
96 
100  virtual
102  push_forward_gradient(const Point<chartdim> &chart_point) const;
103 
104 private:
110 
111 
117 };
118 
119 
120 /*------------------Template Implementations------------------------*/
121 
122 template <int dim, int spacedim, int chartdim, int intermediate_dim,
123  int dim1, int dim2>
127  ChartManifold<dim,spacedim,chartdim>(F.get_periodicity()),
128  F(&F),
129  G(&G)
130 {
131  // We don't know what to do with a periodicity in the second manifold, so
132  // throw an assertion if the second manifold is periodic
133  Assert(G.get_periodicity().norm() == 0.0,
134  ExcMessage("The second manifold cannot be periodic."));
135 }
136 
137 
138 
139 template <int dim, int spacedim, int chartdim, int intermediate_dim,
140  int dim1, int dim2>
143 {
144  return F->pull_back(G->pull_back(space_point));
145 }
146 
147 
148 
149 template <int dim, int spacedim, int chartdim, int intermediate_dim,
150  int dim1, int dim2>
153 {
154  return G->push_forward(F->push_forward(chart_point));
155 }
156 
157 
158 
159 template <int dim, int spacedim, int chartdim, int intermediate_dim,
160  int dim1, int dim2>
163 {
165  F->push_forward_gradient(chart_point);
166 
168  G->push_forward_gradient(F->push_forward(chart_point));
169 
171 
172  for (unsigned int d=0; d<spacedim; ++d)
173  for (unsigned int c=0; c<chartdim; ++c)
174  for (unsigned int s=0; s<intermediate_dim; ++s)
175  DF_DG[d][c] += DG[d][s]*DF[s][c];
176 
177  return DF_DG;
178 }
179 
180 
181 DEAL_II_NAMESPACE_CLOSE
182 
183 #endif
SmartPointer< const ChartManifold< dim2, spacedim, intermediate_dim >, CompositionManifold< dim, spacedim, chartdim, dim1, dim2, intermediate_dim > > G
virtual Point< chartdim > pull_back(const Point< spacedim > &space_point) const
CompositionManifold(const ChartManifold< dim1, intermediate_dim, chartdim > &F, const ChartManifold< dim2, spacedim, intermediate_dim > &G)
Definition: point.h:89
virtual DerivativeForm< 1, chartdim, spacedim > push_forward_gradient(const Point< chartdim > &chart_point) const
static ::ExceptionBase & ExcMessage(std::string arg1)
virtual DerivativeForm< 1, chartdim, spacedim > push_forward_gradient(const Point< chartdim > &chart_point) const
Definition: manifold.cc:805
#define Assert(cond, exc)
Definition: exceptions.h:313
const Tensor< 1, chartdim > & get_periodicity() const
Definition: manifold.cc:846
virtual Point< spacedim > push_forward(const Point< chartdim > &chart_point) const
virtual Point< spacedim > push_forward(const Point< chartdim > &chart_point) const =0
virtual Point< chartdim > pull_back(const Point< spacedim > &space_point) const =0
SmartPointer< const ChartManifold< dim1, intermediate_dim, chartdim >, CompositionManifold< dim, spacedim, chartdim, dim1, dim2, intermediate_dim > > F