DOLFIN
DOLFIN C++ interface
MeshDisplacement.h
1 // Copyright (C) 2013 Jan Blechta
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2013-03-05
19 // Last changed: 2013-03-05
20 
21 #ifndef __MESH_DISPLACEMENT_H
22 #define __MESH_DISPLACEMENT_H
23 
24 #include <memory>
25 #include <vector>
26 #include <ufc.h>
27 #include <dolfin/common/Array.h>
28 #include <dolfin/function/Expression.h>
29 #include <dolfin/function/Function.h>
30 
31 namespace dolfin
32 {
33  class Mesh;
34 
41 
43  {
44  public:
45 
50  explicit MeshDisplacement(std::shared_ptr<const Mesh> mesh);
51 
56  MeshDisplacement(const MeshDisplacement& mesh_displacement);
57 
59  virtual ~MeshDisplacement();
60 
66  Function& operator[] (const std::size_t i);
67 
72  const Function& operator[] (const std::size_t i) const;
73 
82  virtual void eval(Array<double>& values,
83  const Array<double>& x,
84  const ufc::cell& cell) const;
85 
92  virtual void compute_vertex_values(std::vector<double>& vertex_values,
93  const Mesh& mesh) const;
94 
95  protected:
96 
97  const std::size_t _dim;
98 
99  std::vector<Function> _displacements;
100 
101  };
102 
103 }
104 #endif
virtual ~MeshDisplacement()
Destructor.
Definition: MeshDisplacement.cpp:67
MeshDisplacement(std::shared_ptr< const Mesh > mesh)
Definition: MeshDisplacement.cpp:31
Definition: adapt.h:29
Definition: Array.h:41
virtual void eval(Array< double > &values, const Array< double > &x, const ufc::cell &cell) const
Definition: MeshDisplacement.cpp:84
Definition: Expression.h:49
virtual void compute_vertex_values(std::vector< double > &vertex_values, const Mesh &mesh) const
Definition: MeshDisplacement.cpp:94
Definition: Function.h:65
Definition: MeshDisplacement.h:42
Function & operator[](const std::size_t i)
Definition: MeshDisplacement.cpp:72
Definition: Mesh.h:82