dirichlet_boundaries.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_DIRICHLET_BOUNDARIES_H
21 #define LIBMESH_DIRICHLET_BOUNDARIES_H
22 
23 #include "libmesh/libmesh_config.h"
24 
25 #ifdef LIBMESH_ENABLE_DIRICHLET
26 
27 // Local Includes -----------------------------------
28 #include "libmesh/function_base.h"
29 #include "libmesh/id_types.h"
30 #include "libmesh/vector_value.h"
31 
32 // C++ Includes -----------------------------------
33 #include <algorithm>
34 #include <cstddef>
35 #include <iterator>
36 #include <set>
37 #include <string>
38 #include <vector>
39 
40 namespace libMesh
41 {
42 
44 {
45 public:
46  DirichletBoundary(const std::set<boundary_id_type> &b_in,
47  const std::vector<unsigned int>& variables_in,
48  const FunctionBase<Number> *f_in,
49  const FunctionBase<Gradient> *g_in = NULL) :
50  b(b_in),
51  variables(variables_in),
52  f(f_in ? f_in->clone() : AutoPtr<FunctionBase<Number> >(NULL)),
53  g(g_in ? g_in->clone() : AutoPtr<FunctionBase<Gradient> >(NULL))
54  {
55  libmesh_assert(f.get());
56  f->init();
57  if (g.get())
58  g->init();
59  }
60 
61  DirichletBoundary(const std::set<boundary_id_type> &b_in,
62  const std::vector<unsigned int>& variables_in,
63  const FunctionBase<Number> &f_in) :
64  b(b_in),
65  variables(variables_in),
66  f(f_in.clone()),
67  g(AutoPtr<FunctionBase<Gradient> >(NULL))
68  {
69  f->init();
70  }
71 
72 
73  DirichletBoundary(const std::set<boundary_id_type> &b_in,
74  const std::vector<unsigned int>& variables_in,
75  const FunctionBase<Number> &f_in,
76  const FunctionBase<Gradient> &g_in) :
77  b(b_in),
78  variables(variables_in),
79  f(f_in.clone()),
80  g(g_in.clone())
81  {
82  f->init();
83  g->init();
84  }
85 
86 
87  DirichletBoundary (const DirichletBoundary &dirichlet_in) :
88  b(dirichlet_in.b),
89  variables(dirichlet_in.variables),
90  f(dirichlet_in.f.get() ? dirichlet_in.f->clone() : AutoPtr<FunctionBase<Number> >(NULL)),
91  g(dirichlet_in.g.get() ? dirichlet_in.g->clone() : AutoPtr<FunctionBase<Gradient> >(NULL))
92  {
93  libmesh_assert(f.get());
94  f->init();
95  if (g.get())
96  g->init();
97  }
98 
99  std::set<boundary_id_type> b;
100  std::vector<unsigned int> variables;
103 };
104 
105 
111 class DirichletBoundaries : public std::vector<DirichletBoundary *>
112 {
113 public:
115 
117 };
118 
119 } // namespace libMesh
120 
121 #endif // LIBMESH_ENABLE_DIRICHLET
122 
123 #endif // LIBMESH_DIRICHLET_BOUNDARIES_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo