Newer
Older
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.com/LICENSE.txt
*/
#ifndef FACE_H_
#define FACE_H_
#include "Element.h"
Karsten Rink
committed
namespace MeshLib {
/**
* Virtual base class for 2d mesh elements.
*/
class Face : public Element
{
public:
virtual double getArea() const { return _area; };
/// Returns the length, area or volume of a 1D, 2D or 3D element
double getContent() const { return _area; };
Karsten Rink
committed
unsigned getDimension() const { return 2; };
Karsten Rink
committed
/// Returns the face i of the element.
const Element* getFace(unsigned i) const { return this->getEdge(i); };
/// Get the number of nodes for face i.
unsigned getNFaceNodes(unsigned i) const { (void)i; return 2; };
Karsten Rink
committed
Karsten Rink
committed
unsigned getNFaces() const { return 0; };
Karsten Rink
committed
/// Returns the surface normal of a 2D element.
Karsten Rink
committed
void getSurfaceNormal(double normal[3]) const;
Karsten Rink
committed
virtual ~Face();
protected:
/// Constructor for a generic mesh element containing an array of mesh nodes.
Karsten Rink
committed
Face(Node** nodes, MshElemType::type type, unsigned value = 0);
/// Constructor for a generic mesh element without an array of mesh nodes.
Karsten Rink
committed
Face(MshElemType::type type, unsigned value = 0);
Karsten Rink
committed
virtual double computeArea() = 0;
double _area;
private:
}; /* class */
} /* namespace */
#endif /* FACE_H_ */