31 TensorBasisElement::DofMapType::Sr_DOF_MAP);
42 for (
int j = 0; j <=
p; j++)
44 for (
int i = 0; i <=
p; i++)
60 double x = ip.
x, y = ip.
y;
66 edgeNodalBasis.Eval(x, nodalX);
67 edgeNodalBasis.Eval(y, nodalY);
71 for (
int i = 0; i < p-1; i++)
73 shape(4 + 0*(p-1) + i) = (nodalX(i+1))*(1.-y);
74 shape(4 + 1*(p-1) + i) = (nodalY(i+1))*x;
75 shape(4 + 3*(p-1) - i - 1) = (nodalX(i+1)) * y;
76 shape(4 + 4*(p-1) - i - 1) = (nodalY(i+1)) * (1. - x);
94 for (
int i = 0; i<p-1; i++)
96 vtx0fix += (1-edgePts[i+1])*(shape(4 + i) +
97 shape(4 + 4*(p-1) - i - 1));
98 vtx1fix += (1-edgePts[i+1])*(shape(4 + 1*(p-1) + i) +
100 vtx2fix += (1-edgePts[i+1])*(shape(4 + 2*(p-1) + i) +
102 vtx3fix += (1-edgePts[i+1])*(shape(4 + 3*(p-1) + i) +
105 shape(0) = bilinearsAtIP(0) - vtx0fix;
106 shape(1) = bilinearsAtIP(1) - vtx1fix;
107 shape(2) = bilinearsAtIP(2) - vtx2fix;
108 shape(3) = bilinearsAtIP(3) - vtx3fix;
114 double *legX =
new double[p-1];
115 double *legY =
new double[p-1];
121 int interior_total = 0;
122 for (
int j = 4; j < p + 1; j++)
124 for (
int k = 0; k < j-3; k++)
126 shape(4 + 4*(p-1) + interior_total)
127 = legX[k] * legY[j-4-k] * x * (1. - x) * y * (1. - y);
134 delete storeLegendre;
142 double x = ip.
x, y = ip.
y;
150 edgeNodalBasis.Eval(x, nodalX, DnodalX);
151 edgeNodalBasis.Eval(y, nodalY, DnodalY);
153 for (
int i = 0; i < p-1; i++)
155 dshape(4 + 0*(p-1) + i,0) = DnodalX(i+1) * (1.-y);
156 dshape(4 + 0*(p-1) + i,1) = -nodalX(i+1);
157 dshape(4 + 1*(p-1) + i,0) = nodalY(i+1);
158 dshape(4 + 1*(p-1) + i,1) = DnodalY(i+1)*x;
159 dshape(4 + 3*(p-1) - i - 1,0) = DnodalX(i+1)*y;
160 dshape(4 + 3*(p-1) - i - 1,1) = nodalX(i+1);
161 dshape(4 + 4*(p-1) - i - 1,0) = -nodalY(i+1);
162 dshape(4 + 4*(p-1) - i - 1,1) = DnodalY(i+1) * (1.-x);
171 dshape(0,0) = DbilinearsAtIP(0,0);
172 dshape(0,1) = DbilinearsAtIP(0,1);
173 dshape(1,0) = DbilinearsAtIP(1,0);
174 dshape(1,1) = DbilinearsAtIP(1,1);
175 dshape(2,0) = DbilinearsAtIP(2,0);
176 dshape(2,1) = DbilinearsAtIP(2,1);
177 dshape(3,0) = DbilinearsAtIP(3,0);
178 dshape(3,1) = DbilinearsAtIP(3,1);
180 for (
int i = 0; i<p-1; i++)
182 dshape(0,0) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 0) +
183 dshape(4 + 4*(p-1) - i - 1,0));
184 dshape(0,1) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 1) +
185 dshape(4 + 4*(p-1) - i - 1,1));
186 dshape(1,0) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 0) +
187 dshape(4 + (p-2)-i, 0));
188 dshape(1,1) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 1) +
189 dshape(4 + (p-2)-i, 1));
190 dshape(2,0) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 0) +
191 dshape(1 + 2*p-i, 0));
192 dshape(2,1) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 1) +
193 dshape(1 + 2*p-i, 1));
194 dshape(3,0) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 0) +
196 dshape(3,1) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 1) +
202 double *legX =
new double[p-1];
203 double *legY =
new double[p-1];
204 double *DlegX =
new double[p-1];
205 double *DlegY =
new double[p-1];
211 int interior_total = 0;
212 for (
int j = 4; j < p + 1; j++)
214 for (
int k = 0; k < j-3; k++)
216 dshape(4 + 4*(p-1) + interior_total, 0) =
217 legY[j-4-k]*y*(1-y) * (DlegX[k]*x*(1-x) + legX[k]*(1-2*x));
218 dshape(4 + 4*(p-1) + interior_total, 1) =
219 legX[k]*x*(1-x) * (DlegY[j-4-k]*y*(1-y) + legY[j-4-k]*(1-2*y));
227 delete storeLegendre;
int Size() const
Return the logical size of the array.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
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...
Data type dense matrix using column-major storage.
static void CalcLegendre(const int p, const double x, double *u)
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Get the matrix I that defines nodal interpolation between this element and the refined element fine_f...
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Get coordinates of a closed (GaussLegendre) set of points if degree p.
Class for finite elements with basis functions that return scalar values.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Class for computing 1D special polynomials and their associated basis functions.
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...
Basis & GetBasis(const int p, const int btype)
Get a Poly_1D::Basis object of the given degree and BasisType, btype.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Get matrix I "Interpolation" defined through local L2-projection in the space defined by the fine_fe...
double p(const Vector &x, double t)
A 2D bi-linear element on a square with nodes at the vertices of the square.
const Array< int > & GetDofMap() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Class for integration point with weight.
Class for evaluating 1D nodal, positive (Bernstein), or integrated (Gerritsma) bases.
H1Ser_QuadrilateralElement(const int p)
Construct the H1Ser_QuadrilateralElement of order p.
Describes the function space on each element.
int order
Order/degree of the shape functions.