MFEM  v4.5.1
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-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
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  Type 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  /// @deprecated Use GetNFaces(void) and GetNFaceVertices(int) instead.
57  MFEM_DEPRECATED virtual int GetNFaces(int &nFaceVertices) const
58  { nFaceVertices = 0; return 0; }
59 
60  virtual int GetNFaces() const { return 0; }
61 
62  virtual int GetNFaceVertices(int) const { return 0; }
63 
64  virtual const int *GetFaceVertices(int fi) const { return NULL; }
65 
66  virtual Element *Duplicate(Mesh *m) const
67  { return new Quadrilateral(indices, attribute); }
68 
69  virtual ~Quadrilateral() { }
70 };
71 
72 extern class BiLinear2DFiniteElement QuadrilateralFE;
73 
74 }
75 
76 #endif
virtual const int * GetFaceVertices(int fi) const
virtual Element * Duplicate(Mesh *m) const
Data type quadrilateral element.
virtual int GetNFaces() const
Type GetType() const
Return element&#39;s type.
virtual int GetNVertices() const
Geometry::Constants< Geometry::SQUARE > geom_t
virtual int GetNFaceVertices(int) const
Type
Constants for the classes derived from Element.
Definition: element.hpp:41
virtual MFEM_DEPRECATED int GetNFaces(int &nFaceVertices) const
static const int Edges[NumEdges][2]
Definition: geom.hpp:182
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:33
virtual int * GetVertices()
BiLinear2DFiniteElement QuadrilateralFE
virtual const int * GetEdgeVertices(int ei) const
Abstract data type element.
Definition: element.hpp:28
virtual int GetNEdges() const