OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
quad_surface_buffer.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!|| quad_surface_buffer ../starter/source/model/sets/quad_surface_buffer.F
25!||--- called by ------------------------------------------------------
26!|| surface_buffer ../starter/source/model/sets/surface_buffer.F
27!||--- calls -----------------------------------------------------
28!|| surf_segment ../starter/source/model/sets/solid_surface_buffer.F
29!||--- uses -----------------------------------------------------
30!||====================================================================
32 . IXQ ,IAD_SURF ,BUFTMPSURF ,NSEG ,KNOD2ELQ ,
33 . NOD2ELQ ,IEXT ,X ,CLAUSE,IPARTQ)
34C-----------------------------------------------
35C M o d u l e s
36C-----------------------------------------------
37 USE my_alloc_mod
38 USE setdef_mod
39 use element_mod , only : nixq
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43#include "implicit_f.inc"
44#include "com04_c.inc"
45#include "com01_c.inc"
46C-----------------------------------------------
47C D u m m y A r g u m e n t s
48C-----------------------------------------------
49 INTEGER IXQ(NIXQ,*),KNOD2ELQ(*),NOD2ELQ(*),BUFTMPSURF(*),IPARTQ(NUMELQ)
50 INTEGER IEXT,IAD_SURF
51 INTEGER, INTENT(INOUT) :: NSEG
53 . x(3,*)
54!
55 TYPE (SET_) :: CLAUSE
56C-----------------------------------------------
57C L o c a l V a r i a b l e s
58C-----------------------------------------------
59 INTEGER J, JQ, K, N1, N2, ISEG, KK, KQ, L1, L2, L, TRUEAXE, NQQ1, NQQ2
60 INTEGER NODTAG(4),LINES(2,4),NQ(4)
61 DATA lines/1,2,
62 . 2,3,
63 . 3,4,
64 . 4,1/
66 . y1,z1,y2,z2,y3,z3,y4,z4,
67 . yg,zg,pvect,psca,dy,dz,ny,nz
68 INTEGER, DIMENSION(:), ALLOCATABLE:: PART_TAG
69C=======================================================================
70C
71 IF(iext==1)THEN
72C
73C External surface only.
74 CALL my_alloc(part_tag,npart)
75 part_tag(1:npart)=0
76 DO j=1, clause%NB_PART
77 part_tag(clause%PART(j))=1
78 ENDDO
79
80 DO j=1,clause%NB_QUAD
81 jq = clause%QUAD(j)
82 nodtag(1:4)=1
83c NQ(N) = IXQ(JJ-1,JQ)
84 DO l=1,4
85 nq(l) = ixq(l+1,jq)
86 l1 = lines(1,l)
87 l2 = lines(2,l)
88 nqq1 = ixq(l1+1,jq)
89 nqq2 = ixq(l2+1,jq)
90 DO k=knod2elq(nqq1)+1,knod2elq(nqq1+1)
91 kq=nod2elq(k)
92 IF (kq==jq .OR. kq > numelq) cycle
93 IF (part_tag(ipartq(kq))==0) cycle
94 DO kk=1,4
95 IF (ixq(lines(1,kk)+1,kq)==nqq1.AND.ixq(lines(2,kk)+1,kq)==nqq2) THEN
96 nodtag(l)=0
97 ELSEIF (ixq(lines(1,kk)+1,kq)==nqq2.AND.ixq(lines(2,kk)+1,kq)==nqq1) THEN
98 nodtag(l)=0
99 ENDIF
100 ENDDO
101 ENDDO
102 ENDDO ! DO L=1,4
103C looks for the center of elements to check normal ext
104 y1 = x(2,nq(1))
105 z1 = x(3,nq(1))
106c
107 y2 = x(2,nq(2))
108 z2 = x(3,nq(2))
109c
110 y3 = x(2,nq(3))
111 z3 = x(3,nq(3))
112c
113 y4 = x(2,nq(4))
114 z4 = x(3,nq(4))
115c
116 yg = (y1+y2+y3+y4)/four
117 zg = (z1+z2+z3+z4)/four
118
119 DO l=1,4
120 l1 = lines(1,l)
121 l2 = lines(2,l)
122 trueaxe= 1
123 n1 = nq(l1)
124 n2 = nq(l2)
125 IF (n2d==1.AND.x(2,n1)<=em10.AND.x(2,n2)<=em10) THEN ! Case Axi omit nodes of revolution axe z ( y=0)
126 trueaxe= 0
127 ENDIF
128
129 IF (trueaxe==1) THEN
130 IF (nodtag(l)==1) THEN ! nodes of external lines
131 nseg=nseg+1
132C normal computation
133 dy = x(2,n2)-x(2,n1)
134 dz = x(3,n2)-x(3,n1)
135 ny = -dz
136 nz = dy
137 pvect = dy*dz
138 IF (pvect<zero) THEN
139 ny = dz
140 nz = -dy
141 ENDIF
142C check external normal
143 psca = ny*(y1-yg)+nz*(z1-zg)
144 iseg = nseg
145 IF (psca<=zero) THEN
146 CALL surf_segment(n1 ,n2 ,0 ,0 ,jq,
147 . buftmpsurf ,iad_surf ,2 )
148 ELSE
149 CALL surf_segment(n2 ,n1 ,0 ,0 ,jq,
150 . buftmpsurf ,iad_surf ,2 )
151 ENDIF ! IF (PSCA<=ZERO)
152
153 ENDIF
154
155 ENDIF
156
157 ENDDO
158
159
160 ENDDO
161 IF(ALLOCATED(part_tag)) DEALLOCATE(part_tag)
162 ENDIF
163C-----------
164 RETURN
165 END
#define my_real
Definition cppsort.cpp:32
subroutine quad_surface_buffer(ixq, iad_surf, buftmpsurf, nseg, knod2elq, nod2elq, iext, x, clause, ipartq)
subroutine surf_segment(n1, n2, n3, n4, elem, buftmpsurf, iad_surf, eltyp)