libMesh
Loading...
Searching...
No Matches
dirichlet_boundaries.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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
37namespace libMesh
38{
39
40// Forward declarations
41class System;
42
43template <typename Output> class FEMFunctionBase;
44template <typename Output> class FunctionBase;
45
63
89{
90public:
91
96 DirichletBoundary(std::set<boundary_id_type> b_in,
97 std::vector<unsigned int> variables_in,
98 const FunctionBase<Number> * f_in,
99 const FunctionBase<Gradient> * g_in = nullptr);
100
107 DirichletBoundary(std::set<boundary_id_type> b_in,
108 std::vector<unsigned int> variables_in,
109 const FunctionBase<Number> & f_in,
111
119 DirichletBoundary(std::set<boundary_id_type> b_in,
120 std::vector<unsigned int> variables_in,
121 const FunctionBase<Number> & f_in,
122 const FunctionBase<Gradient> & g_in,
124
129 DirichletBoundary(std::set<boundary_id_type> b_in,
130 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(std::set<boundary_id_type> b_in,
143 std::vector<unsigned int> variables_in,
144 const System & f_sys_in,
145 const FEMFunctionBase<Number> & f_in,
147
155 DirichletBoundary(std::set<boundary_id_type> b_in,
156 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);
168
174
179
180 std::set<boundary_id_type> b;
181 std::vector<unsigned int> variables;
182
183 std::unique_ptr<FunctionBase<Number>> f;
184 std::unique_ptr<FunctionBase<Gradient>> g;
185
186 std::unique_ptr<FEMFunctionBase<Number>> f_fem;
187 std::unique_ptr<FEMFunctionBase<Gradient>> g_fem;
188
190
204};
205
206
214class DirichletBoundaries : public std::vector<std::unique_ptr<DirichletBoundary>>
215{
216public:
219};
220
221} // namespace libMesh
222
223#endif // LIBMESH_ENABLE_DIRICHLET
224
225#endif // LIBMESH_DIRICHLET_BOUNDARIES_H
We're using a class instead of a typedef to allow forward declarations and future flexibility.
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
DirichletBoundary(DirichletBoundary &&)=default
This class is default move-assignable and move-constructible.
std::vector< unsigned int > variables
~DirichletBoundary()
Standard destructor.
DirichletBoundary & operator=(const DirichletBoundary &)
std::set< boundary_id_type > b
std::unique_ptr< FunctionBase< Number > > f
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::unique_ptr< FunctionBase< Gradient > > g
std::unique_ptr< FEMFunctionBase< Number > > f_fem
std::unique_ptr< FEMFunctionBase< Gradient > > g_fem
FEMFunctionBase is a base class from which users can derive in order to define "function-like" object...
Base class for functors that can be evaluated at a point and (optionally) time.
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition system.h:100
The libMesh namespace provides an interface to certain functionality in the library.
VariableIndexing
Dirichlet functions may be indexed either by "system variable order" or "local variable order",...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real