MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
fe_h1.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_FE_H1
13#define MFEM_FE_H1
14
15#include "fe_base.hpp"
16
17namespace mfem
18{
19
20/// Arbitrary order H1 elements in 1D
22{
23private:
24#ifndef MFEM_THREAD_SAFE
25 mutable Vector shape_x, dshape_x, d2shape_x;
26#endif
27
28public:
29 /// Construct the H1_SegmentElement of order @a p and BasisType @a btype
30 H1_SegmentElement(const int p, const int btype = BasisType::GaussLobatto);
31 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
32 virtual void CalcDShape(const IntegrationPoint &ip,
33 DenseMatrix &dshape) const;
34 virtual void CalcHessian(const IntegrationPoint &ip,
35 DenseMatrix &Hessian) const;
36 virtual void ProjectDelta(int vertex, Vector &dofs) const;
37};
38
39
40/// Arbitrary order H1 elements in 2D on a square
42{
43private:
44#ifndef MFEM_THREAD_SAFE
45 mutable Vector shape_x, shape_y, dshape_x, dshape_y, d2shape_x, d2shape_y;
46#endif
47
48public:
49 /// Construct the H1_QuadrilateralElement of order @a p and BasisType @a btype
50 H1_QuadrilateralElement(const int p,
51 const int btype = BasisType::GaussLobatto);
52 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
53 virtual void CalcDShape(const IntegrationPoint &ip,
54 DenseMatrix &dshape) const;
55 virtual void CalcHessian(const IntegrationPoint &ip,
56 DenseMatrix &Hessian) const;
57 virtual void ProjectDelta(int vertex, Vector &dofs) const;
58};
59
60
61/// Arbitrary order H1 elements in 3D on a cube
63{
64private:
65#ifndef MFEM_THREAD_SAFE
66 mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z,
67 d2shape_x, d2shape_y, d2shape_z;
68#endif
69
70public:
71 /// Construct the H1_HexahedronElement of order @a p and BasisType @a btype
72 H1_HexahedronElement(const int p, const int btype = BasisType::GaussLobatto);
73 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
74 virtual void CalcDShape(const IntegrationPoint &ip,
75 DenseMatrix &dshape) const;
76 virtual void CalcHessian(const IntegrationPoint &ip,
77 DenseMatrix &Hessian) const;
78 virtual void ProjectDelta(int vertex, Vector &dofs) const;
79};
80
81
82/// Arbitrary order H1 elements in 2D on a triangle
84{
85private:
86#ifndef MFEM_THREAD_SAFE
87 mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
88 mutable Vector ddshape_x, ddshape_y, ddshape_l;
89 mutable DenseMatrix du, ddu;
90#endif
92
93public:
94 /// Construct the H1_TriangleElement of order @a p and BasisType @a btype
95 H1_TriangleElement(const int p, const int btype = BasisType::GaussLobatto);
96 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
97 virtual void CalcDShape(const IntegrationPoint &ip,
98 DenseMatrix &dshape) const;
99 virtual void CalcHessian(const IntegrationPoint &ip,
100 DenseMatrix &ddshape) const;
101};
102
103
104/// Arbitrary order H1 elements in 3D on a tetrahedron
106{
107private:
108#ifndef MFEM_THREAD_SAFE
109 mutable Vector shape_x, shape_y, shape_z, shape_l;
110 mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
111 mutable Vector ddshape_x, ddshape_y, ddshape_z, ddshape_l;
112 mutable DenseMatrix du, ddu;
113#endif
115
116public:
117 /// Construct the H1_TetrahedronElement of order @a p and BasisType @a btype
118 H1_TetrahedronElement(const int p,
119 const int btype = BasisType::GaussLobatto);
120 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
121 virtual void CalcDShape(const IntegrationPoint &ip,
122 DenseMatrix &dshape) const;
123 virtual void CalcHessian(const IntegrationPoint &ip,
124 DenseMatrix &ddshape) const;
125};
126
127
128
129/// Arbitrary order H1 elements in 3D on a wedge
131{
132private:
133#ifndef MFEM_THREAD_SAFE
134 mutable Vector t_shape, s_shape;
135 mutable DenseMatrix t_dshape, s_dshape;
136#endif
137 Array<int> t_dof, s_dof;
138
139 H1_TriangleElement TriangleFE;
140 H1_SegmentElement SegmentFE;
141
142public:
143 /// Construct the H1_WedgeElement of order @a p and BasisType @a btype
144 H1_WedgeElement(const int p,
145 const int btype = BasisType::GaussLobatto);
146 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
147 virtual void CalcDShape(const IntegrationPoint &ip,
148 DenseMatrix &dshape) const;
149};
150
151} // namespace mfem
152
153#endif
@ GaussLobatto
Closed type.
Definition fe_base.hpp:32
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
Arbitrary order H1 elements in 3D on a cube.
Definition fe_h1.hpp:63
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_HexahedronElement of order p and BasisType btype.
Definition fe_h1.cpp:265
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition fe_h1.cpp:338
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_h1.cpp:293
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_h1.cpp:367
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_h1.cpp:314
Arbitrary order H1 elements in 2D on a square.
Definition fe_h1.hpp:42
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition fe_h1.cpp:192
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_h1.cpp:151
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_h1.cpp:216
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_h1.cpp:170
H1_QuadrilateralElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_QuadrilateralElement of order p and BasisType btype.
Definition fe_h1.cpp:125
Arbitrary order H1 elements in 1D.
Definition fe_h1.hpp:22
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_h1.cpp:59
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_SegmentElement of order p and BasisType btype.
Definition fe_h1.cpp:21
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition fe_h1.cpp:78
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_h1.cpp:40
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_h1.cpp:97
Arbitrary order H1 elements in 3D on a tetrahedron.
Definition fe_h1.hpp:106
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_h1.cpp:758
H1_TetrahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_TetrahedronElement of order p and BasisType btype.
Definition fe_h1.cpp:617
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition fe_h1.cpp:816
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_h1.cpp:783
Arbitrary order H1 elements in 2D on a triangle.
Definition fe_h1.hpp:84
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_h1.cpp:533
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition fe_h1.cpp:584
H1_TriangleElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_TriangleElement of order p and BasisType btype.
Definition fe_h1.cpp:451
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_h1.cpp:555
Arbitrary order H1 elements in 3D on a wedge.
Definition fe_h1.hpp:131
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_h1.cpp:999
H1_WedgeElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_WedgeElement of order p and BasisType btype.
Definition fe_h1.cpp:863
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_h1.cpp:1018
Class for integration point with weight.
Definition intrules.hpp:35
Class for standard nodal finite elements.
Definition fe_base.hpp:715
Vector data type.
Definition vector.hpp:80
real_t p(const Vector &x, real_t t)