MFEM  v3.4
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
quadrilateral.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_QUADRILATERAL
13 #define MFEM_QUADRILATERAL
14 
15 #include "../config/config.hpp"
16 #include "element.hpp"
17 
18 namespace mfem
19 {
20 
21 /// Data type quadrilateral element
22 class Quadrilateral : public Element
23 {
24 protected:
25  int indices[4];
26 
27 public:
29 
30  Quadrilateral() : Element(Geometry::SQUARE) {}
31 
32  /// Constructs quadrilateral by specifying the indices and the attribute.
33  Quadrilateral(const int *ind, int attr = 1);
34 
35  /// Constructs quadrilateral by specifying the indices and the attribute.
36  Quadrilateral(int ind1, int ind2, int ind3, int ind4, int attr = 1);
37 
38  /// Return element's type
39  int GetType() const { return Element::QUADRILATERAL; }
40 
41  /// Set the vertices according to the given input.
42  virtual void SetVertices(const int *ind);
43 
44  /// Returns the indices of the element's vertices.
45  virtual void GetVertices(Array<int> &v) const;
46 
47  virtual int *GetVertices() { return indices; }
48 
49  virtual int GetNVertices() const { return 4; }
50 
51  virtual int GetNEdges() const { return (4); }
52 
53  virtual const int *GetEdgeVertices(int ei) const
54  { return geom_t::Edges[ei]; }
55 
56  virtual int GetNFaces(int &nFaceVertices) const
57  { nFaceVertices = 0; return 0; }
58 
59  virtual const int *GetFaceVertices(int fi) const { return NULL; }
60 
61  virtual Element *Duplicate(Mesh *m) const
62  { return new Quadrilateral(indices, attribute); }
63 
64  virtual ~Quadrilateral() { }
65 };
66 
67 extern BiLinear2DFiniteElement QuadrilateralFE;
68 
69 }
70 
71 #endif
virtual const int * GetFaceVertices(int fi) const
virtual Element * Duplicate(Mesh *m) const
Data type quadrilateral element.
virtual int GetNVertices() const
Geometry::Constants< Geometry::SQUARE > geom_t
static const int Edges[NumEdges][2]
Definition: geom.hpp:154
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
int GetType() const
Return element&#39;s type.
virtual int * GetVertices()
BiLinear2DFiniteElement QuadrilateralFE
virtual const int * GetEdgeVertices(int ei) const
Abstract data type element.
Definition: element.hpp:27
virtual int GetNEdges() const
virtual int GetNFaces(int &nFaceVertices) const