48 double l1 = lcoords[0];
49 double l2 = lcoords[1];
50 double l3 = 1. - l1 - l2;
53 ( 2. * l1 - 1. ) * l1,
54 ( 2. * l2 - 1. ) * l2,
55 ( 2. * l3 - 1. ) * l3,
66 answer =
evalN(lcoords);
68 double l1 = lcoords.
at(1);
69 double l2 = lcoords.
at(2);
70 double l3 = 1. - l1 - l2;
73 ( 2. * l1 - 1. ) * l1,
74 ( 2. * l2 - 1. ) * l2,
75 ( 2. * l3 - 1. ) * l3,
87 double l1 = lcoords[0];
88 double l2 = lcoords[1];
89 double l3 = 1.0 - l1 - l2;
96 -1.0 * ( 4.0 * l3 - 1.0 ),
97 -1.0 * ( 4.0 * l3 - 1.0 ),
108std::pair<double,FloatMatrixF<2,6>>
113 for ( std::size_t i = 1; i <= dn.cols(); i++ ) {
116 double y = c.at(
yind);
119 jacT(0, 0) += dn.
at(1, i) * x;
120 jacT(0, 1) += dn.
at(1, i) * y;
121 jacT(1, 0) += dn.
at(2, i) * x;
122 jacT(1, 1) += dn.
at(2, i) * y;
133 auto tmp =
evaldNdx(lcoords, cellgeo);
144 jacobianMatrix.at(1, 1) += dn.
at(i, 1) * x;
145 jacobianMatrix.at(1, 2) += dn.
at(i, 1) * y;
146 jacobianMatrix.at(2, 1) += dn.
at(i, 2) * x;
147 jacobianMatrix.at(2, 2) += dn.
at(i, 2) * y;
149 inv.beInverseOf(jacobianMatrix);
152 return jacobianMatrix.giveDeterminant();
167 double area = 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 );
169 double y23 = ( y2 - y3 ) / ( 2. * area );
170 double x32 = ( x3 - x2 ) / ( 2. * area );
172 double y31 = ( y3 - y1 ) / ( 2. * area );
173 double x13 = ( x1 - x3 ) / ( 2. * area );
176 answer.
at(1, 1) = 4 * y23 * y23;
177 answer.
at(1, 2) = 4 * x32 * x32;
178 answer.
at(1, 3) = 4 * y23 * x32;
180 answer.
at(2, 1) = 4 * y31 * y31;
181 answer.
at(2, 2) = 4 * x13 * x13;
182 answer.
at(2, 3) = 4 * y31 * x13;
184 answer.
at(3, 1) = 4 * y23 * y23 + 8 * y31 * y23 + 4 * y31 * y31;
185 answer.
at(3, 2) = 4 * x32 * x32 + 8 * x13 * x32 + 4 * x13 * x13;
186 answer.
at(3, 3) = 4 * y23 * x32 + 4 * y31 * x32 + 4 * y23 * x13 + 4 * y31 * x13;
188 answer.
at(4, 1) = 8 * y31 * y23;
189 answer.
at(4, 2) = 8 * x13 * x32;
190 answer.
at(4, 3) = 4 * y31 * x32 + 4 * y23 * x13;
192 answer.
at(5, 1) = ( -8 ) * y31 * y23 + ( -8 ) * y31 * y31;
193 answer.
at(5, 2) = ( -8 ) * x13 * x32 + ( -8 ) * x13 * x13;
194 answer.
at(5, 3) = ( -4 ) * y31 * x32 + ( -4 ) * y23 * x13 + ( -8 ) * y31 * x13;
196 answer.
at(6, 1) = ( -8 ) * y23 * y23 + ( -8 ) * y31 * y23;
197 answer.
at(6, 2) = ( -8 ) * x32 * x32 + ( -8 ) * x13 * x32;
198 answer.
at(6, 3) = ( -8 ) * y23 * x32 + ( -4 ) * y31 * x32 + ( -4 ) * y23 * x13;
207 this->
evalN(n, lcoords, cellgeo);
211 for (
int i = 1; i <= 6; i++ ) {
221 double ksi = lcoords.
at(1);
222 double n3 = 1. - ksi * ksi;
224 answer =
Vec3( ( 1. - ksi - n3 ) * 0.5, ( 1. + ksi - n3 ) * 0.5, n3 );
237 double xi = lcoords.
at(1);
239 dNdxi.
at(1) = xi - 0.5;
240 dNdxi.
at(2) = xi + 0.5;
241 dNdxi.
at(3) = -2 * xi;
256 double xi = lcoords.
at(1);
268 double xi = lcoords(0);
269 double dN1dxi = -0.5 + xi;
270 double dN2dxi = 0.5 + xi;
271 double dN3dxi = -2.0 * xi;
287FEI2dTrQuad :: edgeLocal2global(
FloatArray &answer,
int iedge,
292 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
305FEI2dTrQuad :: computeLocalEdgeMapping(
int iedge)
const
309 }
else if ( iedge == 2 ) {
311 }
else if ( iedge == 3 ) {
314 throw std::range_error(
"invalid edge number");
323 double l1 = lcoords.
at(1);
324 double l2 = lcoords.
at(2);
325 double l3 = 1.0 - l1 - l2;
329 answer.
at(1, 1) = 4.0 * l1 - 1.0;
330 answer.
at(2, 1) = 0.0;
331 answer.
at(3, 1) = -1.0 * ( 4.0 * l3 - 1.0 );
332 answer.
at(4, 1) = 4.0 * l2;
333 answer.
at(5, 1) = -4.0 * l2;
334 answer.
at(6, 1) = 4.0 * l3 - 4.0 * l1;
336 answer.
at(1, 2) = 0.0;
337 answer.
at(2, 2) = 4.0 * l2 - 1.0;
338 answer.
at(3, 2) = -1.0 * ( 4.0 * l3 - 1.0 );
339 answer.
at(4, 2) = 4.0 * l1;
340 answer.
at(5, 2) = 4.0 * l3 - 4.0 * l2;
341 answer.
at(6, 2) = -4.0 * l1;
350 double y1 = p1.at(
yind);
353 double y2 = p2.at(
yind);
356 double y3 = p3.at(
yind);
359 double y4 = p4.at(
yind);
362 double y5 = p5.at(
yind);
365 double y6 = p6.at(
yind);
367 return fabs( ( 4 * ( -( x4 * y1 ) + x6 * y1 + x4 * y2 - x5 * y2 + x5 * y3 - x6 * y3 ) + x2 * ( y1 - y3 - 4 * y4 + 4 * y5 ) +
368 x1 * ( -y2 + y3 + 4 * y4 - 4 * y6 ) + x3 * ( -y1 + y2 - 4 * y5 + 4 * y6 ) ) / 6 );
373 const double point_tol = 1.0e-3;
375 for (
int i = 1; i <= 2; i++ ) {
376 if ( lcoords.
at(i) < - point_tol ) {
378 }
else if ( lcoords.
at(i) > ( 1. + point_tol ) ) {
383 if ( 1. - lcoords.
at(1) - lcoords.
at(2) < - point_tol ) {
385 }
else if ( 1. - lcoords.
at(1) - lcoords.
at(2) > ( 1. + point_tol ) ) {
398 double x1 = node1.
at(
xind);
399 double y1 = node1.at(
yind);
402 double x2 = node2.
at(
xind);
403 double y2 = node2.at(
yind);
406 double x3 = node3.
at(
xind);
407 double y3 = node3.at(
yind);
409 return -( x1 * y2 - x2 * y1 + 4 * ( x3 * ( y1 - y2 ) + y3 * ( x2 - x1 ) ) ) / 3.0;
412std::unique_ptr<IntegrationRule>
415 auto iRule = std::make_unique<GaussIntegrationRule>(1,
nullptr);
416 int points = iRule->getRequiredNumberOfIntegrationPoints(
_Triangle,
order + 2);
417 iRule->SetUpPointsOnTriangle(points, _Unknown);
418 return std::move(iRule);
void edgeEvalN(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
static FloatMatrixF< 2, 6 > evaldNdxi(const FloatArrayF< 2 > &lcoords)
std::pair< double, FloatMatrixF< 2, 6 > > evaldNdx(const FloatArrayF< 2 > &lcoords, const FEICellGeometry &cellgeo) const
IntArray computeLocalEdgeMapping(int iedge) const override
static FloatArrayF< 6 > evalN(const FloatArrayF< 2 > &lcoords)
bool inside(const FloatArray &lcoords) const override
virtual const FloatArray giveVertexCoordinates(int i) const =0
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const
double computeNorm() const
void zero()
Zeroes all coefficients of receiver.
double normalize_giveNorm()
double at(std::size_t i, std::size_t j) const
void resize(Index rows, Index cols)
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
static FloatArray Vec6(const double &a, const double &b, const double &c, const double &d, const double &e, const double &f)
double det(const FloatMatrixF< 2, 2 > &mat)
Computes the determinant.
double dot(const FloatArray &x, const FloatArray &y)
FloatMatrixF< N, N > inv(const FloatMatrixF< N, N > &mat, double zeropiv=1e-24)
Computes the inverse.
static FloatArray Vec3(const double &a, const double &b, const double &c)