OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
get_unique_master_cell.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!|| get_unique_main_cell ../engine/source/interfaces/int22/get_unique_master_cell.F
25!||--- called by ------------------------------------------------------
26!|| sinit22_fvm ../engine/source/interfaces/int22/sinit22_fvm.F
27!||--- uses -----------------------------------------------------
28!|| elbufdef_mod ../common_source/modules/mat_elem/elbufdef_mod.F90
29!|| i22bufbric_mod ../common_source/modules/interfaces/cut-cell-search_mod.F
30!|| i22tri_mod ../common_source/modules/interfaces/cut-cell-search_mod.F
31!|| initbuf_mod ../engine/share/resol/initbuf.F
32!||====================================================================
34 . NIN, IB, K )
35C-----------------------------------------------
36C D e s c r i p t i o n
37C-----------------------------------------------
38C Interface Type22 (/INTER/TYPE22) is an FSI coupling method based on cut cell method.
39C This experimental cut cell method is not completed, abandoned, and is not an official option.
40C
41! With interface 22 Hexahedral cell is cut and
42! main one is the biggest one which is greater
43! then 50%. In case of multiple choice (2 are
44! 50%-50% or several if criteria is reduced) we
45! must ensure a unique choice which is repeatable
46! with plateform and also different numbering.
47!
48! Here is chosen a sort by coordinates weighting
49! X,Y,Z components. a score is computed
50C-----------------------------------------------
51C M o d u l e s
52C-----------------------------------------------
53 USE initbuf_mod
55 USE i22tri_mod
56 USE elbufdef_mod
57C-----------------------------------------------
58C I m p l i c i t T y p e s
59C-----------------------------------------------
60#include "implicit_f.inc"
61C-----------------------------------------------
62C C o m m o n B l o c k s
63C-----------------------------------------------
64#include "comlock.inc"
65C-----------------------------------------------
66C D u m m y A r g u m e n t s
67C-----------------------------------------------
68 INTEGER :: nin,ib,k
69 INTEGER :: get_unique_main_cell
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 INTEGER :: ismain, n, ipos, level, icell
74 my_real :: centroid(3,k), score(k), min, nextmin
75C-----------------------------------------------
76C P r e - C o n d i t i o n
77C-----------------------------------------------
78 !IF(INT22==0)RETURN !already checked
79 !IF(K<2) RETURN !already checked
80C-----------------------------------------------
81C S o u r c e L i n e s
82C-----------------------------------------------
83 centroid(:,:) = zero
84 n = 0
85 ipos = 1
86 level = 3 !3:X, 2:Y, 1:Z
87 score(1:k) = zero
88
89 DO icell = 1, 9
90 ismain = brick_list(nin,ib)%POLY(icell)%IsMain
91 IF(ismain==0)cycle
92 n = n + 1
93 centroid(1:3,n) = brick_list(nin,ib)%POLY(icell)%CellCenter(1:3)
94 ENDDO
95
96 DO WHILE(level >= 1)
97 ipos = minloc(centroid(4-level,1:k),1)
98 min = centroid(4-level,ipos) !init with maximum value
99 DO WHILE (ipos < k)
100 ipos = minloc(centroid(4-level,ipos+1:k),1)
101 nextmin = centroid(4-level,ipos)
102 IF(nextmin == min) THEN
103 score(ipos) = score(ipos) + 10**level
104 ipos = ipos + 1
105 ENDIF
106 enddo!next IPOS
107 ipos = 1
108 level = level -1
109 enddo!next LEVEL
110
111 ipos = maxloc(score(1:k),1)
113
114 RETURN
115 END
#define my_real
Definition cppsort.cpp:32
integer function get_unique_main_cell(nin, ib, k)
#define min(a, b)
Definition macros.h:20
type(brick_entity), dimension(:,:), allocatable, target brick_list