OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
inter_check_sort.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| inter_check_sort ../engine/source/interfaces/generic/inter_check_sort.F
25!||--- called by ------------------------------------------------------
26!|| inttri ../engine/source/interfaces/intsort/inttri.F
27!||--- uses -----------------------------------------------------
28!|| intbufdef_mod ../common_source/modules/interfaces/intbufdef_mod.F90
29!|| inter_struct_mod ../engine/share/modules/inter_struct_mod.F
30!|| sensor_mod ../common_source/modules/sensor_mod.F90
31!||====================================================================
32 SUBROUTINE inter_check_sort( ITASK,NEED_TO_SORT,NBINTC,INTLIST,IPARI,NSENSOR,
33 . INTBUF_TAB,SENSOR_TAB,NB_INTER_SORTED,
34 . LIST_INTER_SORTED,INTER_STRUCT)
35!$COMMENT
36! INTER_CHECK_SORT description
37! check if a interface must be sorted
38!
39! INTER_CHECK_SORT organization :
40! loop over the NBINTC interfaces and if
41! * dist < 0 & t_start < current time < t_stop --> must be sorted
42!$ENDCOMMENT
43C-----------------------------------------------
44C M o d u l e s
45C-----------------------------------------------
46 USE intbufdef_mod
48 USE sensor_mod
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "com04_c.inc"
57#include "com08_c.inc"
58#include "param_c.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 INTEGER, INTENT(in) :: ITASK ! omp task id
63 INTEGER, INTENT(inout) :: NEED_TO_SORT ! 1 if one or more interfaces must be sorted
64 INTEGER, INTENT(in) :: NBINTC ! number of interface which are not TYPE2
65 INTEGER, INTENT(in) :: NSENSOR
66 INTEGER, DIMENSION(NBINTC), INTENT(in) :: INTLIST ! interface id
67 INTEGER, INTENT(inout) :: NB_INTER_SORTED ! number of interfaces that need to be sorted
68 INTEGER, DIMENSION(NBINTC), INTENT(inout) :: LIST_INTER_SORTED ! list of interfaces that need to be sorted
69 INTEGER, DIMENSION(NPARI,NINTER), INTENT(in) :: IPARI ! interface data
70 TYPE(intbuf_struct_),DIMENSION(NINTER) :: INTBUF_TAB ! interface data
71 TYPE(inter_struct_type), DIMENSION(NINTER), INTENT(inout) :: INTER_STRUCT ! structure for interface
72 TYPE (SENSOR_STR_) ,DIMENSION(NSENSOR) :: SENSOR_TAB
73C-----------------------------------------------
74C L o c a l V a r i a b l e s
75C-----------------------------------------------
76 INTEGER :: NTY,INACTI,ISENS
77 my_real :: TS,STARTT,STOPT,DIST
78 LOGICAL TYPE18
79 LOGICAL :: IS_SORTING_NEEDED
80 INTEGER :: KK,N
81! ----------------------------------------
82 nb_inter_sorted = 0
83 ! --------------------------
84 ! loop over the interface
85 DO kk=1,nbintc
86 ! find the interface type
87 n = intlist(kk)
88 nty = ipari(7,n)
89 inacti = ipari(22,n)
90 type18=.false.
91 IF(nty==7 .AND. inacti==7)type18=.true.
92
93 isens = 0
94 IF(nty == 7.OR.nty == 11.OR.nty == 24.OR.nty == 25) isens = ipari(64,n)
95 IF (isens > 0) THEN ! IF INTERFACE IS ACTIVATED BY SENSOR
96 ts = sensor_tab(isens)%TSTART
97 ELSE
98 ts = tt
99 ENDIF
100 is_sorting_needed=.false.
101 ! ------------------------
102 ! interface type 7
103 IF( (nty == 7.AND.tt>=ts).AND.(.NOT.type18) )THEN
104 ! check if the interface must be sorted (dist + t_start + t_stop)
105 dist = intbuf_tab(n)%VARIABLES(distance_index)
106 IF (dist<=zero) is_sorting_needed = .true.
107 startt=intbuf_tab(n)%VARIABLES(t_start_index)
108 stopt =intbuf_tab(n)%VARIABLES(t_stop_index)
109
110 IF(is_sorting_needed) THEN
111 IF(startt>tt) is_sorting_needed = .false.
112 ENDIF
113
114 IF(is_sorting_needed) THEN
115 IF(tt>stopt) is_sorting_needed = .false.
116 ENDIF
117 ! the current interface must be sorted --> IS_SORTING_NEEDED=true
118 IF (is_sorting_needed) THEN
119 IF(itask==0) need_to_sort = 1
120 nb_inter_sorted = nb_inter_sorted + 1
121 list_inter_sorted(nb_inter_sorted) = n
122 IF(itask==0) inter_struct(n)%CURV_MAX_MAX = zero
123 ENDIF
124 ENDIF
125 ! ------------------------
126 ENDDO
127 ! --------------------------
128 RETURN
129 END SUBROUTINE inter_check_sort
subroutine inter_check_sort(itask, need_to_sort, nbintc, intlist, ipari, nsensor, intbuf_tab, sensor_tab, nb_inter_sorted, list_inter_sorted, inter_struct)