11#ifndef PBAT_FEM_LINE_H
12#define PBAT_FEM_LINE_H
16#include "QuadratureRules.h"
38using Line =
typename detail::Line<Order>;
47 static int constexpr kOrder = 1;
48 static int constexpr kDims = 1;
49 static int constexpr kNodes = 2;
50 static std::array<int, kNodes * kDims>
constexpr Coordinates =
52 static std::array<int, AffineBaseType::kNodes>
constexpr Vertices = {0,1};
53 static bool constexpr bHasConstantJacobian =
true;
55 template <
int PolynomialOrder, common::CFloatingPo
int TScalar = Scalar>
58 template <
class TDerived,
class TScalar =
typename TDerived::Scalar>
59 [[maybe_unused]]
static Eigen::Vector<TScalar, kNodes> N([[maybe_unused]] Eigen::DenseBase<TDerived>
const& X_)
61#include "pbat/warning/Push.h"
62#include "pbat/warning/SignConversion.h"
64 Eigen::Vector<TScalar, kNodes> Nm;
65 auto const X = X_.reshaped();
69#include "pbat/warning/Pop.h"
72 template <
class TDerived,
class TScalar =
typename TDerived::Scalar>
73 [[maybe_unused]]
static Eigen::Matrix<TScalar, kNodes, kDims> GradN([[maybe_unused]] Eigen::DenseBase<TDerived>
const& X_)
75#include "pbat/warning/Push.h"
76#include "pbat/warning/SignConversion.h"
77 Eigen::Matrix<TScalar, kNodes, kDims> GNm;
78 TScalar* GNp = GNm.data();
79 [[maybe_unused]]
auto const X = X_.reshaped();
83#include "pbat/warning/Pop.h"
92 static int constexpr kOrder = 2;
93 static int constexpr kDims = 1;
94 static int constexpr kNodes = 3;
95 static std::array<int, kNodes * kDims>
constexpr Coordinates =
97 static std::array<int, AffineBaseType::kNodes>
constexpr Vertices = {0,2};
98 static bool constexpr bHasConstantJacobian =
false;
100 template <
int PolynomialOrder, common::CFloatingPo
int TScalar = Scalar>
103 template <
class TDerived,
class TScalar =
typename TDerived::Scalar>
104 [[maybe_unused]]
static Eigen::Vector<TScalar, kNodes> N([[maybe_unused]] Eigen::DenseBase<TDerived>
const& X_)
106#include "pbat/warning/Push.h"
107#include "pbat/warning/SignConversion.h"
109 Eigen::Vector<TScalar, kNodes> Nm;
110 auto const X = X_.reshaped();
111 auto const a0 = X[0] - 1;
112 auto const a1 = 2*X[0] - 1;
117#include "pbat/warning/Pop.h"
120 template <
class TDerived,
class TScalar =
typename TDerived::Scalar>
121 [[maybe_unused]]
static Eigen::Matrix<TScalar, kNodes, kDims> GradN([[maybe_unused]] Eigen::DenseBase<TDerived>
const& X_)
123#include "pbat/warning/Push.h"
124#include "pbat/warning/SignConversion.h"
125 Eigen::Matrix<TScalar, kNodes, kDims> GNm;
126 TScalar* GNp = GNm.data();
127 [[maybe_unused]]
auto const X = X_.reshaped();
128 auto const a0 = 4*X[0];
133#include "pbat/warning/Pop.h"
140 using AffineBaseType =
Line<1>;
142 static int constexpr kOrder = 3;
143 static int constexpr kDims = 1;
144 static int constexpr kNodes = 4;
145 static std::array<int, kNodes * kDims>
constexpr Coordinates =
147 static std::array<int, AffineBaseType::kNodes>
constexpr Vertices = {0,3};
148 static bool constexpr bHasConstantJacobian =
false;
150 template <
int PolynomialOrder, common::CFloatingPo
int TScalar = Scalar>
153 template <
class TDerived,
class TScalar =
typename TDerived::Scalar>
154 [[maybe_unused]]
static Eigen::Vector<TScalar, kNodes> N([[maybe_unused]] Eigen::DenseBase<TDerived>
const& X_)
156#include "pbat/warning/Push.h"
157#include "pbat/warning/SignConversion.h"
159 Eigen::Vector<TScalar, kNodes> Nm;
160 auto const X = X_.reshaped();
161 auto const a0 = X[0] - 1;
162 auto const a1 = 3*X[0];
163 auto const a2 = a1 - 2;
164 auto const a3 = a0*a2;
165 auto const a4 = a1 - 1;
166 auto const a5 = (1.0/2.0)*a4;
167 auto const a6 = (9.0/2.0)*X[0];
173#include "pbat/warning/Pop.h"
176 template <
class TDerived,
class TScalar =
typename TDerived::Scalar>
177 [[maybe_unused]]
static Eigen::Matrix<TScalar, kNodes, kDims> GradN([[maybe_unused]] Eigen::DenseBase<TDerived>
const& X_)
179#include "pbat/warning/Push.h"
180#include "pbat/warning/SignConversion.h"
181 Eigen::Matrix<TScalar, kNodes, kDims> GNm;
182 TScalar* GNp = GNm.data();
183 [[maybe_unused]]
auto const X = X_.reshaped();
184 auto const a0 = X[0] - 1;
185 auto const a1 = (3.0/2.0)*X[0];
186 auto const a2 = a1 - 1.0/2.0;
188 auto const a4 = 3*X[0] - 2;
189 auto const a5 = (27.0/2.0)*X[0];
190 auto const a6 = a5 - 27.0/2.0;
191 auto const a7 = (9.0/2.0)*X[0];
192 auto const a8 = 9.0/2.0 - a5;
193 GNp[0] = 3*a0*a3 + a3*a4 + a4*(3.0/2.0 - a1);
194 GNp[1] = a4*(a7 - 9.0/2.0) + a6*X[0] + (a5 - 9)*X[0];
195 GNp[2] = a0*a8 - a6*X[0] + a8*X[0];
196 GNp[3] = a2*a4 + (a7 - 3)*X[0] + (a7 - 3.0/2.0)*X[0];
198#include "pbat/warning/Pop.h"
Concepts for common types.
Finite Element Method (FEM)
Definition Concepts.h:19
typename detail::Line< Order > Line
Line finite element.
Definition Line.h:38
Math related functionality.
Definition Concepts.h:19
typename detail::GaussLegendreQuadrature< Dims, Order, TScalar > GaussLegendreQuadrature
Shifted Gauss-Legendre quadrature scheme over the unit box in dimensions .
Definition GaussQuadrature.h:66
The main namespace of the library.
Definition Aliases.h:15