67 #define TRSUPG_ZERO_VOF 1.e-8 91 answer = {V_u, V_v, P_f};
154 double ar6 = rho *
area / 6.0;
155 double ar12 = rho *
area / 12.0;
156 double usum, vsum, coeff;
160 answer.
at(1, 1) = answer.
at(2, 2) = answer.
at(3, 3) = ar6;
161 answer.
at(4, 4) = answer.
at(5, 5) = answer.
at(6, 6) = ar6;
163 answer.
at(1, 3) = answer.
at(1, 5) = ar12;
164 answer.
at(3, 1) = answer.
at(3, 5) = ar12;
165 answer.
at(5, 1) = answer.
at(5, 3) = ar12;
167 answer.
at(2, 4) = answer.
at(2, 6) = ar12;
168 answer.
at(4, 2) = answer.
at(4, 6) = ar12;
169 answer.
at(6, 2) = answer.
at(6, 4) = ar12;
174 usum = un.
at(1) + un.
at(3) + un.
at(5);
175 vsum = un.
at(2) + un.
at(4) + un.
at(6);
178 answer.
at(1, 1) += coeff * (
b [ 0 ] * ( usum + un.
at(1) ) +
c [ 0 ] * ( vsum + un.
at(2) ) );
179 answer.
at(1, 3) += coeff * (
b [ 0 ] * ( usum + un.
at(3) ) +
c [ 0 ] * ( vsum + un.
at(4) ) );
180 answer.
at(1, 5) += coeff * (
b [ 0 ] * ( usum + un.
at(5) ) +
c [ 0 ] * ( vsum + un.
at(6) ) );
182 answer.
at(2, 2) += coeff * (
b [ 0 ] * ( usum + un.
at(1) ) +
c [ 0 ] * ( vsum + un.
at(2) ) );
183 answer.
at(2, 4) += coeff * (
b [ 0 ] * ( usum + un.
at(3) ) +
c [ 0 ] * ( vsum + un.
at(4) ) );
184 answer.
at(2, 6) += coeff * (
b [ 0 ] * ( usum + un.
at(5) ) +
c [ 0 ] * ( vsum + un.
at(6) ) );
186 answer.
at(3, 1) += coeff * (
b [ 1 ] * ( usum + un.
at(1) ) +
c [ 1 ] * ( vsum + un.
at(2) ) );
187 answer.
at(3, 3) += coeff * (
b [ 1 ] * ( usum + un.
at(3) ) +
c [ 1 ] * ( vsum + un.
at(4) ) );
188 answer.
at(3, 5) += coeff * (
b [ 1 ] * ( usum + un.
at(5) ) +
c [ 1 ] * ( vsum + un.
at(6) ) );
190 answer.
at(4, 2) += coeff * (
b [ 1 ] * ( usum + un.
at(1) ) +
c [ 1 ] * ( vsum + un.
at(2) ) );
191 answer.
at(4, 4) += coeff * (
b [ 1 ] * ( usum + un.
at(3) ) +
c [ 1 ] * ( vsum + un.
at(4) ) );
192 answer.
at(4, 6) += coeff * (
b [ 1 ] * ( usum + un.
at(5) ) +
c [ 1 ] * ( vsum + un.
at(6) ) );
194 answer.
at(5, 1) += coeff * (
b [ 2 ] * ( usum + un.
at(1) ) +
c [ 2 ] * ( vsum + un.
at(2) ) );
195 answer.
at(5, 3) += coeff * (
b [ 2 ] * ( usum + un.
at(3) ) +
c [ 2 ] * ( vsum + un.
at(4) ) );
196 answer.
at(5, 5) += coeff * (
b [ 2 ] * ( usum + un.
at(5) ) +
c [ 2 ] * ( vsum + un.
at(6) ) );
198 answer.
at(6, 2) += coeff * (
b [ 2 ] * ( usum + un.
at(1) ) +
c [ 2 ] * ( vsum + un.
at(2) ) );
199 answer.
at(6, 4) += coeff * (
b [ 2 ] * ( usum + un.
at(3) ) +
c [ 2 ] * ( vsum + un.
at(4) ) );
200 answer.
at(6, 6) += coeff * (
b [ 2 ] * ( usum + un.
at(5) ) +
c [ 2 ] * ( vsum + un.
at(6) ) );
212 double dudx, dudy, dvdx, dvdy, usum, vsum, coeff;
216 dudx =
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5);
217 dudy =
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5);
218 dvdx =
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6);
219 dvdy =
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6);
221 usum = un.
at(1) + un.
at(3) + un.
at(5);
222 vsum = un.
at(2) + un.
at(4) + un.
at(6);
223 coeff = rho *
area / 12.0;
226 answer.
at(1) = coeff * ( dudx * ( usum + un.
at(1) ) + dudy * ( vsum + un.
at(2) ) );
227 answer.
at(3) = coeff * ( dudx * ( usum + un.
at(3) ) + dudy * ( vsum + un.
at(4) ) );
228 answer.
at(5) = coeff * ( dudx * ( usum + un.
at(5) ) + dudy * ( vsum + un.
at(6) ) );
229 answer.
at(2) = coeff * ( dvdx * ( usum + un.
at(1) ) + dvdy * ( vsum + un.
at(2) ) );
230 answer.
at(4) = coeff * ( dvdx * ( usum + un.
at(3) ) + dvdy * ( vsum + un.
at(4) ) );
231 answer.
at(6) = coeff * ( dvdx * ( usum + un.
at(5) ) + dvdy * ( vsum + un.
at(6) ) );
235 double u1u1 = usum * usum + un.
at(1) * un.
at(1) + un.
at(3) * un.
at(3) + un.
at(5) * un.
at(5);
236 double u1u2 = usum * vsum + un.
at(1) * un.
at(2) + un.
at(3) * un.
at(4) + un.
at(5) * un.
at(6);
237 double u2u2 = vsum * vsum + un.
at(2) * un.
at(2) + un.
at(4) * un.
at(4) + un.
at(6) * un.
at(6);
238 answer.
at(1) += coeff * (
b [ 0 ] * ( dudx * u1u1 + dudy * u1u2 ) +
c [ 0 ] * ( dudx * u1u2 + dudy * u2u2 ) );
239 answer.
at(3) += coeff * (
b [ 1 ] * ( dudx * u1u1 + dudy * u1u2 ) +
c [ 1 ] * ( dudx * u1u2 + dudy * u2u2 ) );
240 answer.
at(5) += coeff * (
b [ 2 ] * ( dudx * u1u1 + dudy * u1u2 ) +
c [ 2 ] * ( dudx * u1u2 + dudy * u2u2 ) );
242 answer.
at(2) += coeff * (
b [ 0 ] * ( dvdx * u1u1 + dvdy * u1u2 ) +
c [ 0 ] * ( dvdx * u1u2 + dvdy * u2u2 ) );
243 answer.
at(4) += coeff * (
b [ 1 ] * ( dvdx * u1u1 + dvdy * u1u2 ) +
c [ 1 ] * ( dvdx * u1u2 + dvdy * u2u2 ) );
244 answer.
at(6) += coeff * (
b [ 2 ] * ( dvdx * u1u1 + dvdy * u1u2 ) +
c [ 2 ] * ( dvdx * u1u2 + dvdy * u2u2 ) );
259 double dudx [ 2 ] [ 2 ], usum [ 2 ];
260 double coeff, ar12 =
area / 12.;
261 int w_dof_addr, u_dof_addr, d1j, d2j, dij;
263 dudx [ 0 ] [ 0 ] =
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5);
264 dudx [ 0 ] [ 1 ] =
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5);
265 dudx [ 1 ] [ 0 ] =
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6);
266 dudx [ 1 ] [ 1 ] =
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6);
267 usum [ 0 ] = un.
at(1) + un.
at(3) + un.
at(5);
268 usum [ 1 ] = un.
at(2) + un.
at(4) + un.
at(6);
271 for (
int i = 1; i <= 2; i++ ) {
272 for (
int k = 1; k <= 3; k++ ) {
273 for (
int j = 1; j <= 2; j++ ) {
274 for (
int m = 1; m <= 3; m++ ) {
275 w_dof_addr = ( k - 1 ) * 2 + i;
276 u_dof_addr = ( m - 1 ) * 2 + j;
280 coeff = ( m == k ) ?
area / 6. :
area / 12.;
281 answer.
at(w_dof_addr, u_dof_addr) = rho * ( 0.0 * d1j * dudx [ i - 1 ] [ 0 ] * coeff + dij *
b [ m - 1 ] * ar12 * ( usum [ 0 ] + un.
at( ( k - 1 ) * 2 + 1 ) ) +
282 0.0 * d2j * dudx [ i - 1 ] [ 1 ] * coeff + dij *
c [ m - 1 ] * ar12 * ( usum [ 1 ] + un.
at( ( k - 1 ) * 2 + 2 ) ) );
289 for (
int i = 1; i <= 2; i++ ) {
290 for (
int k = 1; k <= 3; k++ ) {
291 for (
int j = 1; j <= 2; j++ ) {
292 for (
int m = 1; m <= 3; m++ ) {
293 w_dof_addr = ( k - 1 ) * 2 + i;
294 u_dof_addr = ( m - 1 ) * 2 + j;
298 answer.
at(w_dof_addr, u_dof_addr) +=
t_supg * rho *
300 0.0 * d1j *
b [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 0 ] + un.
at( ( m - 1 ) * 2 + 1 ) ) +
301 0.0 * d1j *
b [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 1 ] + un.
at( ( m - 1 ) * 2 + 2 ) ) +
302 0.0 * d2j *
c [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 0 ] + un.
at( ( m - 1 ) * 2 + 1 ) ) +
303 0.0 * d2j *
c [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 1 ] + un.
at( ( m - 1 ) * 2 + 2 ) ) +
305 0.0 * d1j *
b [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 0 ] + un.
at( ( m - 1 ) * 2 + 1 ) ) +
306 dij *
b [ k - 1 ] *
b [ m - 1 ] * ar12 * ( usum [ 0 ] * usum [ 0 ] + un.
at(1) * un.
at(1) + un.
at(3) * un.
at(3) + un.
at(5) * un.
at(5) ) +
307 0.0 * d2j *
b [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 0 ] + un.
at( ( m - 1 ) * 2 + 1 ) ) +
308 dij *
b [ k - 1 ] *
c [ m - 1 ] * ar12 * ( usum [ 0 ] * usum [ 1 ] + un.
at(1) * un.
at(2) + un.
at(3) * un.
at(4) + un.
at(5) * un.
at(6) ) +
310 0.0 * d1j *
c [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 1 ] + un.
at( ( m - 1 ) * 2 + 2 ) ) +
311 dij *
c [ k - 1 ] *
b [ m - 1 ] * ar12 * ( usum [ 0 ] * usum [ 1 ] + un.
at(1) * un.
at(2) + un.
at(3) * un.
at(4) + un.
at(5) * un.
at(6) ) +
312 0.0 * d2j *
c [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 1 ] + un.
at( ( m - 1 ) * 2 + 2 ) ) +
313 dij *
c [ k - 1 ] *
c [ m - 1 ] * ar12 * ( usum [ 1 ] * usum [ 1 ] + un.
at(2) * un.
at(2) + un.
at(4) * un.
at(4) + un.
at(6) * un.
at(6) )
332 eps.at(1) = (
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5) );
333 eps.at(2) = (
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6) );
334 eps.at(3) = (
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6) +
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5) );
337 stress.
times(1. / Re);
341 for (
int i = 0; i < 3; i++ ) {
344 answer.
at( ( i ) * 2 + 1 ) =
area * ( stress.
at(1) *
b [ i ] + stress.
at(3) *
c [ i ] );
345 answer.
at( ( i + 1 ) * 2 ) =
area * ( stress.
at(3) *
b [ i ] + stress.
at(2) *
c [ i ] );
356 _b.
at(1, 1) =
b [ 0 ];
358 _b.
at(1, 3) =
b [ 1 ];
360 _b.
at(1, 5) =
b [ 2 ];
363 _b.
at(2, 2) =
c [ 0 ];
365 _b.
at(2, 4) =
c [ 1 ];
367 _b.
at(2, 6) =
c [ 2 ];
368 _b.
at(3, 1) =
c [ 0 ];
369 _b.
at(3, 2) =
b [ 0 ];
370 _b.
at(3, 3) =
c [ 1 ];
371 _b.
at(3, 4) =
b [ 1 ];
372 _b.
at(3, 5) =
c [ 2 ];
373 _b.
at(3, 6) =
b [ 2 ];
381 answer.
times(1. / Re);
391 double ar3 =
area / 3.0, coeff;
396 answer.
at(1, 1) = answer.
at(1, 2) = answer.
at(1, 3) = -
b [ 0 ] * ar3;
397 answer.
at(3, 1) = answer.
at(3, 2) = answer.
at(3, 3) = -
b [ 1 ] * ar3;
398 answer.
at(5, 1) = answer.
at(5, 2) = answer.
at(5, 3) = -
b [ 2 ] * ar3;
400 answer.
at(2, 1) = answer.
at(2, 2) = answer.
at(2, 3) = -
c [ 0 ] * ar3;
401 answer.
at(4, 1) = answer.
at(4, 2) = answer.
at(4, 3) = -
c [ 1 ] * ar3;
402 answer.
at(6, 1) = answer.
at(6, 2) = answer.
at(6, 3) = -
c [ 2 ] * ar3;
406 usum = un.
at(1) + un.
at(3) + un.
at(5);
407 vsum = un.
at(2) + un.
at(4) + un.
at(6);
410 answer.
at(1, 1) += coeff * ( usum *
b [ 0 ] *
b [ 0 ] + vsum *
c [ 0 ] *
b [ 0 ] );
411 answer.
at(1, 2) += coeff * ( usum *
b [ 0 ] *
b [ 1 ] + vsum *
c [ 0 ] *
b [ 1 ] );
412 answer.
at(1, 3) += coeff * ( usum *
b [ 0 ] *
b [ 2 ] + vsum *
c [ 0 ] *
b [ 2 ] );
414 answer.
at(3, 1) += coeff * ( usum *
b [ 1 ] *
b [ 0 ] + vsum *
c [ 1 ] *
b [ 0 ] );
415 answer.
at(3, 2) += coeff * ( usum *
b [ 1 ] *
b [ 1 ] + vsum *
c [ 1 ] *
b [ 1 ] );
416 answer.
at(3, 3) += coeff * ( usum *
b [ 1 ] *
b [ 2 ] + vsum *
c [ 1 ] *
b [ 2 ] );
418 answer.
at(5, 1) += coeff * ( usum *
b [ 2 ] *
b [ 0 ] + vsum *
c [ 2 ] *
b [ 0 ] );
419 answer.
at(5, 2) += coeff * ( usum *
b [ 2 ] *
b [ 1 ] + vsum *
c [ 2 ] *
b [ 1 ] );
420 answer.
at(5, 3) += coeff * ( usum *
b [ 2 ] *
b [ 2 ] + vsum *
c [ 2 ] *
b [ 2 ] );
422 answer.
at(2, 1) += coeff * ( usum *
b [ 0 ] *
c [ 0 ] + vsum *
c [ 0 ] *
c [ 0 ] );
423 answer.
at(2, 2) += coeff * ( usum *
b [ 0 ] *
c [ 1 ] + vsum *
c [ 0 ] *
c [ 1 ] );
424 answer.
at(2, 3) += coeff * ( usum *
b [ 0 ] *
c [ 2 ] + vsum *
c [ 0 ] *
c [ 2 ] );
426 answer.
at(4, 1) += coeff * ( usum *
b [ 1 ] *
c [ 0 ] + vsum *
c [ 1 ] *
c [ 0 ] );
427 answer.
at(4, 2) += coeff * ( usum *
b [ 1 ] *
c [ 1 ] + vsum *
c [ 1 ] *
c [ 1 ] );
428 answer.
at(4, 3) += coeff * ( usum *
b [ 1 ] *
c [ 2 ] + vsum *
c [ 1 ] *
c [ 2 ] );
430 answer.
at(6, 1) += coeff * ( usum *
b [ 2 ] *
c [ 0 ] + vsum *
c [ 2 ] *
c [ 0 ] );
431 answer.
at(6, 2) += coeff * ( usum *
b [ 2 ] *
c [ 1 ] + vsum *
c [ 2 ] *
c [ 1 ] );
432 answer.
at(6, 3) += coeff * ( usum *
b [ 2 ] *
c [ 2 ] + vsum *
c [ 2 ] *
c [ 2 ] );
444 b [ 0 ],
c [ 0 ],
b [ 1 ], c [ 1 ], b [ 2 ], c [ 2 ]
447 for (
int i = 1; i <= 6; i++ ) {
448 for (
int j = 1; j <= 6; j++ ) {
449 answer.
at(i, j) = coeff * n [ i - 1 ] * n [ j - 1 ];
460 double ar3 =
area / 3.0;
463 answer.
at(1, 1) = answer.
at(2, 1) = answer.
at(3, 1) =
b [ 0 ] * ar3;
464 answer.
at(1, 3) = answer.
at(2, 3) = answer.
at(3, 3) =
b [ 1 ] * ar3;
465 answer.
at(1, 5) = answer.
at(2, 5) = answer.
at(3, 5) =
b [ 2 ] * ar3;
467 answer.
at(1, 2) = answer.
at(2, 2) = answer.
at(3, 2) =
c [ 0 ] * ar3;
468 answer.
at(1, 4) = answer.
at(2, 4) = answer.
at(3, 4) =
c [ 1 ] * ar3;
469 answer.
at(1, 6) = answer.
at(2, 6) = answer.
at(3, 6) =
c [ 2 ] * ar3;
477 double dudx, dudy, dvdx, dvdy, usum, vsum;
483 dudx =
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5);
484 dudy =
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5);
485 dvdx =
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6);
486 dvdy =
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6);
488 usum = un.
at(1) + un.
at(3) + un.
at(5);
489 vsum = un.
at(2) + un.
at(4) + un.
at(6);
493 answer.
at(1) = coeff * (
b [ 0 ] * ( dudx * usum + dudy * vsum ) +
c [ 0 ] * ( dvdx * usum + dvdy * vsum ) );
494 answer.
at(2) = coeff * (
b [ 1 ] * ( dudx * usum + dudy * vsum ) +
c [ 1 ] * ( dvdx * usum + dvdy * vsum ) );
495 answer.
at(3) = coeff * (
b [ 2 ] * ( dudx * usum + dudy * vsum ) +
c [ 2 ] * ( dvdx * usum + dvdy * vsum ) );
504 int w_dof_addr, u_dof_addr, d1j, d2j, km1, mm1;
510 double dudx [ 2 ] [ 2 ], usum [ 2 ];
513 dudx [ 0 ] [ 0 ] =
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5);
514 dudx [ 0 ] [ 1 ] =
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5);
515 dudx [ 1 ] [ 0 ] =
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6);
516 dudx [ 1 ] [ 1 ] =
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6);
517 usum [ 0 ] = un.
at(1) + un.
at(3) + un.
at(5);
518 usum [ 1 ] = un.
at(2) + un.
at(4) + un.
at(6);
522 for (
int k = 1; k <= 3; k++ ) {
524 for (
int j = 1; j <= 2; j++ ) {
525 for (
int m = 1; m <= 3; m++ ) {
527 u_dof_addr = ( m - 1 ) * 2 + j;
531 answer.
at(w_dof_addr, u_dof_addr) = coeff * ( 0.0 * d1j *
b [ km1 ] * dudx [ 0 ] [ 0 ] + d1j *
b [ km1 ] *
b [ mm1 ] * usum [ 0 ] +
532 0.0 * d2j *
b [ km1 ] * dudx [ 0 ] [ 1 ] + d1j *
b [ km1 ] *
c [ mm1 ] * usum [ 1 ] +
533 0.0 * d1j *
c [ km1 ] * dudx [ 1 ] [ 0 ] + d2j *
c [ km1 ] *
b [ mm1 ] * usum [ 0 ] +
534 0.0 * d2j *
c [ km1 ] * dudx [ 1 ] [ 1 ] + d2j *
c [ km1 ] *
c [ mm1 ] * usum [ 1 ] );
548 answer.
at(1, 1) = answer.
at(1, 3) = answer.
at(1, 5) = coeff *
b [ 0 ];
549 answer.
at(1, 2) = answer.
at(1, 4) = answer.
at(1, 6) = coeff *
c [ 0 ];
550 answer.
at(2, 1) = answer.
at(2, 3) = answer.
at(2, 5) = coeff * b [ 1 ];
551 answer.
at(2, 2) = answer.
at(2, 4) = answer.
at(2, 6) = coeff * c [ 1 ];
552 answer.
at(3, 1) = answer.
at(3, 3) = answer.
at(3, 5) = coeff * b [ 2 ];
553 answer.
at(3, 2) = answer.
at(3, 4) = answer.
at(3, 6) = coeff * c [ 2 ];
564 for (
int i = 1; i <= 3; i++ ) {
565 for (
int j = 1; j <= 3; j++ ) {
566 answer.
at(i, j) = coeff * (
b [ i - 1 ] *
b [ j - 1 ] +
c [ i - 1 ] *
c [ j - 1 ] );
575 int node1, node2, node3;
579 double l, t1, t2, _t1, _t2;
589 node2 = ( node1 == 3 ? 1 : node1 + 1 );
591 node3 = ( node2 == 3 ? 1 : node2 + 1 );
604 l = sqrt(_t1 * _t1 + _t2 * _t2);
609 double t11 = t1 * t1;
610 double t12 = t1 * t2;
611 double t22 = t2 * t2;
613 double d12 = d1 * d2;
614 double d13 = d1 * d3;
615 double d23 = d2 * d3;
617 answer.
at(1, 1) = ( l / 3 ) * beta * d1 * t11;
618 answer.
at(1, 2) = ( l / 3 ) * beta * d1 * t12;
619 answer.
at(2, 1) = ( l / 3 ) * beta * d1 * t12;
620 answer.
at(2, 2) = ( l / 3 ) * beta * d1 * t22;
622 answer.
at(1, 3) = ( l / 6 ) * beta * d12 * t11;
623 answer.
at(1, 4) = ( l / 6 ) * beta * d12 * t12;
624 answer.
at(2, 3) = ( l / 6 ) * beta * d12 * t12;
625 answer.
at(2, 4) = ( l / 6 ) * beta * d12 * t22;
627 answer.
at(1, 5) = ( l / 6 ) * beta * d13 * t11;
628 answer.
at(1, 6) = ( l / 6 ) * beta * d13 * t12;
629 answer.
at(2, 5) = ( l / 6 ) * beta * d13 * t12;
630 answer.
at(2, 6) = ( l / 6 ) * beta * d13 * t22;
632 answer.
at(3, 1) = ( l / 6 ) * beta * d12 * t11;
633 answer.
at(3, 2) = ( l / 6 ) * beta * d12 * t12;
634 answer.
at(4, 1) = ( l / 6 ) * beta * d12 * t12;
635 answer.
at(4, 2) = ( l / 6 ) * beta * d12 * t22;
637 answer.
at(3, 3) = ( l / 3 ) * beta * d2 * t11;
638 answer.
at(3, 4) = ( l / 3 ) * beta * d2 * t12;
639 answer.
at(4, 3) = ( l / 3 ) * beta * d2 * t12;
640 answer.
at(4, 4) = ( l / 3 ) * beta * d2 * t22;
642 answer.
at(3, 5) = ( l / 6 ) * beta * d23 * t11;
643 answer.
at(3, 6) = ( l / 6 ) * beta * d23 * t12;
644 answer.
at(4, 5) = ( l / 6 ) * beta * d23 * t12;
645 answer.
at(4, 6) = ( l / 6 ) * beta * d23 * t22;
647 answer.
at(5, 1) = ( l / 6 ) * beta * d13 * t11;
648 answer.
at(5, 2) = ( l / 6 ) * beta * d13 * t12;
649 answer.
at(6, 1) = ( l / 6 ) * beta * d13 * t12;
650 answer.
at(6, 2) = ( l / 6 ) * beta * d13 * t22;
652 answer.
at(5, 3) = ( l / 6 ) * beta * d23 * t11;
653 answer.
at(5, 4) = ( l / 6 ) * beta * d23 * t12;
654 answer.
at(6, 3) = ( l / 6 ) * beta * d23 * t12;
655 answer.
at(6, 4) = ( l / 6 ) * beta * d23 * t22;
657 answer.
at(5, 5) = ( l / 3 ) * beta * d3 * t11;
658 answer.
at(5, 6) = ( l / 3 ) * beta * d3 * t12;
659 answer.
at(6, 5) = ( l / 3 ) * beta * d3 * t12;
660 answer.
at(6, 6) = ( l / 3 ) * beta * d3 * t22;
669 int node1, node2, node3;
673 double l, n1, n2, _t1, _t2;
682 node2 = ( node1 == 3 ? 1 : node1 + 1 );
684 node3 = ( node2 == 3 ? 1 : node2 + 1 );
697 l = sqrt(_t1 * _t1 + _t2 * _t2);
702 double n11 = n1 * n1;
703 double n12 = n1 * n2;
704 double n22 = n2 * n2;
706 double d12 = d1 * d2;
707 double d13 = d1 * d3;
708 double d23 = d2 * d3;
710 answer.
at(1, 1) = ( l / 3 ) * ( 1 / alpha ) * d1 * n11;
711 answer.
at(1, 2) = ( l / 3 ) * ( 1 / alpha ) * d1 * n12;
712 answer.
at(2, 1) = ( l / 3 ) * ( 1 / alpha ) * d1 * n12;
713 answer.
at(2, 2) = ( l / 3 ) * ( 1 / alpha ) * d1 * n22;
715 answer.
at(1, 3) = ( l / 6 ) * ( 1 / alpha ) * d12 * n11;
716 answer.
at(1, 4) = ( l / 6 ) * ( 1 / alpha ) * d12 * n12;
717 answer.
at(2, 3) = ( l / 6 ) * ( 1 / alpha ) * d12 * n12;
718 answer.
at(2, 4) = ( l / 6 ) * ( 1 / alpha ) * d12 * n22;
720 answer.
at(1, 5) = ( l / 6 ) * ( 1 / alpha ) * d13 * n11;
721 answer.
at(1, 6) = ( l / 6 ) * ( 1 / alpha ) * d13 * n12;
722 answer.
at(2, 5) = ( l / 6 ) * ( 1 / alpha ) * d13 * n12;
723 answer.
at(2, 6) = ( l / 6 ) * ( 1 / alpha ) * d13 * n22;
725 answer.
at(3, 1) = ( l / 6 ) * ( 1 / alpha ) * d12 * n11;
726 answer.
at(3, 2) = ( l / 6 ) * ( 1 / alpha ) * d12 * n12;
727 answer.
at(4, 1) = ( l / 6 ) * ( 1 / alpha ) * d12 * n12;
728 answer.
at(4, 2) = ( l / 6 ) * ( 1 / alpha ) * d12 * n22;
730 answer.
at(3, 3) = ( l / 3 ) * ( 1 / alpha ) * d2 * n11;
731 answer.
at(3, 4) = ( l / 3 ) * ( 1 / alpha ) * d2 * n12;
732 answer.
at(4, 3) = ( l / 3 ) * ( 1 / alpha ) * d2 * n12;
733 answer.
at(4, 4) = ( l / 3 ) * ( 1 / alpha ) * d2 * n22;
735 answer.
at(3, 5) = ( l / 6 ) * ( 1 / alpha ) * d23 * n11;
736 answer.
at(3, 6) = ( l / 6 ) * ( 1 / alpha ) * d23 * n12;
737 answer.
at(4, 5) = ( l / 6 ) * ( 1 / alpha ) * d23 * n12;
738 answer.
at(4, 6) = ( l / 6 ) * ( 1 / alpha ) * d23 * n22;
740 answer.
at(5, 1) = ( l / 6 ) * ( 1 / alpha ) * d13 * n11;
741 answer.
at(5, 2) = ( l / 6 ) * ( 1 / alpha ) * d13 * n12;
742 answer.
at(6, 1) = ( l / 6 ) * ( 1 / alpha ) * d13 * n12;
743 answer.
at(6, 2) = ( l / 6 ) * ( 1 / alpha ) * d13 * n22;
745 answer.
at(5, 3) = ( l / 6 ) * ( 1 / alpha ) * d23 * n11;
746 answer.
at(5, 4) = ( l / 6 ) * ( 1 / alpha ) * d23 * n12;
747 answer.
at(6, 3) = ( l / 6 ) * ( 1 / alpha ) * d23 * n12;
748 answer.
at(6, 4) = ( l / 6 ) * ( 1 / alpha ) * d23 * n22;
750 answer.
at(5, 5) = ( l / 3 ) * ( 1 / alpha ) * d3 * n11;
751 answer.
at(5, 6) = ( l / 3 ) * ( 1 / alpha ) * d3 * n12;
752 answer.
at(6, 5) = ( l / 3 ) * ( 1 / alpha ) * d3 * n12;
753 answer.
at(6, 6) = ( l / 3 ) * ( 1 / alpha ) * d3 * n22;
761 int node1, node2, node3;
765 double l, n1, n2, t1, t2;
772 node2 = ( node1 == 3 ? 1 : node1 + 1 );
774 node3 = ( node2 == 3 ? 1 : node2 + 1 );
788 l = sqrt(t1 * t1 + t2 * t2);
793 answer.
at(1, 1) = ( l / 3 ) * d1 * d1 * n1;
794 answer.
at(1, 2) = ( l / 6 ) * d1 * d2 * n1;
795 answer.
at(1, 3) = ( l / 6 ) * d1 * d3 * n1;
796 answer.
at(2, 1) = ( l / 3 ) * d1 * d1 * n2;
797 answer.
at(2, 2) = ( l / 6 ) * d1 * d2 * n2;
798 answer.
at(2, 3) = ( l / 6 ) * d1 * d3 * n2;
800 answer.
at(3, 1) = ( l / 6 ) * d2 * d1 * n1;
801 answer.
at(3, 2) = ( l / 3 ) * d2 * d2 * n1;
802 answer.
at(3, 3) = ( l / 6 ) * d2 * d3 * n1;
803 answer.
at(4, 1) = ( l / 6 ) * d2 * d1 * n2;
804 answer.
at(4, 2) = ( l / 3 ) * d2 * d2 * n2;
805 answer.
at(4, 3) = ( l / 6 ) * d2 * d3 * n2;
807 answer.
at(5, 1) = ( l / 6 ) * d3 * d1 * n1;
808 answer.
at(5, 2) = ( l / 6 ) * d3 * d2 * n1;
809 answer.
at(5, 3) = ( l / 3 ) * d3 * d3 * n1;
810 answer.
at(6, 1) = ( l / 6 ) * d3 * d1 * n2;
811 answer.
at(6, 2) = ( l / 6 ) * d3 * d2 * n2;
812 answer.
at(6, 3) = ( l / 3 ) * d3 * d3 * n2;
820 double coeffx, coeffy, usum [ 2 ];
826 usum [ 0 ] = un.
at(1) + un.
at(3) + un.
at(5);
827 usum [ 1 ] = un.
at(2) + un.
at(4) + un.
at(6);
833 coeffx =
area * mu_0 / ( 12.0 * kx );
834 coeffy =
area * mu_0 / ( 12.0 * ky );
835 for (
int i = 1; i <= 3; i++ ) {
836 answer.
at(2 * i - 1, 2 * i - 1) -= coeffx;
837 answer.
at(2 * i, 2 * i) -= coeffy;
838 for (
int j = 1; j <= 3; j++ ) {
839 answer.
at(2 * i - 1, 2 * j - 1) -= coeffx * ( 1.0 + 4.0 *
t_supg * (
b [ i - 1 ] * usum [ 0 ] +
c [ i - 1 ] * usum [ 1 ] ) );
840 answer.
at(2 * i, 2 * j) -= coeffy * ( 1.0 + 4.0 *
t_supg * (
b [ i - 1 ] * usum [ 0 ] +
c [ i - 1 ] * usum [ 1 ] ) );
848 double coeffx, coeffy;
856 coeffx =
area * mu_0 / ( 3.0 * kx * rho );
857 coeffy =
area * mu_0 / ( 3.0 * ky * rho );
858 for (
int i = 1; i <= 3; i++ ) {
859 for (
int j = 1; j <= 3; j++ ) {
860 answer.
at(i, 2 * j - 1) -= coeffx *
t_pspg *
b [ i - 1 ];
861 answer.
at(i, 2 * j) -= coeffy *
t_pspg *
c [ i - 1 ];
881 usum [ 0 ] = un.
at(1) + un.
at(3) + un.
at(5);
882 usum [ 1 ] = un.
at(2) + un.
at(4) + un.
at(6);
883 double coeff = rho *
area / 3.0;
885 for (
int i = 1; i <= nLoads; i++ ) {
891 answer.
at(1) += coeff * ( gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 0 ] * usum [ 0 ] +
c [ 0 ] * usum [ 1 ] ) ) );
892 answer.
at(2) += coeff * ( gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 0 ] * usum [ 0 ] +
c [ 0 ] * usum [ 1 ] ) ) );
893 answer.
at(3) += coeff * ( gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 1 ] * usum [ 0 ] +
c [ 1 ] * usum [ 1 ] ) ) );
894 answer.
at(4) += coeff * ( gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 1 ] * usum [ 0 ] +
c [ 1 ] * usum [ 1 ] ) ) );
895 answer.
at(5) += coeff * ( gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 2 ] * usum [ 0 ] +
c [ 2 ] * usum [ 1 ] ) ) );
896 answer.
at(6) += coeff * ( gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 2 ] * usum [ 0 ] +
c [ 2 ] * usum [ 1 ] ) ) );
909 gVector.
at(1) = tau_0 * sqrt(kx * phi) / ( kx * alpha );
910 gVector.
at(2) = tau_0 * sqrt(ky * phi) / ( ky * alpha );
912 answer.
at(1) -=
area * ( gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 0 ] * usum [ 0 ] +
c [ 0 ] * usum [ 1 ] ) ) );
913 answer.
at(2) -=
area * ( gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 0 ] * usum [ 0 ] +
c [ 0 ] * usum [ 1 ] ) ) );
914 answer.
at(3) -=
area * ( gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 1 ] * usum [ 0 ] +
c [ 1 ] * usum [ 1 ] ) ) );
915 answer.
at(4) -=
area * ( gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 1 ] * usum [ 0 ] +
c [ 1 ] * usum [ 1 ] ) ) );
916 answer.
at(5) -=
area * ( gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 2 ] * usum [ 0 ] +
c [ 2 ] * usum [ 1 ] ) ) );
917 answer.
at(6) -=
area * ( gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 2 ] * usum [ 0 ] +
c [ 2 ] * usum [ 1 ] ) ) );
934 for (
int i = 1; i <= numLoads; i++ ) {
939 n2 = ( n1 == 3 ? 1 : n1 + 1 );
943 l = sqrt(tx * tx + ty * ty);
948 load->computeValueAt(t, tStep, coords, VM_Total);
952 answer.
at( ( n1 - 1 ) * 2 + 1 ) += t.
at(1) * l / 2.;
953 answer.
at(n1 * 2) += t.
at(2) * l / 2.;
955 answer.
at( ( n2 - 1 ) * 2 + 1 ) += t.
at(1) * l / 2.;
956 answer.
at(n2 * 2) += t.
at(2) * l / 2.;
976 for (
int i = 1; i <= nLoads; i++ ) {
982 answer.
at(1) += coeff * (
b [ 0 ] * gVector.
at(1) +
c [ 0 ] * gVector.
at(2) );
983 answer.
at(2) += coeff * (
b [ 1 ] * gVector.
at(1) +
c [ 1 ] * gVector.
at(2) );
984 answer.
at(3) += coeff * (
b [ 2 ] * gVector.
at(1) +
c [ 2 ] * gVector.
at(2) );
1000 gVector.
at(1) = tau_0 * sqrt(kx * phi) / ( kx * alpha * rho );
1001 gVector.
at(2) = tau_0 * sqrt(ky * phi) / ( ky * alpha * rho );
1003 answer.
at(1) -= coeff * (
b [ 0 ] * gVector.
at(1) +
c [ 0 ] * gVector.
at(2) );
1004 answer.
at(2) -= coeff * (
b [ 1 ] * gVector.
at(1) +
c [ 1 ] * gVector.
at(2) );
1005 answer.
at(3) -= coeff * (
b [ 2 ] * gVector.
at(1) +
c [ 2 ] * gVector.
at(2) );
1013 if ( type != ExternalForcesVector ) {
1034 double u1sum = un.
at(1) + un.
at(3) + un.
at(5);
1035 double u2sum = un.
at(2) + un.
at(4) + un.
at(6);
1044 coeff = rho *
area / 3.0;
1045 answer.
at(1) = coeff * gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 0 ] * u1sum +
c [ 0 ] * u2sum ) );
1046 answer.
at(2) = coeff * gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 0 ] * u1sum +
c [ 0 ] * u2sum ) );
1047 answer.
at(4) = coeff * gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 1 ] * u1sum +
c [ 1 ] * u2sum ) );
1048 answer.
at(5) = coeff * gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 1 ] * u1sum +
c [ 1 ] * u2sum ) );
1049 answer.
at(7) = coeff * gVector.
at(1) * ( 1.0 +
t_supg * (
b [ 2 ] * u1sum +
c [ 2 ] * u2sum ) );
1050 answer.
at(8) = coeff * gVector.
at(2) * ( 1.0 +
t_supg * (
b [ 2 ] * u1sum +
c [ 2 ] * u2sum ) );
1054 answer.
at(3) = coeff * (
b [ 0 ] * gVector.
at(1) +
c [ 0 ] * gVector.
at(2) );
1055 answer.
at(6) = coeff * (
b [ 1 ] * gVector.
at(1) +
c [ 1 ] * gVector.
at(2) );
1056 answer.
at(9) = coeff * (
b [ 2 ] * gVector.
at(1) +
c [ 2 ] * gVector.
at(2) );
1069 t.
at(1) = tau_0 * sqrt(kx * phi) / ( kx * alpha );
1070 t.
at(2) = tau_0 * sqrt(ky * phi) / ( ky * alpha );
1073 answer.
at(1) =
area * t.
at(1) * ( 1.0 +
t_supg * (
b [ 0 ] * u1sum +
c [ 0 ] * u2sum ) );
1074 answer.
at(2) =
area * t.
at(2) * ( 1.0 +
t_supg * (
b [ 0 ] * u1sum +
c [ 0 ] * u2sum ) );
1075 answer.
at(4) =
area * t.
at(1) * ( 1.0 +
t_supg * (
b [ 1 ] * u1sum +
c [ 1 ] * u2sum ) );
1076 answer.
at(5) =
area * t.
at(2) * ( 1.0 +
t_supg * (
b [ 1 ] * u1sum +
c [ 1 ] * u2sum ) );
1077 answer.
at(7) =
area * t.
at(1) * ( 1.0 +
t_supg * (
b [ 2 ] * u1sum +
c [ 2 ] * u2sum ) );
1078 answer.
at(8) =
area * t.
at(2) * ( 1.0 +
t_supg * (
b [ 2 ] * u1sum +
c [ 2 ] * u2sum ) );
1082 answer.
at(3) = coeff * (
b [ 0 ] * t.
at(1) +
c [ 0 ] * t.
at(2) );
1083 answer.
at(6) = coeff * (
b [ 1 ] * t.
at(1) +
c [ 1 ] * t.
at(2) );
1084 answer.
at(9) = coeff * (
b [ 2 ] * t.
at(1) +
c [ 2 ] * t.
at(2) );
1093 int i, j, k, m, km1, mm1, d1j, d2j, dij, w_dof_addr, u_dof_addr;
1094 double __g_norm, __gamma_norm, __gammav_norm, __beta_norm, __betav_norm, __c_norm, __ctilda_norm, __e_norm, __k_norm, __Re;
1095 double __t_p1, __t_p2, __t_p3, __t_s1, __t_s2, __t_s3;
1097 double dudx [ 2 ] [ 2 ], usum [ 2 ];
1117 usum [ 0 ] = un.
at(1) + un.at(3) + un.at(5);
1118 usum [ 1 ] = un.at(2) + un.at(4) + un.at(6);
1124 double ar3 =
area / 3.0;
1126 __tmp.
at(1, 1) = __tmp.
at(1, 2) = __tmp.
at(1, 3) =
b [ 0 ] * ar3;
1127 __tmp.
at(3, 1) = __tmp.
at(3, 2) = __tmp.
at(3, 3) =
b [ 1 ] * ar3;
1128 __tmp.
at(5, 1) = __tmp.
at(5, 2) = __tmp.
at(5, 3) =
b [ 2 ] * ar3;
1130 __tmp.
at(2, 1) = __tmp.
at(2, 2) = __tmp.
at(2, 3) =
c [ 0 ] * ar3;
1131 __tmp.
at(4, 1) = __tmp.
at(4, 2) = __tmp.
at(4, 3) =
c [ 1 ] * ar3;
1132 __tmp.
at(6, 1) = __tmp.
at(6, 2) = __tmp.
at(6, 3) =
c [ 2 ] * ar3;
1138 dudx [ 0 ] [ 0 ] =
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5);
1139 dudx [ 0 ] [ 1 ] =
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5);
1140 dudx [ 1 ] [ 0 ] =
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6);
1141 dudx [ 1 ] [ 1 ] =
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6);
1145 double coeff =
area / 3.;
1146 for ( k = 1; k <= 3; k++ ) {
1148 for ( j = 1; j <= 2; j++ ) {
1149 for ( m = 1; m <= 3; m++ ) {
1151 u_dof_addr = ( m - 1 ) * 2 + j;
1155 __tmp.
at(w_dof_addr, u_dof_addr) = coeff * ( 0.0 * d1j *
b [ km1 ] * dudx [ 0 ] [ 0 ] + d1j *
b [ km1 ] *
b [ mm1 ] * usum [ 0 ] +
1156 0.0 * d2j *
b [ km1 ] * dudx [ 0 ] [ 1 ] + d1j *
b [ km1 ] *
c [ mm1 ] * usum [ 1 ] +
1157 0.0 * d1j *
c [ km1 ] * dudx [ 1 ] [ 0 ] + d2j *
c [ km1 ] *
b [ mm1 ] * usum [ 0 ] +
1158 0.0 * d2j *
c [ km1 ] * dudx [ 1 ] [ 1 ] + d2j *
c [ km1 ] *
c [ mm1 ] * usum [ 1 ] );
1169 __tmp.
at(1, 1) = __tmp.
at(1, 3) = __tmp.
at(1, 5) = ar3 *
b [ 0 ];
1170 __tmp.
at(1, 2) = __tmp.
at(1, 4) = __tmp.
at(1, 6) = ar3 *
c [ 0 ];
1171 __tmp.
at(2, 1) = __tmp.
at(2, 3) = __tmp.
at(2, 5) = ar3 * b [ 1 ];
1172 __tmp.
at(2, 2) = __tmp.
at(2, 4) = __tmp.
at(2, 6) = ar3 * c [ 1 ];
1173 __tmp.
at(3, 1) = __tmp.
at(3, 3) = __tmp.
at(3, 5) = ar3 * b [ 2 ];
1174 __tmp.
at(3, 2) = __tmp.
at(3, 4) = __tmp.
at(3, 6) = ar3 * c [ 2 ];
1183 for ( i = 1; i <= 2; i++ ) {
1184 for ( k = 1; k <= 3; k++ ) {
1185 for ( j = 1; j <= 2; j++ ) {
1186 for ( m = 1; m <= 3; m++ ) {
1187 w_dof_addr = ( k - 1 ) * 2 + i;
1188 u_dof_addr = ( m - 1 ) * 2 + j;
1192 coeff = ( m == k ) ?
area / 6. :
area / 12.;
1193 __tmp.
at(w_dof_addr, u_dof_addr) = rho * ( 0.0 * d1j * dudx [ i - 1 ] [ 0 ] * coeff + dij * b [ m - 1 ] * (
area / 12. ) * ( usum [ 0 ] + un.at( ( k - 1 ) * 2 + 1 ) ) +
1194 0.0 * d2j * dudx [ i - 1 ] [ 1 ] * coeff + dij * c [ m - 1 ] * (
area / 12. ) * ( usum [ 1 ] + un.at( ( k - 1 ) * 2 + 2 ) ) );
1204 coeff = rho *
area / 12.;
1206 __tmp.
at(1, 1) = coeff * ( b [ 0 ] * ( usum [ 0 ] + un.at(1) ) + c [ 0 ] * ( usum [ 1 ] + un.at(2) ) );
1207 __tmp.
at(1, 3) = coeff * ( b [ 0 ] * ( usum [ 0 ] + un.at(3) ) + c [ 0 ] * ( usum [ 1 ] + un.at(4) ) );
1208 __tmp.
at(1, 5) = coeff * ( b [ 0 ] * ( usum [ 0 ] + un.at(5) ) + c [ 0 ] * ( usum [ 1 ] + un.at(6) ) );
1210 __tmp.
at(2, 2) = coeff * ( b [ 0 ] * ( usum [ 0 ] + un.at(1) ) + c [ 0 ] * ( usum [ 1 ] + un.at(2) ) );
1211 __tmp.
at(2, 4) = coeff * ( b [ 0 ] * ( usum [ 0 ] + un.at(3) ) + c [ 0 ] * ( usum [ 1 ] + un.at(4) ) );
1212 __tmp.
at(2, 6) = coeff * ( b [ 0 ] * ( usum [ 0 ] + un.at(5) ) + c [ 0 ] * ( usum [ 1 ] + un.at(6) ) );
1214 __tmp.
at(3, 1) = coeff * ( b [ 1 ] * ( usum [ 0 ] + un.at(1) ) + c [ 1 ] * ( usum [ 1 ] + un.at(2) ) );
1215 __tmp.
at(3, 3) = coeff * ( b [ 1 ] * ( usum [ 0 ] + un.at(3) ) + c [ 1 ] * ( usum [ 1 ] + un.at(4) ) );
1216 __tmp.
at(3, 5) = coeff * ( b [ 1 ] * ( usum [ 0 ] + un.at(5) ) + c [ 1 ] * ( usum [ 1 ] + un.at(6) ) );
1218 __tmp.
at(4, 2) = coeff * ( b [ 1 ] * ( usum [ 0 ] + un.at(1) ) + c [ 1 ] * ( usum [ 1 ] + un.at(2) ) );
1219 __tmp.
at(4, 4) = coeff * ( b [ 1 ] * ( usum [ 0 ] + un.at(3) ) + c [ 1 ] * ( usum [ 1 ] + un.at(4) ) );
1220 __tmp.
at(4, 6) = coeff * ( b [ 1 ] * ( usum [ 0 ] + un.at(5) ) + c [ 1 ] * ( usum [ 1 ] + un.at(6) ) );
1222 __tmp.
at(5, 1) = coeff * ( b [ 2 ] * ( usum [ 0 ] + un.at(1) ) + c [ 2 ] * ( usum [ 1 ] + un.at(2) ) );
1223 __tmp.
at(5, 3) = coeff * ( b [ 2 ] * ( usum [ 0 ] + un.at(3) ) + c [ 2 ] * ( usum [ 1 ] + un.at(4) ) );
1224 __tmp.
at(5, 5) = coeff * ( b [ 2 ] * ( usum [ 0 ] + un.at(5) ) + c [ 2 ] * ( usum [ 1 ] + un.at(6) ) );
1226 __tmp.
at(6, 2) = coeff * ( b [ 2 ] * ( usum [ 0 ] + un.at(1) ) + c [ 2 ] * ( usum [ 1 ] + un.at(2) ) );
1227 __tmp.
at(6, 4) = coeff * ( b [ 2 ] * ( usum [ 0 ] + un.at(3) ) + c [ 2 ] * ( usum [ 1 ] + un.at(4) ) );
1228 __tmp.
at(6, 6) = coeff * ( b [ 2 ] * ( usum [ 0 ] + un.at(5) ) + c [ 2 ] * ( usum [ 1 ] + un.at(6) ) );
1236 b [ 0 ], c [ 0 ], b [ 1 ], c [ 1 ], b [ 2 ], c [ 2 ]
1239 for ( i = 1; i <= 6; i++ ) {
1240 for ( j = 1; j <= 6; j++ ) {
1241 __tmp.
at(i, j) = coeff * __n [ i - 1 ] * __n [ j - 1 ];
1251 double ar12 =
area / 12.;
1252 for ( i = 1; i <= 2; i++ ) {
1253 for ( k = 1; k <= 3; k++ ) {
1254 for ( j = 1; j <= 2; j++ ) {
1255 for ( m = 1; m <= 3; m++ ) {
1256 w_dof_addr = ( k - 1 ) * 2 + i;
1257 u_dof_addr = ( m - 1 ) * 2 + j;
1261 __tmp.
at(w_dof_addr, u_dof_addr) += rho *
1263 0.0 * d1j * b [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 0 ] + un.at( ( m - 1 ) * 2 + 1 ) ) +
1264 0.0 * d1j * b [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 1 ] + un.at( ( m - 1 ) * 2 + 2 ) ) +
1265 0.0 * d2j * c [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 0 ] + un.at( ( m - 1 ) * 2 + 1 ) ) +
1266 0.0 * d2j * c [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 1 ] + un.at( ( m - 1 ) * 2 + 2 ) ) +
1268 0.0 * d1j * b [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 0 ] + un.at( ( m - 1 ) * 2 + 1 ) ) +
1269 dij * b [ k - 1 ] * b [ m - 1 ] * ar12 * ( usum [ 0 ] * usum [ 0 ] + un.at(1) * un.at(1) + un.at(3) * un.at(3) + un.at(5) * un.at(5) ) +
1270 0.0 * d2j * b [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 0 ] + un.at( ( m - 1 ) * 2 + 1 ) ) +
1271 dij * b [ k - 1 ] * c [ m - 1 ] * ar12 * ( usum [ 0 ] * usum [ 1 ] + un.at(1) * un.at(2) + un.at(3) * un.at(4) + un.at(5) * un.at(6) ) +
1273 0.0 * d1j * c [ k - 1 ] * dudx [ i - 1 ] [ 0 ] * ar12 * ( usum [ 1 ] + un.at( ( m - 1 ) * 2 + 2 ) ) +
1274 dij * c [ k - 1 ] * b [ m - 1 ] * ar12 * ( usum [ 0 ] * usum [ 1 ] + un.at(1) * un.at(2) + un.at(3) * un.at(4) + un.at(5) * un.at(6) ) +
1275 0.0 * d2j * c [ k - 1 ] * dudx [ i - 1 ] [ 1 ] * ar12 * ( usum [ 1 ] + un.at( ( m - 1 ) * 2 + 2 ) ) +
1276 dij * c [ k - 1 ] * c [ m - 1 ] * ar12 * ( usum [ 1 ] * usum [ 1 ] + un.at(2) * un.at(2) + un.at(4) * un.at(4) + un.at(6) * un.at(6) )
1284 double u_1, u_2, vnorm = 0.;
1286 for ( i = 1; i <= 3; i++ ) {
1288 u_1 = u.
at( ( im1 ) * 2 + 1 );
1289 u_2 = u.
at( ( im1 ) * 2 + 2 );
1290 vnorm =
max( vnorm, sqrt(u_1 * u_1 + u_2 * u_2) );
1293 if ( vnorm == 0.0 ) {
1297 this->
t_supg = 1. / sqrt( 1. / ( t_sugn2 * t_sugn2 ) );
1302 __Re = vnorm * vnorm * __c_norm / __k_norm / nu;
1304 __t_p1 = __g_norm / __gamma_norm;
1306 __t_p3 = __t_p1 * __Re;
1307 this->
t_pspg = 1. / sqrt( 1. / ( __t_p1 * __t_p1 ) + 1. / ( __t_p2 * __t_p2 ) + 1. / ( __t_p3 * __t_p3 ) );
1310 __t_s1 = __c_norm / __k_norm;
1312 __t_s3 = __t_s1 * __Re;
1313 this->
t_supg = 1. / sqrt( 1. / ( __t_s1 * __t_s1 ) + 1. / ( __t_s2 * __t_s2 ) + 1. / ( __t_s3 * __t_s3 ) );
1316 this->
t_lsic = __c_norm / __e_norm;
1322 double h_ugn, sum = 0.0, vnorm, t_sugn1, t_sugn2, t_sugn3, u_1, u_2, z, Re_ugn;
1323 double dscale, uscale, lscale, tscale, dt;
1350 for (
int i = 1; i <= 3; i++ ) {
1352 sum += fabs(u.
at( ( im1 ) * 2 + 1 ) * b [ im1 ] / lscale + u.
at(im1 * 2 + 2) * c [ im1 ] / lscale);
1361 for (
int i = 1; i <= 3; i++ ) {
1363 u_1 = u.
at( ( im1 ) * 2 + 1 );
1364 u_2 = u.
at( ( im1 ) * 2 + 2 );
1365 vnorm =
max( vnorm, sqrt(u_1 * u_1 + u_2 * u_2) );
1368 if ( ( vnorm == 0.0 ) || ( sum < vnorm * 1e-10 ) ) {
1372 this->
t_supg = 1. / sqrt( 1. / ( t_sugn2 * t_sugn2 ) );
1376 h_ugn = 2.0 * vnorm / sum;
1379 t_sugn3 = h_ugn * h_ugn / 4.0 / nu;
1381 this->
t_supg = 1. / sqrt( 1. / ( t_sugn1 * t_sugn1 ) + 1. / ( t_sugn2 * t_sugn2 ) + 1. / ( t_sugn3 * t_sugn3 ) );
1384 Re_ugn = vnorm * h_ugn / ( 2. * nu );
1385 z = ( Re_ugn <= 3. ) ? Re_ugn / 3. : 1.0;
1386 this->
t_lsic = h_ugn * vnorm * z / 2.0;
1394 this->
t_supg *= uscale / lscale;
1395 this->
t_pspg *= 1. / ( lscale * dscale );
1396 this->
t_lsic *= ( dscale * uscale ) / ( lscale * lscale );
1498 answer.
at(1) = (
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5) );
1499 answer.
at(2) = (
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6) );
1500 answer.
at(3) = (
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6) +
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5) );
1506 Node *node1, *node2, *node3;
1507 double x1, x2, x3, y1, y2, y3;
1522 this->
area = 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 );
1525 OOFEM_ERROR(
"Area is negative, check element numbering orientation");
1528 b [ 0 ] = ( y2 - y3 ) / ( 2. *
area );
1529 c [ 0 ] = ( x3 - x2 ) / ( 2. *
area );
1530 b [ 1 ] = ( y3 - y1 ) / ( 2. *
area );
1531 c [ 1 ] = ( x1 - x3 ) / ( 2. *
area );
1532 b [ 2 ] = ( y1 - y2 ) / ( 2. *
area );
1533 c [ 2 ] = ( x2 - x1 ) / ( 2. *
area );
1551 answer.
at(3) = 1.0 - l1 - l2;
1600 if ( answer > 1.0 ) {
1619 for (
int i = 1; i <= 3; i++ ) {
1645 double nx = normal.
at(1), ny = normal.
at(2), x, y;
1651 for (
int i = 1; i <= 3; i++ ) {
1660 if ( ( nx * x + ny * y + p ) >= 0. ) {
1661 nodeIn [ i - 1 ] =
true;
1663 nodeIn [ i - 1 ] =
false;
1667 if ( nodeIn [ 0 ] && nodeIn [ 1 ] && nodeIn [ 2 ] ) {
1668 for (
int i = 1; i <= 3; i++ ) {
1682 }
else if ( !( nodeIn [ 0 ] || nodeIn [ 1 ] || nodeIn [ 2 ] ) ) {
1685 for (
int i = 1; i <= 3; i++ ) {
1686 next = i < 3 ? i + 1 : 1;
1687 if ( nodeIn [ i - 1 ] ) {
1693 this->
giveNode(i)->giveCoordinate(2) );
1699 if ( nodeIn [ next - 1 ] ^ nodeIn [ i - 1 ] ) {
1713 double s, sd = nx * tx + ny * ty;
1714 if ( fabs(sd) > 1.e-6 ) {
1715 s = ( -p - ( nx * x + ny * y ) ) / sd;
1720 if ( nodeIn [ i - 1 ] ) {
1755 g.
clip(clip, me, matvolpoly);
1757 EASValsSetColor(
gc [ 0 ].getActiveCrackColor() );
1763 return volume /
area;
1774 for (
int i = 1; i <= 3; i++ ) {
1792 double x1, x2, x3, y1, y2, y3;
1801 return 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 );
1811 double determinant = fabs( 4 *
area *
area * (
c [ 1 ] *
b [ 0 ] -
c [ 0 ] *
b [ 1 ] ) );
1825 double vn1 = sqrt( u.
at(1) * u.
at(1) + u.
at(2) * u.
at(2) );
1826 double vn2 = sqrt( u.
at(3) * u.
at(3) + u.
at(4) * u.
at(4) );
1827 double vn3 = sqrt( u.
at(5) * u.
at(5) + u.
at(6) * u.
at(6) );
1828 double veln =
max( vn1,
max(vn2, vn3) );
1830 double l1 = 1.0 / ( sqrt(
b [ 0 ] *
b [ 0 ] +
c [ 0 ] *
c [ 0 ]) );
1831 double l2 = 1.0 / ( sqrt(
b [ 1 ] *
b [ 1 ] + c [ 1 ] * c [ 1 ]) );
1832 double l3 = 1.0 / ( sqrt(
b [ 2 ] *
b [ 2 ] + c [ 2 ] * c [ 2 ]) );
1834 double ln =
min( l1,
min(l2, l3) );
1836 if ( veln != 0.0 ) {
1839 return 0.5 * ln * ln * Re;
1852 for (
int i = 1; i <= 3; i++ ) {
1857 for (
int i = 1; i <= 3; i++ ) {
1863 center.
times(1. / 3.);
1887 for (
int i = 1; i <= dofId.
giveSize(); i++ ) {
1890 for (
int j = 1; j <= 3; j++ ) {
1891 sum += lc.
at(j) * elemvector.
at(es * ( j - 1 ) + indx);
1903 OOFEM_ERROR(
"target point not in receiver volume");
1919 if ( type == IST_VOFFraction ) {
1925 answer.
at(1) = val.
at(1);
1985 fprintf(file,
"\telement_status { VOF %e, density %e }\n\n", this->
giveVolumeFraction(), rho);
2040 for (
int i = 1; i <= 3; i++ ) {
2044 double fix =
b [ 0 ] * fi.at(1) +
b [ 1 ] * fi.at(2) +
b [ 2 ] * fi.at(3);
2045 double fiy =
c [ 0 ] * fi.at(1) +
c [ 1 ] * fi.at(2) +
c [ 2 ] * fi.at(3);
2046 double norm = sqrt(fix * fix + fiy * fiy);
2048 answer = ( 1. / 3. ) * ( fix * ( un.
at(1) + un.
at(3) + un.
at(5) ) + fiy * ( un.
at(2) + un.
at(4) + un.
at(6) ) ) /
norm;
2057 double fi, answer, eps = 0.0;
2060 for (
int i = 1; i <= 3; i++ ) {
2062 s.
at(i) = fi / sqrt(fi * fi + eps * eps);
2065 answer = ( 1. / 3. ) * ( s.
at(1) + s.
at(2) + s.
at(3) );
2070 int neg = 0, pos = 0, zero = 0, si = 0;
2071 double x1, x2, x3, y1, y2, y3;
2074 for (
int i = 1; i <= 3; i++ ) {
2079 for (
int i = 1; i <= 3; i++ ) {
2080 if ( fi.
at(i) >= 0. ) {
2084 if ( fi.
at(i) < 0.0 ) {
2088 if ( fi.
at(i) == 0. ) {
2095 }
else if ( neg == 0 ) {
2097 }
else if ( pos == 0 ) {
2102 for (
int i = 1; i <= 3; i++ ) {
2103 if ( ( pos > neg ) && ( fi.
at(i) < 0.0 ) ) {
2108 if ( ( pos < neg ) && ( fi.
at(i) >= 0.0 ) ) {
2119 int prev_node = ( si > 1 ) ? si - 1 : 3;
2120 int next_node = ( si < 3 ) ? si + 1 : 1;
2123 double t = fi.
at(si) / ( fi.
at(si) - fi.
at(next_node) );
2128 t = fi.
at(si) / ( fi.
at(si) - fi.
at(prev_node) );
2133 double __area = fabs( 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 ) );
2137 return ( (
area - __area ) - __area ) /
area;
2140 return ( __area - (
area - __area ) ) /
area;
2157 for (
int i = 1; i <= 3; i++ ) {
2158 answer.
at(i, 1) =
b [ i - 1 ];
2159 answer.
at(i, 2) =
c [ i - 1 ];
2167 int neg = 0, pos = 0, zero = 0, si = 0;
2168 double x1, x2, x3, y1, y2, y3;
2171 for (
int i = 1; i <= 3; i++ ) {
2172 if ( fi.
at(i) >= 0. ) {
2176 if ( fi.
at(i) < 0.0 ) {
2180 if ( fi.
at(i) == 0. ) {
2188 }
else if ( pos == 0 ) {
2191 }
else if ( zero == 3 ) {
2198 for (
int i = 1; i <= 3; i++ ) {
2199 if ( ( pos > neg ) && ( fi.
at(i) < 0.0 ) ) {
2204 if ( ( pos < neg ) && ( fi.
at(i) >= 0.0 ) ) {
2210 if ( si && ( ( pos + neg ) == 3 ) ) {
2215 int prev_node = ( si > 1 ) ? si - 1 : 3;
2216 int next_node = ( si < 3 ) ? si + 1 : 1;
2218 double t = fi.
at(si) / ( fi.
at(si) - fi.
at(next_node) );
2222 t = fi.
at(si) / ( fi.
at(si) - fi.
at(prev_node) );
2227 double __area = 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 );
2228 if ( fabs(__area) /
area > 1.00001 ) {
2233 if ( fabs(__area) >
area ) {
2239 answer.
at(2) = fabs(__area) /
area;
2240 answer.
at(1) = 1.0 - answer.
at(2);
2243 answer.
at(1) = fabs(__area) /
area;
2244 answer.
at(2) = 1.0 - answer.
at(1);
2256 map = {1, 2, 4, 5, 7, 8};
2299 EASValsSetEdgeFlag(
true);
2311 go = CreateTriangle3D(p);
2312 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
2313 EGAttachObject(go, ( EObjectP )
this);
2314 EMAddGraphicsToModel(ESIModel(), go);
2319 int i, indx, result = 0;
2353 if ( result != 3 ) {
2359 s [ 0 ] = v1.
at(indx);
2360 s [ 1 ] = v2.
at(indx);
2361 s [ 2 ] = v3.
at(indx);
2366 for ( i = 0; i < 3; i++ ) {
2374 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
2375 EGWithMaskChangeAttributes(LAYER_MASK, tr);
2376 EMAddGraphicsToModel(ESIModel(), tr);
2380 for ( i = 0; i < 3; i++ ) {
2383 p [ i ].z = s [ i ] * landScale;
2389 EASValsSetFillStyle(FILL_SOLID);
2390 tr = CreateTriangle3D(p);
2391 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
2394 EASValsSetFillStyle(FILL_SOLID);
2395 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
2396 EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
2399 EMAddGraphicsToModel(ESIModel(), tr);
CrossSection * giveCrossSection()
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The element interface required by NodalAvergagingRecoveryModel.
virtual void computeAccelerationTerm_MB(FloatMatrix &answer, TimeStep *tStep)
Computes acceleration terms (generalized mass matrix with stabilization terms) for momentum balance e...
void computeNMtrx(FloatArray &answer, GaussPoint *gp)
virtual void computeDiffusionTerm_MB(FloatArray &answer, TimeStep *tStep)
Computes diffusion terms for momentum balance equations(s).
IntArray dofManArray
Array containing dofmanager numbers.
virtual int EIPrimaryFieldI_evaluateFieldVectorAt(FloatArray &answer, PrimaryField &pf, const FloatArray &coords, IntArray &dofId, ValueModeType mode, TimeStep *tStep)
Evaluates the value of field at given point of interest (should be located inside receiver's volume) ...
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
The element interface required by ZZNodalRecoveryModel.
contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores context of receiver into given stream.
void giveUpdatedCoordinate(FloatArray &answer, int num)
Returns updated nodal positions.
EPixel getStandardSparseProfileColor()
virtual void computeAdvectionTerm_MB(FloatArray &answer, TimeStep *tStep)
Computes nonlinear advection terms for momentum balance equations(s).
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Element interface for LEPlic class representing Lagrangian-Eulerian (moving) material interface...
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
virtual void computeHomogenizedReinforceTerm_MC(FloatMatrix &answer, Load *load, TimeStep *tStep)
ScalarAlgorithmType getScalarAlgo()
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
virtual void computeAdvectionTerm_MC(FloatArray &answer, TimeStep *tStep)
Computes advection terms for mass conservation equation.
virtual void computeLinearAdvectionTerm_MC(FloatMatrix &answer, TimeStep *tStep)
Computes the linear advection term for mass conservation equation.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double computeVolume() const
The element interface required by ZZNodalRecoveryModel.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
virtual void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep)
Computes the contribution of the given body load (volumetric).
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
#define _IFT_Tr1SUPG_pvof
bcGeomType
Type representing the geometric character of loading.
double & at(int i)
Coefficient access function.
double giveLevelSetDofManValue(int i)
Returns level set value in specific node.
int max(int i, int j)
Returns bigger value form two given decimals.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1) ...
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
#define OOFEG_RAW_GEOMETRY_LAYER
Element interface for LevelSetPCS class representing level-set like material interface.
virtual int checkConsistency()
Used to check consistency and initialize some element geometry data (area,b,c).
virtual double truncateMatVolume(const Polygon &matvolpoly, double &volume)
Truncates given material polygon to receiver.
void setPermanentVolumeFraction(double v)
void clear()
Clears receiver (zero size).
Base class for fluid problems.
EPixel getElementEdgeColor()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void formMyVolumePoly(Polygon &myPoly, LEPlic *mat_interface, bool updFlag)
Assembles receiver volume.
virtual MaterialInterface * giveMaterialInterface(int n)
Returns material interface representation for given domain.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
double giveUpdatedYCoordinate(int num)
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual void giveLocalPressureDofMap(IntArray &map)
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
Element * giveElement()
Returns corresponding element to receiver.
void negated()
Changes sign of receiver values.
int giveNumber()
Returns domain number.
virtual double giveProperty(int aProperty, TimeStep *tStep, const std::map< std::string, FunctionArgument > &valDict)
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes boundary condition value - its components values at given time.
General stabilized SUPG/PSPG element for CFD analysis.
virtual double giveCoordinate(int i)
Class implementing an array of integers.
virtual void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)
Computes the element value in given node.
int & at(int i)
Coefficient access function.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void computeHomogenizedReinforceTerm_MB(FloatMatrix &answer, Load *load, TimeStep *tStep)
virtual void computePressureTerm_MC(FloatMatrix &answer, TimeStep *tStep)
Computes pressure terms for mass conservation equation.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual Interface * giveInterface(InterfaceType)
Interface requesting service.
double giveTimeIncrement()
Returns solution step associated time increment.
virtual void giveElementCenter(LEPlic *mat_interface, FloatArray ¢er, bool updFlag)
Computes the receiver center (in updated Lagrangian configuration).
EPixel getDeformedElementColor()
void updateYourself(TimeStep *tStep)
Class representing a general abstraction for finite element interpolation class.
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
virtual void computeVectorOfPressures(ValueModeType mode, TimeStep *tStep, FloatArray &pressures)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
FloatArray * givePermeability()
InternalStateType giveIntVarType()
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
double giveNaturalCoordinate(int i) const
Returns i-th natural element coordinate of receiver.
virtual void giveElementMaterialMixture(FloatArray &answer, int ielem)=0
Returns volumetric (or other based measure) of relative material contents in given element...
virtual void computeBCRhsTerm_MB(FloatArray &answer, TimeStep *tStep)
Computes Rhs terms due to boundary conditions.
virtual double computeLEPLICVolumeFraction(const FloatArray &n, const double p, LEPlic *matInterface, bool updFlag)
Computes corresponding volume fraction to given interface position.
virtual void updateStabilizationCoeffs(TimeStep *tStep)
Updates the stabilization coefficients used for CBS and SUPG algorithms.
Abstract base class representing a boundary load (force, momentum, ...) that acts directly on a bound...
virtual void computeVectorOfVelocities(ValueModeType mode, TimeStep *tStep, FloatArray &velocities)
virtual void computeAccelerationTerm_MC(FloatMatrix &answer, TimeStep *tStep)
Computes acceleration terms for mass conservation equation.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual double LS_PCS_computeF(LevelSetPCS *ls, TimeStep *tStep)
Evaluates F in level set equation of the form where for interface position driven by flow with speed...
virtual double giveVariableScale(VarScaleType varId)
Returns the scale factor for given variable type.
virtual void initGeometry()
#define OOFEG_RAW_GEOMETRY_WIDTH
virtual double giveWeight()
Returns integration weight of receiver.
virtual void computeSlipWithFrictionBCTerm_MB(FloatMatrix &answer, Load *load, int side, TimeStep *tStep)
Computes Lhs term due to applied slip with friction bc.
void clip(Polygon &result, const Polygon &a, const Polygon &b)
Abstract base class representing (moving) material interfaces.
void times(double f)
Multiplies receiver by factor f.
virtual void giveLocalVelocityDofMap(IntArray &map)
virtual void formMaterialVolumePoly(Polygon &matvolpoly, LEPlic *matInterface, const FloatArray &normal, const double p, bool updFlag)
Assembles the true element material polygon (takes receiver vof into accout).
Neumann type (prescribed flux).
virtual void LS_PCS_computeVOFFractions(FloatArray &answer, FloatArray &fi)
Returns VOF fractions for each material on element according to nodal values of level set function (p...
double t_supg
Stabilization coefficients, updated for each solution step in updateStabilizationCoeffs() ...
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
IntArray bodyLoadArray
Array containing indexes of loads (body loads and boundary loads are kept separately), that apply on receiver.
virtual double giveCharacteristicValue(CharType type, TimeStep *tStep)
Computes characteristic value of receiver of requested type in given time step.
Class representing the special graph constructed from two polygons that is used to perform boolean op...
virtual void giveElementDofIDMask(IntArray &answer) const
Returns element dof mask for node.
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
This class implements an influence of reinforcement into flow problems, especially concrete (binhamfl...
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual bcType giveType() const
Returns receiver load type.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
virtual void computeBCRhsTerm_MC(FloatArray &answer, TimeStep *tStep)
Computes Rhs terms due to boundary conditions.
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
virtual void computeAdvectionDerivativeTerm_MC(FloatMatrix &answer, TimeStep *tStep)
Computes the derivative of advection terms for mass conservation equation with respect to nodal veloc...
InternalStateMode giveIntVarMode()
virtual double computeCriticalTimeStep(TimeStep *tStep)
Computes the critical time increment.
Abstract base class representing Lagrangian-Eulerian (moving) material interfaces.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
virtual void LS_PCS_computedN(FloatMatrix &answer)
Returns gradient of shape functions.
Class representing vector of real numbers.
virtual void computeDeviatoricStrain(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Class representing 2D polygon.
Implementation of matrix containing floating point numbers.
TR1_2D_SUPG(int n, Domain *d)
double computeFrobeniusNorm() const
Computes the Frobenius norm of the receiver.
virtual void computeAdvectionDerivativeTerm_MB(FloatMatrix &answer, TimeStep *tStep)
Computes the derivative of advection terms for momentum balance equations(s) with respect to nodal ve...
IRResultType
Type defining the return values of InputRecord reading operations.
virtual double give(CrossSectionProperty a, GaussPoint *gp)
Returns the value of cross section property at given point.
void setCoords(double x, double y)
Abstract base class representing Level Set representation of material interfaces. ...
double giveVolumeFraction()
double norm(const FloatArray &x)
double computeNorm() const
Computes the norm (or length) of the vector.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
double giveUpdatedXCoordinate(int num)
void zero()
Zeroes all coefficients of receiver.
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
void times(double s)
Multiplies receiver with scalar.
virtual double LS_PCS_computeS(LevelSetPCS *ls, TimeStep *tStep)
Evaluates S in level set equation of the form where .
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
The spatial localizer element interface associated to spatial localizer.
virtual FEInterpolation * giveInterpolation() const
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores context of receiver from given stream.
Class representing vertex.
double vof
Volume fraction of reference fluid in element.
virtual double computeMyVolume(LEPlic *matInterface, bool updFlag)
Computes the volume of receiver.
void zero()
Zeroes all coefficient of receiver.
virtual SPRPatchType SPRNodalRecoveryMI_givePatchType()
virtual void computeDiffusionDerivativeTerm_MB(FloatMatrix &answer, MatResponseMode mode, TimeStep *tStep)
Computes the derivative of diffusion terms for momentum balance equations(s) with respect to nodal ve...
InterfaceType
Enumerative type, used to identify interface type.
int min(int i, int j)
Returns smaller value from two given decimals.
void updateFringeTableMinMax(double *s, int size)
virtual void computeLSICStabilizationTerm_MB(FloatMatrix &answer, TimeStep *tStep)
Computes SLIC stabilization term for momentum balance equation(s).
#define OOFEG_DEBUG_LAYER
Load is base abstract class for all loads.
double p
Line constant of line segment representing interface.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
GraphicObj * draw(oofegGraphicContext &, bool filled, int layer=OOFEG_DEBUG_LAYER)
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual bcValType giveBCValType() const
Returns receiver load type.
Class implementing node in finite element mesh.
virtual int checkConsistency()
Performs consistency check.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
virtual void computePressureTerm_MB(FloatMatrix &answer, TimeStep *tStep)
Computes pressure terms for momentum balance equations(s).
Load * giveLoad(int n)
Service for accessing particular domain load.
#define OOFEG_VARPLOT_PATTERN_LAYER
double givePorosity()
Accessor.
Class representing integration point in finite element program.
IntArray boundaryLoadArray
FloatArray normal
Interface segment normal.
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
Class representing solution step.
virtual void formVolumeInterfacePoly(Polygon &matvolpoly, LEPlic *matInterface, const FloatArray &normal, const double p, bool updFlag)
Assembles receiver material polygon based solely on given interface line.
int numberOfDofMans
Number of dofmanagers.
virtual void computePenetrationWithResistanceBCTerm_MB(FloatMatrix &answer, Load *load, int side, TimeStep *tStep)
Computes Lhs contribution due to applied Penetration bc.
InternalStateMode
Determines the mode of internal variable.
void add(const FloatArray &src)
Adds array src to receiver.
virtual void computeOutFlowBCTerm_MB(FloatMatrix &answer, int side, TimeStep *tStep)
Computes Lhs contribution due to outflow BC.
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
virtual double computeCriticalLEPlicTimeStep(TimeStep *tStep)
Computes critical time step.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.