Loading...
Searching...
No Matches
Facet.h
// Copyright (C) 2006-2015 Anders Logg
//
// 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/>.
//
// Modified by Garth N. Wells, 2009-2011.
// Modified by Martin Alnaes, 2015
#ifndef __FACET_H
#define __FACET_H
#include <memory>
#include <utility>
#include <vector>
#include "Cell.h"
#include "Mesh.h"
#include "MeshEntity.h"
#include "MeshEntityIteratorBase.h"
#include "MeshFunction.h"
namespace dolfin
{
class Facet : public MeshEntity
{
public:
Facet(const Mesh& mesh, std::size_t index)
: MeshEntity(mesh, mesh.topology().dim() - 1, index) {}
~Facet() {}
double normal(std::size_t i) const;
Point normal() const;
double squared_distance(const Point& point) const;
double distance(const Point& point) const
{
return sqrt(squared_distance(point));
}
bool exterior() const;
};
typedef MeshEntityIteratorBase<Facet> FacetIterator;
}
#endif
dolfin::Facet::~Facet
~Facet()
Destructor.
Definition Facet.h:48
dolfin::Facet::squared_distance
double squared_distance(const Point &point) const
Definition Facet.cpp:63
dolfin::Facet::normal
Point normal() const
Compute normal to the facet.
Definition Facet.cpp:47
dolfin::Facet::Facet
Facet(const Mesh &mesh, std::size_t index)
Constructor.
Definition Facet.h:44
dolfin::Facet::exterior
bool exterior() const
Definition Facet.cpp:96
dolfin::Facet::distance
double distance(const Point &point) const
Definition Facet.h:70
dolfin::MeshEntityIteratorBase
Base class for MeshEntityIterators.
Definition MeshEntityIteratorBase.h:37
dolfin::MeshEntity::mesh
const Mesh & mesh() const
Definition MeshEntity.h:99
dolfin::MeshEntity::dim
std::size_t dim() const
Definition MeshEntity.h:106
dolfin::MeshEntity::MeshEntity
MeshEntity()
Default Constructor.
Definition MeshEntity.h:47
dolfin::MeshEntity::index
std::size_t index() const
Definition MeshEntity.h:113
dolfin::Mesh
Definition Mesh.h:84
dolfin::Point
Definition Point.h:41
dolfin
Definition adapt.h:30
dolfin::FacetIterator
MeshEntityIteratorBase< Facet > FacetIterator
Definition Facet.h:85