libMesh
dirichlet_boundaries.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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/id_types.h"
29 #include "libmesh/vector_value.h"
30 
31 // C++ Includes
32 #include <cstddef>
33 #include <set>
34 #include <vector>
35 #include <memory>
36 
37 namespace libMesh
38 {
39 
40 // Forward declarations
41 class System;
42 
43 template <typename Output> class FEMFunctionBase;
44 template <typename Output> class FunctionBase;
45 
63 
89 {
90 public:
91 
96  DirichletBoundary(const std::set<boundary_id_type> & b_in,
97  const std::vector<unsigned int> & variables_in,
98  const FunctionBase<Number> * f_in,
99  const FunctionBase<Gradient> * g_in = nullptr);
100 
107  DirichletBoundary(const std::set<boundary_id_type> & b_in,
108  const std::vector<unsigned int> & variables_in,
109  const FunctionBase<Number> & f_in,
111 
119  DirichletBoundary(const std::set<boundary_id_type> & b_in,
120  const std::vector<unsigned int> & variables_in,
121  const FunctionBase<Number> & f_in,
122  const FunctionBase<Gradient> & g_in,
124 
129  DirichletBoundary(const std::set<boundary_id_type> & b_in,
130  const std::vector<unsigned int> & variables_in,
131  const System & f_sys_in,
132  const FEMFunctionBase<Number> * f_in,
133  const FEMFunctionBase<Gradient> * g_in = nullptr);
134 
142  DirichletBoundary(const std::set<boundary_id_type> & b_in,
143  const std::vector<unsigned int> & variables_in,
144  const System & f_sys_in,
145  const FEMFunctionBase<Number> & f_in,
147 
155  DirichletBoundary(const std::set<boundary_id_type> & b_in,
156  const std::vector<unsigned int> & variables_in,
157  const System & f_sys_in,
158  const FEMFunctionBase<Number> & f_in,
159  const FEMFunctionBase<Gradient> & g_in,
161 
166  DirichletBoundary (const DirichletBoundary & dirichlet_in);
167 
172 
173  std::set<boundary_id_type> b;
174  std::vector<unsigned int> variables;
175 
176  std::unique_ptr<FunctionBase<Number>> f;
177  std::unique_ptr<FunctionBase<Gradient>> g;
178 
179  std::unique_ptr<FEMFunctionBase<Number>> f_fem;
180  std::unique_ptr<FEMFunctionBase<Gradient>> g_fem;
181 
182  const System * f_system;
183 
197 };
198 
199 
207 class DirichletBoundaries : public std::vector<DirichletBoundary *>
208 {
209 public:
211 
213 };
214 
215 } // namespace libMesh
216 
217 #endif // LIBMESH_ENABLE_DIRICHLET
218 
219 #endif // LIBMESH_DIRICHLET_BOUNDARIES_H
libMesh::System
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition: system.h:100
libMesh::FunctionBase
Base class for functors that can be evaluated at a point and (optionally) time.
Definition: dirichlet_boundaries.h:44
libMesh::FEMFunctionBase
FEMFunctionBase is a base class from which users can derive in order to define "function-like" object...
Definition: dirichlet_boundaries.h:43
libMesh::DirichletBoundary::g
std::unique_ptr< FunctionBase< Gradient > > g
Definition: dirichlet_boundaries.h:177
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::DirichletBoundary::f_system
const System * f_system
Definition: dirichlet_boundaries.h:182
libMesh::SYSTEM_VARIABLE_ORDER
Definition: dirichlet_boundaries.h:61
libMesh::DirichletBoundary::DirichletBoundary
DirichletBoundary(const std::set< boundary_id_type > &b_in, const std::vector< unsigned int > &variables_in, const FunctionBase< Number > *f_in, const FunctionBase< Gradient > *g_in=nullptr)
Constructor for a system-variable-order boundary using pointers-to-functors.
Definition: dirichlet_boundary.C:34
libMesh::DirichletBoundaries::DirichletBoundaries
DirichletBoundaries()
Definition: dirichlet_boundaries.h:210
libMesh::DirichletBoundaries
We're using a class instead of a typedef to allow forward declarations and future flexibility.
Definition: dirichlet_boundaries.h:207
libMesh::DirichletBoundary::b
std::set< boundary_id_type > b
Definition: dirichlet_boundaries.h:173
libMesh::LOCAL_VARIABLE_ORDER
Definition: dirichlet_boundaries.h:62
libMesh::DirichletBoundaries::~DirichletBoundaries
~DirichletBoundaries()
Definition: dof_map_constraints.C:4473
libMesh::DirichletBoundary::g_fem
std::unique_ptr< FEMFunctionBase< Gradient > > g_fem
Definition: dirichlet_boundaries.h:180
libMesh::DirichletBoundary::jacobian_tolerance
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
Definition: dirichlet_boundaries.h:196
libMesh::VariableIndexing
VariableIndexing
Dirichlet functions may be indexed either by "system variable order" or "local variable order",...
Definition: dirichlet_boundaries.h:61
libMesh::DirichletBoundary::~DirichletBoundary
~DirichletBoundary()
Standard destructor.
Definition: dirichlet_boundary.C:199
libMesh::DirichletBoundary::f
std::unique_ptr< FunctionBase< Number > > f
Definition: dirichlet_boundaries.h:176
libMesh::DirichletBoundary::variables
std::vector< unsigned int > variables
Definition: dirichlet_boundaries.h:174
libMesh::DirichletBoundary
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
Definition: dirichlet_boundaries.h:88
libMesh::DirichletBoundary::f_fem
std::unique_ptr< FEMFunctionBase< Number > > f_fem
Definition: dirichlet_boundaries.h:179
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121