MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
pyramid.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_PYRAMID
13 #define MFEM_PYRAMID
14 
15 #include "../config/config.hpp"
16 #include "element.hpp"
17 
18 namespace mfem
19 {
20 
21 /// Data type Pyramid element
22 class Pyramid : public Element
23 {
24 protected:
25  int indices[5];
26 
27 public:
29 
31 
32  /// Constructs pyramid by specifying the indices and the attribute.
33  Pyramid(const int *ind, int attr = 1);
34 
35  /// Constructs pyramid by specifying the indices and the attribute.
36  Pyramid(int ind1, int ind2, int ind3, int ind4, int ind5,
37  int attr = 1);
38 
39  /// Return element's type.
40  virtual Type GetType() const { return Element::PYRAMID; }
41 
42  /// Set the vertices according to the given input.
43  virtual void SetVertices(const int *ind);
44 
45  /// Returns the indices of the element's vertices.
46  virtual void GetVertices(Array<int> &v) const;
47 
48  virtual int *GetVertices() { return indices; }
49 
50  virtual int GetNVertices() const { return 5; }
51 
52  virtual int GetNEdges() const { return 8; }
53 
54  virtual const int *GetEdgeVertices(int ei) const
55  { return geom_t::Edges[ei]; }
56 
57  /// @deprecated Use GetNFaces(void) and GetNFaceVertices(int) instead.
58  MFEM_DEPRECATED virtual int GetNFaces(int &nFaceVertices) const;
59 
60  virtual int GetNFaces() const { return 5; }
61 
62  virtual int GetNFaceVertices(int fi) const
63  { return ( ( fi < 1 ) ? 4 : 3); }
64 
65  virtual const int *GetFaceVertices(int fi) const
66  { return geom_t::FaceVert[fi]; }
67 
68  virtual Element *Duplicate(Mesh *m) const
69  { return new Pyramid(indices, attribute); }
70 
71  virtual ~Pyramid() { }
72 };
73 
74 extern class LinearPyramidFiniteElement PyramidFE;
75 
76 }
77 
78 #endif
Geometry::Constants< Geometry::PYRAMID > geom_t
Definition: pyramid.hpp:28
class LinearPyramidFiniteElement PyramidFE
Definition: fe.cpp:44
virtual int GetNFaceVertices(int fi) const
Definition: pyramid.hpp:62
virtual Element * Duplicate(Mesh *m) const
Definition: pyramid.hpp:68
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
Definition: pyramid.cpp:40
virtual int * GetVertices()
Definition: pyramid.hpp:48
virtual const int * GetFaceVertices(int fi) const
Definition: pyramid.hpp:65
Data type Pyramid element.
Definition: pyramid.hpp:22
Type
Constants for the classes derived from Element.
Definition: element.hpp:41
virtual Type GetType() const
Return element&#39;s type.
Definition: pyramid.hpp:40
virtual int GetNVertices() const
Definition: pyramid.hpp:50
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:33
int indices[5]
Definition: pyramid.hpp:25
virtual int GetNEdges() const
Definition: pyramid.hpp:52
static const int Edges[NumEdges][2]
Definition: geom.hpp:260
virtual int GetNFaces() const
Definition: pyramid.hpp:60
Abstract data type element.
Definition: element.hpp:28
virtual ~Pyramid()
Definition: pyramid.hpp:71
static const int FaceVert[NumFaces][MaxFaceVert]
Definition: geom.hpp:264
virtual const int * GetEdgeVertices(int ei) const
Definition: pyramid.hpp:54