MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
pyramid.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2024, 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
18namespace mfem
19{
20
21/// Data type Pyramid element
22class Pyramid : public Element
23{
24protected:
25 int indices[5];
26
27public:
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 Type GetType() const override { return Element::PYRAMID; }
41
42 /// Get the indices defining the vertices.
43 void GetVertices(Array<int> &v) const override;
44
45 /// Set the indices defining the vertices.
46 void SetVertices(const Array<int> &v) override;
47
48 /// @note The returned array should NOT be deleted by the caller.
49 int * GetVertices () override { return indices; }
50
51 /// Set the indices defining the vertices.
52 void SetVertices(const int *ind) override;
53
54 int GetNVertices() const override { return 5; }
55
56 int GetNEdges() const override { return 8; }
57
58 const int *GetEdgeVertices(int ei) const override
59 { return geom_t::Edges[ei]; }
60
61 /// @deprecated Use GetNFaces(void) and GetNFaceVertices(int) instead.
62 MFEM_DEPRECATED int GetNFaces(int &nFaceVertices) const override;
63
64 int GetNFaces() const override { return 5; }
65
66 int GetNFaceVertices(int fi) const override
67 { return ( ( fi < 1 ) ? 4 : 3); }
68
69 const int *GetFaceVertices(int fi) const override
70 { return geom_t::FaceVert[fi]; }
71
72 Element *Duplicate(Mesh *m) const override
73 { return new Pyramid(indices, attribute); }
74
75 virtual ~Pyramid() = default;
76};
77
79
80}
81
82#endif
Abstract data type element.
Definition element.hpp:29
int attribute
Element's attribute (specifying material property, etc).
Definition element.hpp:33
Type
Constants for the classes derived from Element.
Definition element.hpp:41
A linear element defined on a square pyramid.
Mesh data type.
Definition mesh.hpp:56
Data type Pyramid element.
Definition pyramid.hpp:23
const int * GetEdgeVertices(int ei) const override
Definition pyramid.hpp:58
Geometry::Constants< Geometry::PYRAMID > geom_t
Definition pyramid.hpp:28
int GetNEdges() const override
Definition pyramid.hpp:56
void SetVertices(const Array< int > &v) override
Set the indices defining the vertices.
Definition pyramid.cpp:54
virtual ~Pyramid()=default
int indices[5]
Definition pyramid.hpp:25
int GetNFaces() const override
Definition pyramid.hpp:64
int GetNVertices() const override
Definition pyramid.hpp:54
Type GetType() const override
Return element's type.
Definition pyramid.hpp:40
Element * Duplicate(Mesh *m) const override
Definition pyramid.hpp:72
int GetNFaceVertices(int fi) const override
Definition pyramid.hpp:66
int * GetVertices() override
Definition pyramid.hpp:49
const int * GetFaceVertices(int fi) const override
Definition pyramid.hpp:69
class LinearPyramidFiniteElement PyramidFE
Definition fe.cpp:44
static const int Edges[NumEdges][2]
Definition geom.hpp:295
static const int FaceVert[NumFaces][MaxFaceVert]
Definition geom.hpp:299