339
340
341
344 use element_mod , only : nixr
345
346
347
348#include "implicit_f.inc"
349
350
351
352#include "param_c.inc"
353#include "com04_c.inc"
354
355
356
357 INTEGER IOUT,IXR(NIXR,*),IEL,JTYP,IXR_KJ(5,*)
359 INTEGER ID
360 INTEGER, INTENT(INOUT) :: IDSK1,IDSK2
361 my_real,
INTENT(INOUT) :: vect1(lskew),vect2(lskew)
362 my_real,
INTENT(INOUT) :: theta0(3)
363 my_real,
INTENT(INOUT) :: stop_angl_min(3),stop_angl_max(3)
364 CHARACTER(LEN=NCHARTITLE) :: TITR
365
366
367
368 INTEGER I,J,K,NNOD,N1,N2,N3,N4,IERR1,IELUSR,NN(
369INTEGER NUMEL_KJ,ID_KJ,NNOD2,NNOD_REQ(9),NB_ROT
370 my_real pp1,pp2,pp3,pp4,len,scal,exmax
371 my_real vect1_upt(lskew),vect2_upt(lskew),q(lskew),nr,t(3),
372 . cosk,sink,si2,e,ksi,umi,err,scal_sign
373 DATA umi/-1.0/
374
375
376 ierr1 = 0
377 nnod = 0
378 nn = 0
379 n1 = 0
380 n2 = 0
381 n3 = 0
382 n4 = 0
383 numel_kj = ixr_kj(1,numelr+1)
384 ielusr = ixr(nixr,iel)
385
386 nnod_req(1) = 2
387 nnod_req(2) = 3
388 nnod_req(3) = 3
389 nnod_req(4) = 3
390 nnod_req(5) = 4
391 nnod_req(6) = 3
392 nnod_req(7) = 3
393 nnod_req(8) = 2
394 nnod_req(9) = 4
395
396 DO j=1,3
397 IF (ixr(1+j,iel)/=0) THEN
398 nnod = nnod + 1
399 nn(nnod) = ixr(1+j,iel)
400 ENDIF
401 END DO
402
403 DO j=1,numel_kj
404 IF (ixr_kj(4,j)==ielusr) id_kj = j
405 END DO
406
407 IF (id_kj>0) THEN
408 DO j=1,3
409 IF (ixr_kj(j,id_kj)/=0) THEN
410 nnod = nnod + 1
411 nn(nnod) = ixr_kj(j,id_kj)
412 ENDIF
413 END DO
414 ENDIF
415
416 nnod2 = nnod
417
418 len = sqrt((x(1,nn(1))-x(1,nn(2)))**2+(x(2,nn(1))-x(2,nn(2)))**2
419 . +(x(3,nn(1))-x
420 IF ((nnod==2).AND.(len>em10)) nnod2=3
421
422 IF ((nnod2<nnod_req(jtyp)).AND.(idsk1 == 0)) THEN
423
424
425
427 . msgtype=msgerror,
428 . anmode=aninfo_blind_2
430 . c1=titr,
431 . i2=ielusr,
432 . i3=jtyp,
433 . i4=nnod_req(jtyp)-nnod2)
434 ELSEIF ((nnod==2).AND.((jtyp==1).OR.(jtyp==8)).AND.(idsk1==0)) THEN
435
436
437
438 ex(1)= one
439 ex(2)= zero
440 ex(3)= zero
441 ex(4)= zero
442 ex(5)= one
443 ex(6)= zero
444 ex(7)= zero
445 ex(8)= zero
446 ex(9)= one
447 pp1 = one
448 pp2 = one
449 pp3 = one
450 ELSEIF ((nnod==2).AND.(len>em10)) THEN
451
452
453
454 n1 = nn(1)
455 n2 = nn(2)
456
457 ex(1)=x(1,n2)-x(1,n1)
458 ex(2)=x(2,n2)-x(2,n1)
459 ex(3)=x(3,n2)-x(3,n1)
460 pp1=sqrt(ex(1)*ex(1)+ex(2)*ex(2)+ex(3)*ex(3))
461 exmax =zero
462 DO j=1,3
463 IF (abs(ex(j))>= exmax) THEN
464 exmax = abs(ex(j))
465 hh = j
466 ENDIF
467 END DO
468
469 IF (hh<3) THEN
470 ex(4)= -ex(2)
471 ex(5)= ex(1)
472 ex(6)= zero
473 ELSE
474 ex(4)= zero
475 ex(5)= ex(3)
476 ex(6)= -ex(2)
477 ENDIF
478 pp2=sqrt(ex(4)*ex(4)+ex(5)*ex(5)+ex(6)*ex(6))
479
480 ex(7)=ex(2)*ex(6)-ex(3)*ex(5)
481 ex(8)=ex(3)*ex(4)-ex(1)*ex(6)
482 ex(9)=ex(1)*ex(5)-ex(2)*ex(4)
483 pp3=sqrt(ex(7)*ex(7)+ex(8)*ex(8)+ex(9)*ex(9))
484 ELSEIF (nnod==3) THEN
485
486
487
488 n1 = nn(1)
489 n2 = nn(3)
490
491 ex(1)=x(1,n2)-x(1,n1)
492 ex(2)=x(2,n2)-x(2,n1)
493 ex(3)=x(3,n2)-x(3,n1)
494 pp1=sqrt(ex(1)*ex(1)+ex(2)*ex(2)+ex(3)*ex(3))
495 exmax =zero
496 DO j=1,3
497 IF (abs(ex(j)) >= exmax) THEN
498 exmax = abs(ex(j))
499 hh = j
500 ENDIF
501 END DO
502
503 IF (hh<3) THEN
504 ex(4)= -ex(2)
505 ex(5)= ex(1)
506 ex(6)= zero
507 ELSE
508 ex(4)= zero
509 ex(5)= ex(3)
510 ex(6)= -ex(2)
511 ENDIF
512 pp2=sqrt(ex(4)*ex(4)+ex(5)*ex(5)+ex(6)*ex(6))
513
514 ex(7)=ex(2)*ex(6)-ex(3)*ex(5)
515 ex(8)=ex(3)*ex(4)-ex(1)*ex(6)
516 ex(9)=ex(1)*ex(5)-ex(2)*ex(4)
517 pp3=sqrt(ex(7)*ex(7)+ex(8)*ex(8)+ex(9)*ex(9))
518
519 IF (pp1<=em10) THEN
521 . msgtype=msgerror,
522 . anmode=aninfo_blind_2,
524 . c1=titr,
525 . i2=ielusr)
526 ENDIF
527 ELSEIF ((nnod>=4).AND.(jtyp/=5)) THEN
528
529
530
531 n1 = nn(1)
532 n2 = nn(3)
533 n3 = nn(4)
534
535 ex(1)=x(1,n2)-x(1,n1)
536 ex(2)=x(2,n2)-x(2,n1)
537 ex(3)=x(3,n2)-x(3,n1)
538 pp1=sqrt(ex(1)*ex(1)+ex(2)*ex(2)+ex(3)*ex(3))
539
540 ex(4)=x(1,n3)-x(1,n1)
541 ex(5)=x(2,n3)-x(2,n1)
542 ex(6)=x(3,n3)-x(3,n1)
543 pp2=sqrt(ex(4)*ex(4)+ex(5)*ex(5)+ex(6)*ex(6))
544
545 ex(7)=ex(2)*ex(6)-ex(3)*ex(5)
546 ex(8)=ex(3)*ex(4)-ex(1)*ex(6)
547 ex(9)=ex(1)*ex(5)-ex(2)*ex(4)
548 pp3=sqrt(ex(7)*ex(7)+ex(8)*ex(8)+ex(9)*ex(9))
549
550 scal =abs(ex(1)*ex(4)+ex(2)*ex(5)+ex(3)*ex(6))/(pp1*pp2)
551 IF (abs(scal)>=0.98) THEN
553 . msgtype=msgerror,
554 . anmode=aninfo_blind_2,
556 . c1=titr,
557 . i2=ielusr)
558 ELSE
559 ex(4)=ex(8)*ex(3)-ex(9)*ex(2)
560 ex(5)=ex(9)*ex(1)-ex(7)*ex(3)
561 ex(6)=ex(7)*ex(2)-ex(8)*ex(1)
562 pp2=sqrt(ex(4)*ex(4)+ex(5)*ex(5)+ex(6)*ex(6))
563 ENDIF
564
565 IF ((n4==n1).OR.(n4==n2).OR.(n4==n3)) THEN
567 . msgtype=msgerror,
568 . anmode=aninfo_blind_2,
569 . i1=ielusr)
570 ENDIF
571
572 pp4 = sqrt((x(1,n3)-x(1,n2))**2+(x(2,n3)-x(2,n2))**2
573 . +(x(3,n3)-x(3,n2))**2)
574 IF ((pp1<=em10).OR.(pp2<=em10).OR.(pp4<=em10)) THEN
576 . msgtype=msgerror,
577 . anmode=aninfo_blind_2,
579 . c1=titr,
580 . i2=ielusr)
581 ENDIF
582 ELSEIF ((nnod>=4).AND.(jtyp==5)) THEN
583
584
585
586 n1 = nn(1)
587 n2 = nn(3)
588 n3 = nn(4)
589
590 ex(4)=x(1,n2)-x(1,n1)
591 ex(5)=x(2,n2)-x(2,n1)
592 ex(6)=x(3,n2)-x(3,n1)
593 pp2=sqrt(ex(4)*ex(4)+ex(5)*ex(5)+ex(6)*ex(6))
594
595 ex(7)=x(1,n3)-x(1,n1)
596 ex(8)=x(2,n3)-x(2,n1)
597 ex(9)=x(3,n3)-x(3,n1)
598 pp3=sqrt(ex(7)*ex(7)+ex(8)*ex(8)+ex(9)*ex(9))
599
600 ex(1)=ex(5)*ex(9)-ex(6)*ex(8)
601 ex(2)=ex(6)*ex(7)-ex(4)*ex(9)
602 ex(3)=ex(4)*ex(8)-ex(5)*ex(7)
603 pp1=sqrt(ex(1)*ex(1)+ex(2)*ex(2)+ex(3)*ex(3))
604
605 scal =abs(ex(7)*ex(4)+ex(8)*ex(5)+ex(9)*ex(6))/(pp1+pp2)
606 IF (abs(scal)>=0.98) THEN
608 . msgtype=msgerror,
609 . anmode=aninfo_blind_2,
611 . c1=titr,
612 . i2=ielusr)
613 ELSEIF (scal>=1e-4) THEN
614
616 . msgtype=msgwarning,
617 . anmode=aninfo_blind_2,
619 . c1=titr,
620 . i2=ielusr)
621
622 ex(7)=ex(2)*ex(6)-ex(3)*ex(5)
623 ex(8)=ex(3)*ex(4)-ex(1)*ex(6)
624 ex(9)=ex(1)*ex(5)-ex(2)*ex(4)
625 pp3=sqrt(ex(7)*ex(7)+ex(8)*ex(8)+ex(9)*ex(9))
626 ENDIF
627
628 pp4 = sqrt((x(1,n3)-x(1,n2))**2+(x(2,n3)-x(2,n2))**2
629 . +(x(3,n3)-x(3,n2))**2)
630 IF ((pp1<=em10).OR.(pp2<=em10).OR.(pp4<=em10)) THEN
632 . msgtype=msgerror,
633 . anmode=aninfo_blind_2,
635 . c1=titr,
636 . i2=ielusr)
637 ENDIF
638 ELSEIF (idsk1 > 0) THEN
639
640
641
642 ex(1:9)= vect1(1:9)
643 pp1 = one
644 pp2 = one
645 pp3 = one
646 ELSE
648 . msgtype=msgerror,
649 . anmode=aninfo_blind_2,
651 . c1=titr,
652 . i2=ielusr)
653 ENDIF
654
655
656
657 ex(1)=ex(1)/pp1
658 ex(2)=ex(2)/pp1
659 ex(3)=ex(3)/pp1
660 ex(4)=ex(4)/pp2
661 ex(5)=ex(5)/pp2
662 ex(6)=ex(6)/pp2
663 ex(7)=ex(7)/pp3
664 ex(8)=ex(8)/pp3
665 ex(9)=ex(9)/pp3
666
667
668
669
670 IF ((idsk1 > 0).AND.(idsk2 > 2)) THEN
671
672 nb_rot = 3
673 IF ((jtyp==2).OR.(jtyp==3).OR.(jtyp==4)) THEN
674
675 nb_rot = 1
676
677 scal_sign = sign(one,ex(1)*vect1(1)+ex(2)*vect1(2)+ex(3)*vect1(3))
678 scal = abs(ex(1)*vect1(1)+ex(2)*vect1(2)+ex(3)*vect1(3))
679 IF (scal.LT.0.98) THEN
680
682 . msgtype=msgerror,
683 . anmode=aninfo_blind_1,
685 . c1=titr,
686 . i2=ielusr,
687 . c2='SKEW1')
688 ELSE
689 IF ((one-scal).GT.em05) THEN
690
692 . msgtype=msgwarning,
693 . anmode=aninfo_blind_2,
695 . c1=titr,
696 . i2=ielusr,
697 . c2='SKEW1')
698 ENDIF
699
700 vect1_upt(1:3) = scal_sign*ex(1:3)
701
702 vect1_upt(7)=vect1_upt(2)*vect1(6)-vect1_upt(3)*vect1(5)
703 vect1_upt(8)=vect1_upt(3)*vect1(4)-vect1_upt(1)*vect1(6)
704 vect1_upt(9)=vect1_upt(1)*vect1(5)-vect1_upt(2)*vect1(4)
705
706 vect1_upt(4)=vect1_upt(8)*vect1_upt(3)-vect1_upt(9)*vect1_upt(2)
707 vect1_upt(5)=vect1_upt(9)*vect1_upt(1)-vect1_upt(7)*vect1_upt(3)
708 vect1_upt(6)=vect1_upt(7)*vect1_upt(2)-vect1_upt(8)*vect1_upt(1)
709 vect1(1:9) = vect1_upt(1:9)
710 ENDIF
711 scal_sign = sign(one,ex(1)*vect2(1)+ex(2)*vect2(2)+ex(3)*vect2(3))
712 scal = abs(ex(1)*vect2(1)+ex(2)*vect2(2)+ex(3)*vect2(3))
713 IF (scal.LT.0.98) THEN
714
716 . msgtype=msgerror,
717 . anmode=aninfo_blind_1,
719 . c1=titr,
720 . i2=ielusr,
721 . c2='SKEW2')
722 ELSE
723 IF ((one-scal).GT.em05) THEN
724
726 . msgtype=msgwarning,
727 . anmode=aninfo_blind_2,
729 . c1=titr,
730 . i2=ielusr,
731 . c2='SKEW2')
732 ENDIF
733
734 vect2_upt(1:3) = scal_sign*ex(1:3)
735
736 vect2_upt(7)=vect2_upt(2)*vect2(6)-vect2_upt(3)*vect2(5)
737 vect2_upt(8)=vect2_upt(3)*vect2(4)-vect2_upt(1)*vect2(6)
738 vect2_upt(9)=vect2_upt(1)*vect2(5)-vect2_upt(2)*vect2(4)
739
740 vect2_upt(4)=vect2_upt(8)*vect2_upt(3)-vect2_upt(9)*vect2_upt(2)
741 vect2_upt(5)=vect2_upt(9)*vect2_upt(1)-vect2_upt(7)*vect2_upt(3)
742 vect2_upt(6)=vect2_upt(7)*vect2_upt(2)-vect2_upt(8)*vect2_upt(1)
743 vect2(1:9) = vect2_upt(1:9)
744 ENDIF
745 ENDIF
746
747
749
750 e = q(1)+q(5)+q(9)
751 cosk = half * (e - one)
753 cosk =
max(cosk,-one)
754 ksi = acos(cosk)
755 sink = sin(ksi)
756 IF(sink==zero) THEN
757 si2 = zero
758 ELSE
759 si2 = half / sink
760 ENDIF
761
762 t(1) = (q(6) - q(8)) * si2
763 t(2) = (q(7) - q(3)) * si2
764 t(3) = (q(2) - q(4)) * si2
765 nr = sqrt(t(1)*t(1)+t(2)*t(2)+t(3)*t(3))
766 IF (nr/=zero) nr = one/nr
767 t(1) = t(1)*nr
768 t(2) = t(2)*nr
769 t(3) = t(3)*nr
770
771
772 theta0(1) = t(1)*ksi
773 theta0(2) = t(2)*ksi
774 theta0(3) = t(3)*ksi
775
776
777 DO i=1,nb_rot
778 IF (theta0(i)<0) THEN
779 IF ((theta0(i)<stop_angl_min(i)).AND.(stop_angl_min(i)/=zero)) THEN
781 . msgtype=msgerror,
782 . anmode=aninfo_blind_1,
784 . c1=titr,
785 . r1=theta0(i),
786 . r2=stop_angl_min(i))
787 ENDIF
788 ELSE
789 IF ((theta0(i)>stop_angl_max(i)).AND.(stop_angl_max(i)/=zero)) THEN
791 . msgtype=msgerror,
792 . anmode=aninfo_blind_1,
794 . c1=titr,
795 . r1=theta0(i),
796 . r2=stop_angl_max(i))
797 ENDIF
798 ENDIF
799 ENDDO
800
801 ENDIF
802
804
805 RETURN
integer, parameter nchartitle
subroutine prod_atb(a, b, x)
integer function get_skew45(iout, jtyp, ex, ixr, ixr_kj, iel, x, id, titr, idsk1, idsk2, vect1, vect2, theta0, stop_angl_min, stop_angl_max)
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)