75 double D,
double sw2,
double** Stif )
85 for (
int i = 0; i < 4; i++ )
86 for (
int j = 0; j < 4; j++ )
89 for (
int k = 0; k < n_gauss; k++ )
94 double wt = ( NK == 3 ) ?
xgT[ k ].w :
xgQ[ k ].w;
98 for (
int i = 0; i < NK; i++ )
100 phi [ i ] =
phiT [ k ][ i ];
102 phix[ i ] =
phiT1[ k ][ i ] * jcbv[ 1 ] +
103 phiT2[ k ][ i ] * jcbv[ 3 ];
105 phiy[ i ] =
phiT1[ k ][ i ] * jcbv[ 2 ] +
106 phiT2[ k ][ i ] * jcbv[ 4 ];
111 for (
int i = 0; i < NK; i++ )
113 phi [ i ] =
phiQ [ k ][ i ];
115 phix[ i ] =
phiQ1[ k ][ i ] * jcbv[ 1 ] +
116 phiQ2[ k ][ i ] * jcbv[ 3 ];
118 phiy[ i ] =
phiQ1[ k ][ i ] * jcbv[ 2 ] +
119 phiQ2[ k ][ i ] * jcbv[ 4 ];
123 for (
int i = 0; i < NK; i++ )
125 for (
int j = 0; j < NK; j++ )
127 double tmp = xg[ 0 ] * phiy[ j ] * phi[ i ] +
128 ( D * xg[ 0 ] * phix[ j ] -
129 sw2 * xg[ 0 ] * xg[ 0 ] * phi[ j ] ) * phix[ i ];
131 Stif[ j ][ i ] += tmp * jcbv[ 0 ] * wt;
140 double lam3 = 1.0 - lam1 - lam2;
202 Gs1D[ 0 ] = -sqrt ( 5.0 + 2.0 * sqrt( 10.0 / 7.0 ) ) / 3.0;
203 Gs1w[ 0 ] = 0.3 * ( 0.7 + 5.0 * sqrt( 0.7 ) ) /
204 ( 2.0 + 5.0 * sqrt( 0.7 ) );
206 Gs1D[ 1 ] = -sqrt ( 5.0 - 2.0 * sqrt( 10.0 / 7.0 ) ) / 3.0;
207 Gs1w[ 1 ] = 0.3 * ( 0.7 - 5.0 * sqrt( 0.7 ) ) /
208 ( 2.0 - 5.0 * sqrt( 0.7 ) );
211 Gs1w[ 2 ] = 128.0 / 225.0;
213 Gs1D[ 3 ] = -Gs1D[ 1 ];
214 Gs1w[ 3 ] = Gs1w[ 1 ];
216 Gs1D[ 4 ] = -Gs1D[ 0 ];
217 Gs1w[ 4 ] = Gs1w[ 0 ];
219 for (
int i = 0; i < 5; i++ )
221 for (
int j = 0; j < 5; j++ )
225 xgQ[ ind ].
x = ( Gs1D[ i ] + 1.0 ) / 2.0;
226 xgQ[ ind ].
y = ( Gs1D[ j ] + 1.0 ) / 2.0;
227 xgQ[ ind ].
w = Gs1w[ i ] * Gs1w[ j ] / 4.0;
233 qDebug() <<
"Gauss Quadrature on Quad elem with "
235 <<
" points not implemented" ;
284 qDebug() <<
"Gauss Quadrature on Triangular elem with "
286 <<
" not implemented";
300 for (
int i = 0; i < 3; i++ )
302 x[ 0 ] += xd[ i ][ 0 ] *
phiT[ gauss_ind ][ i ];
303 x[ 1 ] += xd[ i ][ 1 ] * phiT[ gauss_ind ][ i ];
308 for (
int i = 0; i < 4; i++ )
310 x[ 0 ] += xd[ i ][ 0 ] *
phiQ[ gauss_ind ][ i ];
311 x[ 1 ] += xd[ i ][ 1 ] * phiQ[ gauss_ind ][ i ];
327 for (
int i = 0; i < 3; i++ )
329 J11 += xd[ i ][ 0 ] *
phiT1[ gauss_ind ][ i ];
330 J12 += xd[ i ][ 0 ] *
phiT2[ gauss_ind ][ i ];
331 J21 += xd[ i ][ 1 ] * phiT1[ gauss_ind ][ i ];
332 J22 += xd[ i ][ 1 ] * phiT2[ gauss_ind ][ i ];
338 for(
int i = 0; i < 4; i++ )
340 J11 += xd[ i ][ 0 ] *
phiQ1[ gauss_ind ][ i ];
341 J12 += xd[ i ][ 0 ] *
phiQ2[ gauss_ind ][ i ];
342 J21 += xd[ i ][ 1 ] * phiQ1[ gauss_ind ][ i ];
343 J22 += xd[ i ][ 1 ] * phiQ2[ gauss_ind ][ i ];
347 jcbv[ 0 ] = J11 * J22 - J12 * J21;
348 jcbv[ 1 ] = J22 / jcbv[ 0 ];
349 jcbv[ 2 ] = -J12 / jcbv[ 0 ];
350 jcbv[ 3 ] = -J21 / jcbv[ 0 ];
351 jcbv[ 4 ] = J11 / jcbv[ 0 ];
358 for (
int i = 0; i <
n_gaussT; i++ )
360 double x =
xgT[ i ].
x;
361 double y =
xgT[ i ].
y;
363 phiT [ i ][ 0 ] = 1.0 - x - y;
364 phiT1[ i ][ 0 ] = -1.0;
365 phiT2[ i ][ 0 ] = -1.0;
368 phiT1[ i ][ 1 ] = 1.0;
369 phiT2[ i ][ 1 ] = 0.0;
372 phiT1[ i ][ 2 ] = 0.0;
373 phiT2[ i ][ 2 ] = 1.0;
378 for (
int i = 0; i <
n_gaussQ; i++ )
380 double x =
xgQ[ i ].
x;
381 double y =
xgQ[ i ].
y;
383 phiQ [ i ][ 0 ] = ( 1.0 - x ) * ( 1.0 - y );
384 phiQ1[ i ][ 0 ] = -( 1.0 - y );
385 phiQ2[ i ][ 0 ] = -( 1.0 - x );
387 phiQ [ i ][ 1 ] = ( 1.0 - y ) * x;
388 phiQ1[ i ][ 1 ] = 1.0 - y;
389 phiQ2[ i ][ 1 ] = -x;
391 phiQ [ i ][ 2 ] = x * y;
395 phiQ [ i ][ 3 ] = ( 1.0 - x ) * y;
396 phiQ1[ i ][ 3 ] = -y;
397 phiQ2[ i ][ 3 ] = 1.0 - x;