MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
quadrilateral.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_QUADRILATERAL
13#define MFEM_QUADRILATERAL
14
15#include "../config/config.hpp"
16#include "element.hpp"
17
18namespace mfem
19{
20
21/// Data type quadrilateral element
22class Quadrilateral : public Element
23{
24protected:
25 int indices[4];
26
27public:
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 override { return Element::QUADRILATERAL; }
40
41 /// Get the indices defining the vertices.
42 void GetVertices(Array<int> &v) const override;
43
44 /// Set the indices defining the vertices.
45 void SetVertices(const Array<int> &v) override;
46
47 /// @note The returned array should NOT be deleted by the caller.
48 int * GetVertices () override { return indices; }
49
50 /// Set the vertices according to the given input.
51 void SetVertices(const int *ind) override;
52
53 int GetNVertices() const override { return 4; }
54
55 int GetNEdges() const override { return (4); }
56
57 const int *GetEdgeVertices(int ei) const override
58 { return geom_t::Edges[ei]; }
59
60 /// @deprecated Use GetNFaces(void) and GetNFaceVertices(int) instead.
61 MFEM_DEPRECATED int GetNFaces(int &nFaceVertices) const override
62 { nFaceVertices = 0; return 0; }
63
64 int GetNFaces() const override { return 0; }
65
66 int GetNFaceVertices(int) const override { return 0; }
67
68 const int *GetFaceVertices(int fi) const override { return NULL; }
69
70 Element *Duplicate(Mesh *m) const override
71 { return new Quadrilateral(indices, attribute); }
72
73 virtual ~Quadrilateral() = default;
74};
75
76extern MFEM_EXPORT class BiLinear2DFiniteElement QuadrilateralFE;
77
78}
79
80#endif
A 2D bi-linear element on a square with nodes at the vertices of the square.
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
Mesh data type.
Definition mesh.hpp:56
Data type quadrilateral element.
virtual ~Quadrilateral()=default
void SetVertices(const Array< int > &v) override
Set the indices defining the vertices.
int GetNFaceVertices(int) const override
int GetNVertices() const override
int GetNFaces() const override
Element * Duplicate(Mesh *m) const override
Type GetType() const override
Return element's type.
const int * GetEdgeVertices(int ei) const override
MFEM_DEPRECATED int GetNFaces(int &nFaceVertices) const override
int * GetVertices() override
const int * GetFaceVertices(int fi) const override
int GetNEdges() const override
Geometry::Constants< Geometry::SQUARE > geom_t
BiLinear2DFiniteElement QuadrilateralFE
static const int Edges[NumEdges][2]
Definition geom.hpp:201