Loading...
Searching...
No Matches
MeshDisplacement.h
// Copyright (C) 2013 Jan Blechta
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// First added: 2013-03-05
// Last changed: 2013-03-05
#ifndef __MESH_DISPLACEMENT_H
#define __MESH_DISPLACEMENT_H
#include <memory>
#include <vector>
#include <ufc.h>
#include <dolfin/common/Array.h>
#include <dolfin/function/Expression.h>
#include <dolfin/function/Function.h>
namespace dolfin
{
class Mesh;
class MeshDisplacement : public Expression
{
public:
explicit MeshDisplacement(std::shared_ptr<const Mesh> mesh);
MeshDisplacement(const MeshDisplacement& mesh_displacement);
virtual ~MeshDisplacement();
Function& operator[] (const std::size_t i);
const Function& operator[] (const std::size_t i) const;
virtual void eval(Array<double>& values,
const Array<double>& x,
const ufc::cell& cell) const;
virtual void compute_vertex_values(std::vector<double>& vertex_values,
const Mesh& mesh) const;
protected:
const std::size_t _dim;
std::vector<Function> _displacements;
};
}
#endif
dolfin::Array
Definition Array.h:42
dolfin::Expression::Expression
Expression()
Create scalar expression.
Definition Expression.cpp:32
dolfin::Function
Definition Function.h:66
dolfin::MeshDisplacement::eval
virtual void eval(Array< double > &values, const Array< double > &x, const ufc::cell &cell) const
Definition MeshDisplacement.cpp:84
dolfin::MeshDisplacement::operator[]
Function & operator[](const std::size_t i)
Definition MeshDisplacement.cpp:72
dolfin::MeshDisplacement::compute_vertex_values
virtual void compute_vertex_values(std::vector< double > &vertex_values, const Mesh &mesh) const
Definition MeshDisplacement.cpp:94
dolfin::MeshDisplacement::MeshDisplacement
MeshDisplacement(std::shared_ptr< const Mesh > mesh)
Definition MeshDisplacement.cpp:31
dolfin::MeshDisplacement::~MeshDisplacement
virtual ~MeshDisplacement()
Destructor.
Definition MeshDisplacement.cpp:67
dolfin::Mesh
Definition Mesh.h:84
dolfin
Definition adapt.h:30