OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
get_unique_master_cell.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"

Go to the source code of this file.

Functions/Subroutines

integer function get_unique_main_cell (nin, ib, k)

Function/Subroutine Documentation

◆ get_unique_main_cell()

integer function get_unique_main_cell ( integer nin,
integer ib,
integer k )

Definition at line 33 of file get_unique_master_cell.F.

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
#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