MFEM  v4.6.0
Finite element discretization library
wedge.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2023, 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_WEDGE
13 #define MFEM_WEDGE
14 
15 #include "../config/config.hpp"
16 #include "element.hpp"
17 
18 namespace mfem
19 {
20 
21 /// Data type Wedge element
22 class Wedge : public Element
23 {
24 protected:
25  int indices[6];
26 
27 public:
29 
30  Wedge() : Element(Geometry::PRISM) { }
31 
32  /// Constructs wedge by specifying the indices and the attribute.
33  Wedge(const int *ind, int attr = 1);
34 
35  /// Constructs wedge by specifying the indices and the attribute.
36  Wedge(int ind1, int ind2, int ind3, int ind4, int ind5, int ind6,
37  int attr = 1);
38 
39  /// Return element's type.
40  virtual Type GetType() const { return Element::WEDGE; }
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 6; }
51 
52  virtual int GetNEdges() const { return 9; }
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 < 2) ? 3 : 4; }
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 Wedge(indices, attribute); }
70 
71  virtual ~Wedge() { }
72 };
73 
74 extern MFEM_EXPORT class LinearWedgeFiniteElement WedgeFE;
75 
76 }
77 
78 #endif
virtual Type GetType() const
Return element&#39;s type.
Definition: wedge.hpp:40
virtual ~Wedge()
Definition: wedge.hpp:71
static const int FaceVert[NumFaces][MaxFaceVert]
Definition: geom.hpp:274
static const int Edges[NumEdges][2]
Definition: geom.hpp:270
virtual int GetNEdges() const
Definition: wedge.hpp:52
Data type Wedge element.
Definition: wedge.hpp:22
virtual const int * GetEdgeVertices(int ei) const
Definition: wedge.hpp:54
virtual int GetNFaceVertices(int fi) const
Definition: wedge.hpp:62
Type
Constants for the classes derived from Element.
Definition: element.hpp:41
virtual Element * Duplicate(Mesh *m) const
Definition: wedge.hpp:68
Geometry::Constants< Geometry::PRISM > geom_t
Definition: wedge.hpp:28
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
Definition: wedge.cpp:42
virtual const int * GetFaceVertices(int fi) const
Definition: wedge.hpp:65
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:33
MFEM_EXPORT class LinearWedgeFiniteElement WedgeFE
Definition: fe.cpp:40
virtual int GetNFaces() const
Definition: wedge.hpp:60
virtual int GetNVertices() const
Definition: wedge.hpp:50
int indices[6]
Definition: wedge.hpp:25
virtual int * GetVertices()
Definition: wedge.hpp:48
Abstract data type element.
Definition: element.hpp:28