mesh_function.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_MESH_FUNCTION_H
21 #define LIBMESH_MESH_FUNCTION_H
22 
23 // Local Includes
24 #include "libmesh/function_base.h"
25 #include "libmesh/dense_vector.h"
26 #include "libmesh/vector_value.h"
27 #include "libmesh/tensor_value.h"
28 #include "libmesh/tree_base.h"
30 
31 // C++ includes
32 #include <cstddef>
33 #include <vector>
34 
35 namespace libMesh
36 {
37 
38 
39 // Forward Declarations
40 template <typename T> class DenseVector;
41 class EquationSystems;
42 template <typename T> class NumericVector;
43 class DofMap;
44 class PointLocatorBase;
45 
46 
47 
55 // ------------------------------------------------------------
56 // MeshFunction class definition
57 class MeshFunction : public FunctionBase<Number>,
58  public ParallelObject
59 {
60 public:
61 
70  MeshFunction (const EquationSystems& eqn_systems,
71  const NumericVector<Number>& vec,
72  const DofMap& dof_map,
73  const std::vector<unsigned int>& vars,
74  const FunctionBase<Number>* master=NULL);
75 
84  MeshFunction (const EquationSystems& eqn_systems,
85  const NumericVector<Number>& vec,
86  const DofMap& dof_map,
87  const unsigned int var,
88  const FunctionBase<Number>* master=NULL);
89 
93  ~MeshFunction ();
94 
95 
96 
101  void init () { this->init(Trees::NODES); }
102 
103 
108  virtual void init (const Trees::BuildType point_locator_build_type);
109 
113  virtual void clear ();
114 
122  virtual AutoPtr<FunctionBase<Number> > clone () const;
123 
128  Number operator() (const Point& p,
129  const Real time=0.);
130 
135  Gradient gradient (const Point& p,
136  const Real time=0.);
137 
138 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
139 
143  Tensor hessian (const Point& p,
144  const Real time=0.);
145 #endif
146 
151  void operator() (const Point& p,
152  const Real time,
153  DenseVector<Number>& output);
154 
159  void gradient (const Point& p,
160  const Real time,
161  std::vector<Gradient>& output);
162 
167  void hessian (const Point& p,
168  const Real time,
169  std::vector<Tensor>& output);
170 
176  const PointLocatorBase& get_point_locator (void) const;
177 
188  void enable_out_of_mesh_mode(const DenseVector<Number>& value);
189 
200  void enable_out_of_mesh_mode(const Number& value);
201 
205  void disable_out_of_mesh_mode(void);
206 
207 protected:
208 
209 
215 
221 
225  const DofMap& _dof_map;
226 
231  const std::vector<unsigned int> _system_vars;
232 
238 
244 
250 };
251 
252 
253 
254 
255 // ------------------------------------------------------------
256 // MeshFunction inline methods
257 
258 
259 } // namespace libMesh
260 
261 
262 #endif // LIBMESH_MESH_FUNCTION_H

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

Hosted By:
SourceForge.net Logo