MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
wedge.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_WEDGE
13#define MFEM_WEDGE
14
15#include "../config/config.hpp"
16#include "element.hpp"
17
18namespace mfem
19{
20
21/// Data type Wedge element
22class Wedge : public Element
23{
24protected:
25 int indices[6];
26
27public:
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 Type GetType() const override { return Element::WEDGE; }
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 6; }
55
56 int GetNEdges() const override { return 9; }
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 < 2) ? 3 : 4; }
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 Wedge(indices, attribute); }
74
75 virtual ~Wedge() = default;
76};
77
78extern MFEM_EXPORT class LinearWedgeFiniteElement WedgeFE;
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 triangular prism.
Mesh data type.
Definition mesh.hpp:56
Data type Wedge element.
Definition wedge.hpp:23
Element * Duplicate(Mesh *m) const override
Definition wedge.hpp:72
Type GetType() const override
Return element's type.
Definition wedge.hpp:40
int indices[6]
Definition wedge.hpp:25
const int * GetFaceVertices(int fi) const override
Definition wedge.hpp:69
Geometry::Constants< Geometry::PRISM > geom_t
Definition wedge.hpp:28
int GetNFaces() const override
Definition wedge.hpp:64
int GetNVertices() const override
Definition wedge.hpp:54
int * GetVertices() override
Definition wedge.hpp:49
const int * GetEdgeVertices(int ei) const override
Definition wedge.hpp:58
void SetVertices(const Array< int > &v) override
Set the indices defining the vertices.
Definition wedge.cpp:56
virtual ~Wedge()=default
int GetNEdges() const override
Definition wedge.hpp:56
int GetNFaceVertices(int fi) const override
Definition wedge.hpp:66
MFEM_EXPORT class LinearWedgeFiniteElement WedgeFE
Definition fe.cpp:40
static const int FaceVert[NumFaces][MaxFaceVert]
Definition geom.hpp:277
static const int Edges[NumEdges][2]
Definition geom.hpp:273