MFEM  v4.1.0 Finite element discretization library
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
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
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
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  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
70 };
71
73
74 }
75
76 #endif
virtual const int * GetFaceVertices(int fi) const
virtual Element * Duplicate(Mesh *m) const
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
static const int Edges[NumEdges][2]
Definition: geom.hpp:162
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()