53 INTEGER,
PARAMETER :: MAX_POINTS = 10000000
54 INTEGER,
PARAMETER :: MAX_ZONES = 1000
58 INTEGER :: GRID_DIMENSION, N_POINTS,N_FACES,N_FACE_ZONES
59 INTEGER :: ZONE,ZONE_ID,N1,N2
62 LOGICAL :: ALL_POINTS_READ,ALL_FACES_READ
64 INTEGER,
ALLOCATABLE,
DIMENSION(:,:) ::POINT_ZONE_INFO,FACE_ZONE_INFO
65 DOUBLE PRECISION,
ALLOCATABLE,
DIMENSION(:,:) :: POINT_COORDS
67 CHARACTER(LEN=18),
ALLOCATABLE,
DIMENSION(:,:) :: BC_LABEL_TEXT
69 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: BC_ASSIGNED
71 CHARACTER(LEN=18),
DIMENSION(10) :: BUFF_CHAR
73 INTEGER :: P1,P2,P3,P4
74 DOUBLE PRECISION,
DIMENSION(3) :: NORMAL, VECTMP, VECTMP2
75 DOUBLE PRECISION ::NORM
77 DOUBLE PRECISION ::v1x,v1y,v1z
78 DOUBLE PRECISION ::v2x,v2y,v2z
79 DOUBLE PRECISION ::v3x,v3y,v3z
80 DOUBLE PRECISION ::ABSTRANS
84 INTEGER :: BC_LABELS_TO_READ, BC_LABELS_READ,NFZ,ZID,L2
85 INTEGER :: N_BC_IGNORED
88 ALLOCATE(point_coords(3,max_points))
89 ALLOCATE(point_zone_info(max_zones,3))
90 ALLOCATE(face_zone_info(max_zones,3))
91 ALLOCATE(bc_label_text(max_zones,2))
92 ALLOCATE(bc_assigned(max_zones))
94 WRITE(*,2000)
'READING geometry from geometry.msh...' 96 INQUIRE(file=
'geometry.msh',exist=present)
99 WRITE(*,
"('(PE ',I3,'): input data file, ',A11,' is missing: run aborted')" 108 OPEN(unit=333, file=
'geometry.msh', status=
'OLD', err=910,convert=
'BIG_ENDIAN' 110 IF(
mype ==
pe_io)
WRITE(*,2000)
'MSH file opened. Starting reading data...' 112 OPEN(unit=444, file=
'checkgeometry.stl',convert=
'BIG_ENDIAN')
113 write(444,*)
'solid vcg' 118 READ(333,*) (buff_char(i),i=1,2)
126 READ(333,*) (buff_char(i),i=1,4)
131 all_points_read = .false.
133 DO WHILE(.NOT.all_points_read)
135 READ(333,*) (buff_char(i),i=1,4)
140 point_zone_info(zone,1) = zone_id
141 point_zone_info(zone,2) = n1
142 point_zone_info(zone,3) = n2
145 READ(333,*) (point_coords(d,nn),d=1,grid_dimension)
148 IF(n2/=n_points)
THEN 151 all_points_read = .true.
161 READ(333,*) (buff_char(i),i=1,4)
167 all_faces_read = .false.
169 bc_labels_to_read = 0
174 DO WHILE(.NOT.all_faces_read)
176 READ(333,*) (buff_char(i),i=1,4)
182 face_zone_info(zone,1) = zone_id
183 face_zone_info(zone,2) = n1
184 face_zone_info(zone,3) = n2
186 bc_labels_to_read = bc_labels_to_read + 1
192 IF(ppface<3.OR.ppface>4)
THEN 193 IF(
mype ==
pe_io)
WRITE(*,*)ppface,
'POINTS PER FACE. EACH FACE MUST HAVE 3 OR 4 POINTS.' 196 ELSEIF(ppface==3)
THEN 198 READ(333,*) (buff_char(i),i=1,4)
203 v1x = point_coords(1,p1)
204 v1y = point_coords(2,p1)
205 v1z = point_coords(3,p1)
207 v2x = point_coords(1,p2)
208 v2y = point_coords(2,p2)
209 v2z = point_coords(3,p2)
211 v3x = point_coords(1,p3)
212 v3y = point_coords(2,p3)
213 v3z = point_coords(3,p3)
215 vectmp = point_coords(:,p2)-point_coords(:,p1)
216 vectmp2 = point_coords(:,p3)-point_coords(:,p1)
219 norm = sqrt(dot_product(normal(:),normal(:)))
220 normal = normal / norm
243 write(444,*)
' facet normal ',
norm_face(:,nf)
244 write(444,*)
' outer loop' 245 write(444,*)
' vertex ',
vertex(1,1:3,nf)
246 write(444,*)
' vertex ',
vertex(2,1:3,nf)
247 write(444,*)
' vertex ',
vertex(3,1:3,nf)
248 write(444,*)
' endloop' 249 write(444,*)
' endfacet' 251 ELSEIF(ppface==4)
THEN 253 READ(333,*) (buff_char(i),i=1,5)
259 n_quad2tri = n_quad2tri + 1
265 v1x = point_coords(1,p1)
266 v1y = point_coords(2,p1)
267 v1z = point_coords(3,p1)
269 v2x = point_coords(1,p2)
270 v2y = point_coords(2,p2)
271 v2z = point_coords(3,p2)
273 v3x = point_coords(1,p3)
274 v3y = point_coords(2,p3)
275 v3z = point_coords(3,p3)
277 vectmp = point_coords(:,p2)-point_coords(:,p1)
278 vectmp2 = point_coords(:,p3)-point_coords(:,p1)
281 norm = sqrt(dot_product(normal(:),normal(:)))
282 normal = normal / norm
304 write(444,*)
' facet normal ',
norm_face(:,nf)
305 write(444,*)
' outer loop' 306 write(444,*)
' vertex ',
vertex(1,1:3,nf)
307 write(444,*)
' vertex ',
vertex(2,1:3,nf)
308 write(444,*)
' vertex ',
vertex(3,1:3,nf)
309 write(444,*)
' endloop' 310 write(444,*)
' endfacet' 314 v1x = point_coords(1,p1)
315 v1y = point_coords(2,p1)
316 v1z = point_coords(3,p1)
318 v2x = point_coords(1,p3)
319 v2y = point_coords(2,p3)
320 v2z = point_coords(3,p3)
322 v3x = point_coords(1,p4)
323 v3y = point_coords(2,p4)
324 v3z = point_coords(3,p4)
326 vectmp = point_coords(:,p3)-point_coords(:,p1)
327 vectmp2 = point_coords(:,p4)-point_coords(:,p1)
330 norm = sqrt(dot_product(normal(:),normal(:)))
331 normal = normal / norm
352 write(444,*)
' facet normal ',
norm_face(:,nf)
353 write(444,*)
' outer loop' 354 write(444,*)
' vertex ',
vertex(1,1:3,nf)
355 write(444,*)
' vertex ',
vertex(2,1:3,nf)
356 write(444,*)
' vertex ',
vertex(3,1:3,nf)
357 write(444,*)
' endloop' 358 write(444,*)
' endfacet' 364 n_bc_ignored = n_bc_ignored + 1
367 CALL skip(333,n2-n1+1)
373 all_faces_read = .false.
376 all_faces_read = .true.
383 write(444,*)
'endsolid vcg' 388 WRITE(*,*)
' The file check_geometry.stl was sucessfully written.' 389 WRITE(*,*)
' This is the equivalent of geometry.msh in STL format,' 390 WRITE(*,*)
' and is provided for convenience (it is not used).' 396 bc_assigned = .false.
399 DO WHILE(bc_labels_read < bc_labels_to_read)
401 READ(333,*) buff_char(1)
403 IF(buff_char(1)==
'(45')
THEN 405 READ(333,*) (buff_char(i),i=1,4)
409 DO zone = 1,n_face_zones
410 IF(face_zone_info(zone,1)==zone_id)
THEN 411 bc_labels_read = bc_labels_read + 1
412 bc_label_text(zone,1) = trim(buff_char(3))
413 bc_label_text(zone,2) = trim(buff_char(4))
415 bc_assigned(zone) = .true.
425 WRITE(*,*)
' Summary of data read from geometry.msh file:' 426 WRITE(*,*)
'======================================================================' 427 WRITE(*,*)
' DIMENSION POINTS FACES ZONES' 428 WRITE(*,*)
'======================================================================' 430 WRITE(*,1020) grid_dimension,n_points,n_faces,n_face_zones
432 WRITE(*,*)
' BOUNDARY CONDITION DETECTED (INFO EXTRACTED FROM .MSH FILE):' 433 WRITE(*,*)
'======================================================================' 434 WRITE(*,*)
' ZONE BC_TYPE(MFIX) FACES BC_TYPE(GAMBIT) BC LABEL' 435 WRITE(*,*)
'======================================================================' 438 DO zone = 1,n_face_zones
439 IF(bc_assigned(zone))
THEN 440 zid = face_zone_info(zone,1)
441 nfz = face_zone_info(zone,3)-face_zone_info(zone,2) + 1
442 n_faces = n_faces + nfz
443 l2=len(trim(bc_label_text(zone,2)))-4
444 WRITE(*,1000) zid,
bc_type_enum(zid),nfz,bc_label_text(zone
450 DO zone = 1,n_face_zones
451 IF(.NOT.bc_assigned(zone))
THEN 452 zid = face_zone_info(zone,1)
453 nfz = face_zone_info(zone,3)-face_zone_info(zone,2) + 1
454 l2=len(trim(bc_label_text(zone,2)))-4
455 WRITE(*,1000) zid,
'NOT USED',nfz,bc_label_text(zone,1),bc_label_text
459 WRITE(*,*)
'======================================================================' 460 WRITE(*,*)
' PLEASE VERIFY THAT BOUNDARY CONDITIONS ARE CORRECTLY ASSIGNED.' 461 WRITE(*,*)
' MODIFY BC_TYPE IN mfix.dat IF NECESSARY.' 475 WRITE(*,2000)
'MSH file successfully read.' 476 WRITE(*,*)
' Total number of faces used as boundary faces =',n_faces
477 IF(n_quad2tri>0)
WRITE(*,*)
' Number of quad faces split into triangles =' 480 WRITE(*,*)
' RANGE OF MSH FILE:' 482 WRITE(*,5000)
' AFTER SCALING BY A FACTOR OF ',
scale_msh 516 OPEN(unit=444, file=
'msgeometry.stl',convert=
'BIG_ENDIAN')
518 DO zone = 1,n_face_zones
519 IF(bc_assigned(zone))
THEN 520 zid = face_zone_info(zone,1)
521 l2=len(trim(bc_label_text(zone,2)))-4
523 print*,
'=======> Zone ID= ', zid,bc_label_text(zone,2)(1
524 write(444,6000)
'solid', bc_label_text(zone,2)(1:l2),zid
528 write(444,*)
' facet normal ',
norm_face(:,nf)
529 write(444,*)
' outer loop' 530 write(444,*)
' vertex ',
vertex(1,1:3,nf)
531 write(444,*)
' vertex ',
vertex(2,1:3,nf)
532 write(444,*)
' vertex ',
vertex(3,1:3,nf)
533 write(444,*)
' endloop' 534 write(444,*)
' endfacet' 540 write(444,6000)
'endsolid', bc_label_text(zone,2)(1:l2),zid
547 DEALLOCATE(point_coords)
548 DEALLOCATE(point_zone_info)
549 DEALLOCATE(face_zone_info)
550 DEALLOCATE(bc_label_text)
551 DEALLOCATE(bc_assigned)
569 1000
FORMAT(1x,i4,7x,a8,i8,1x,a20,1x,a20)
570 1010
FORMAT(1x,i4,5x,a20,1x,a20)
571 1020
FORMAT(5x,i3,2x,3(i10,2x))
573 1500
FORMAT(/1x,70(
'*')//
' From: GET_STL_DATA',/
' Message: ',&
574 'Unable to open stl file',/1x,70(
'*')/)
575 1600
FORMAT(/1x,70(
'*')//
' From: GET_STL_DATA',/
' Message: ',&
576 'Error while reading stl file',/1x,70(
'*')/)
577 1700
FORMAT(/1x,70(
'*')//
' From: GET_STL_DATA',/
' Message: ',&
578 'End of file reached while reading stl file',/1x,70(
'*')/)
580 2010
FORMAT(1x,
a,i4,
a)
581 3000
FORMAT(1x,
a,
'(',f10.4,
';',f10.4,
';',f10.4,
')')
582 4000
FORMAT(1x,
a,f10.4,
' to ',f10.4)
583 5000
FORMAT(1x,
a,f10.4)
584 6000
FORMAT(
a,1x,
a,
'_',i4.4)
588 SUBROUTINE skip(FILE_UNIT,N_SKIP)
590 INTEGER,
INTENT(IN) ::FILE_UNIT,N_SKIP
600 CHARACTER(LEN=10) :: INTERNAL
601 CHARACTER(LEN=*) :: STRING
602 CHARACTER(LEN=10) :: CLEANED_STRING
605 cleaned_string = string
606 IF(string(1:1)==
'(') cleaned_string = string(2:)
608 WRITE(internal,fmt=
'(A10)') trim(cleaned_string)
609 READ(internal,fmt=
'(Z10)') int
617 CHARACTER(LEN=10) :: INTERNAL
618 CHARACTER(LEN=*) :: STRING
619 CHARACTER(LEN=10) :: CLEANED_STRING
622 cleaned_string = string
623 IF(string(1:1)==
'(') cleaned_string = string(2:)
625 WRITE(internal,fmt=
'(A10)') trim(cleaned_string)
626 READ(internal,fmt=
'(I10)') int
681 INTEGER :: NN,IGNORED_FACETS
682 LOGICAL :: PRESENT,KEEP_READING,IGNORE_CURRENT_FACET
683 DOUBLE PRECISION ::v1x,v1y,v1z
684 DOUBLE PRECISION ::v2x,v2y,v2z
685 DOUBLE PRECISION ::v3x,v3y,v3z
686 DOUBLE PRECISION ::x12,y12,z12,x13,y13,z13,dp,d12,d13
687 DOUBLE PRECISION ::cos_angle,cos_small_angle
688 DOUBLE PRECISION ::n1,n2,n3,NORM
689 DOUBLE PRECISION ::ABSTRANS
690 CHARACTER(LEN=32) ::TEST_CHAR,BUFF_CHAR
693 INTEGER :: BCV,NUMBER_OF_GEOMETRY_FILES,NUMBER_OF_BC_PATCHES
697 CHARACTER(LEN=100) :: FNAME
698 integer :: stl_unit, nf
700 bc_patch_found_in_stl = .false.
702 geometryfile(0) =
'geometry.stl' 703 number_of_geometry_files = 0
704 number_of_bc_patches = 0
709 WRITE(*,100)
'From Get_Stl_Data: Analysing BCs in mfix.dat...' 710 WRITE(*,120)
'BC_ID',
'BC_TYPE' 716 number_of_geometry_files = number_of_geometry_files + 1
717 number_of_bc_patches = number_of_bc_patches + 1
720 bc_patch(number_of_geometry_files) = bcv
721 WRITE(geometryfile(number_of_geometry_files),200)
'geometry_' 728 IF(
mype ==
pe_io)
WRITE(*,110)
'Number of CG BCs in mfix.dat = ',number_of_bc_patches
732 120
FORMAT(1x,a6,4x,a7)
733 130
FORMAT(1x,i6,4x,a6)
734 140
FORMAT(1x,
a,i6,
a)
735 200
FORMAT(
a,i4.4,
".stl")
739 IF(number_of_bc_patches==0)
THEN 741 WRITE(*,100)
'ERROR: NO CARTESIAN GRID BOUNDARY CONDITION SPECIFIED.' 742 WRITE(*,100)
'AT LEAST ONE BC_TYPE MUST START WITH CG (FOR EXAMPLE CG_NSW)' 743 WRITE(*,100)
'RUN ABORTED' 747 ELSEIF(number_of_bc_patches==1)
THEN 749 INQUIRE(file=
'geometry.stl',exist=present)
754 WRITE(*,110)
'The file geometry.stl exists and the following BC patch was found: ' 759 geometryfile(nf1)=
'geometry.stl' 765 INQUIRE(file=
'geometry.stl',exist=present)
768 WRITE(*,100)
'The file geometry.stl exists and several CG BC types are defined.' 769 WRITE(*,100)
'All BC patches will be read from geometry.stl.' 772 geometryfile(0)=
'geometry.stl' 780 nf2 = number_of_geometry_files
782 WRITE(*,100)
'The file geometry.stl does not exist and several CG_BC types are defined.' 783 WRITE(*,100)
'Each BC patch will be read from geometry_BCID.stl.' 784 WRITE(*,100)
'where BCID is 4-paded integer' 802 IF(
mype ==
pe_io)
WRITE(*,2000)
'Reading geometry from '//trim(geometryfile
' ...' 804 INQUIRE(file=trim(geometryfile(nn)),exist=present)
805 IF(.NOT.present)
THEN 807 WRITE(*,
"('(PE ',I3,'): input data file, ',A11,' is missing: run aborted')" 817 OPEN(unit=333, file=trim(geometryfile(nn)), status=
'OLD', err=9
'BIG_ENDIAN' 819 IF(
mype ==
pe_io)
WRITE(*,2000)
'STL file opened. Starting reading data...' 821 keep_reading = .true.
823 DO WHILE(keep_reading)
825 READ(333,*,err=920,end=930) test_char
827 IF(trim(test_char) ==
'solid'.AND.nn==0)
THEN 831 READ(333,*,err=920,end=930) buff_char,buff_char
833 l2=len(trim(buff_char))-3
835 READ(buff_char(l2:l2+4),fmt=
'(I4.4)') bc_patch(nn)
837 IF(
mype ==
pe_io)
WRITE(*,140)
'Found BC patch #', bc_patch
' in STL file.' 841 WRITE(*,110)
'This BC patch does not mach a CG BC in mfix.dat:' 842 WRITE(*,100)
'Please Correct mfix.dat and/or stl file amd try again' 847 bc_patch_found_in_stl(bc_patch(nn)) = .true.
849 ELSEIF(trim(test_char) ==
'facet')
THEN 852 ignore_current_facet = .false.
854 READ(333,*,err=920,end=930) buff_char,buff_char,n1,n2,n3
855 READ(333,*,err=920,end=930)
856 READ(333,*,err=920,end=930) buff_char, v1x,v1y,v1z
857 READ(333,*,err=920,end=930) buff_char, v2x,v2y,v2z
858 READ(333,*,err=920,end=930) buff_char, v3x,v3y,v3z
873 dp = x12*x13 + y12*y13 + z12*z13
874 d12 = sqrt(x12**2+y12**2+z12**2)
875 d13 = sqrt(x13**2+y13**2+z13**2)
878 cos_angle = dp/(d12*d13)
885 IF(dabs(cos_angle)>cos_small_angle)
THEN 886 ignore_current_facet = .true.
889 norm = sqrt(n1**2+n2**2+n3**2)
896 ignore_current_facet = .true.
900 IF(ignore_current_facet)
THEN 901 ignored_facets = ignored_facets + 1
936 930
IF(
mype ==
pe_io)
WRITE(*,100)
'Done reading file.' 946 IF(
mype==0.AND.nf2==0)
THEN 947 DO nn = 1,number_of_bc_patches
949 IF(.NOT.bc_patch_found_in_stl(bc_patch(nn)))
THEN 950 WRITE (*, 140)
'Did not find BC patch: ',bc_patch(nn) ,
' in stl file' 951 WRITE(*,100)
'Please correct mfix.dat and/or stl file amd try again' 970 WRITE(*,2000)
'STL file(s) successfully read.' 971 WRITE(*,110)
'Total number of facets read =',
n_facets + ignored_facets
972 WRITE(*,110)
'Number of valid facets =',
n_facets 973 WRITE(*,110)
'Number of ignored facets =',ignored_facets
974 WRITE(*,100)
'Geometry range from stl file:' 1005 WRITE(fname,
'(A,"_FACETS_READ", ".stl")') &
1007 open(stl_unit, file = fname, form=
'formatted',convert=
'big_endian' 1008 write(stl_unit,*)
'solid vcg' 1013 write(stl_unit,*)
' facet normal ',
norm_face(:,nf)
1014 write(stl_unit,*)
' outer loop' 1015 write(stl_unit,*)
' vertex ',
vertex(1,1:3,nf)
1016 write(stl_unit,*)
' vertex ',
vertex(2,1:3,nf)
1017 write(stl_unit,*)
' vertex ',
vertex(3,1:3,nf)
1018 write(stl_unit,*)
' endloop' 1019 write(stl_unit,*)
' endfacet' 1023 write(stl_unit,*)
'endsolid vcg' 1024 close(stl_unit, status =
'keep')
1026 WRITE(*,100)
'The file FACETS_READ.stl was sucessfully written.' 1027 WRITE(*,100)
'and is provided for convenience (it is not used).' 1048 1500
FORMAT(/1x,70(
'*')//
' From: GET_STL_DATA',/
' Message: ',&
1049 'Unable to open stl file',/1x,70(
'*')/)
1050 1600
FORMAT(/1x,70(
'*')//
' From: GET_STL_DATA',/
' Message: ',&
1051 'Error while reading stl file',/1x,70(
'*')/)
1052 1700
FORMAT(/1x,70(
'*')//
' From: GET_STL_DATA',/
' Message: ',&
1053 'End of file reached while reading stl file',/1x,70(
'*')/)
1055 2010
FORMAT(1x,
a,i4,
a)
1056 3000
FORMAT(1x,
a,
'(',f10.4,
';',f10.4,
';',f10.4,
')')
1057 4000
FORMAT(1x,
a,f10.4,
' to ',f10.4)
1058 5000
FORMAT(1x,
a,f10.4)
1084 SUBROUTINE eval_stl_fct_at(TYPE_OF_CELL,IJK,NODE,f_stl,CLIP_FLAG,BCID)
1108 LOGICAL :: CLIP_FLAG
1109 DOUBLE PRECISION :: f_stl
1111 CHARACTER (LEN=*) :: TYPE_OF_CELL
1112 INTEGER :: IJK,IJKC,NODE
1114 IF(node==15) print*,
'Warning: eval stl at node 15' 1174 SUBROUTINE intersect_line_with_facet(xa,ya,za,xb,yb,zb,FACET,INTERSECT_FLAG,xc,yc,zc)
1190 DOUBLE PRECISION:: xa,ya,za,xb,yb,zb,xc,yc,zc
1192 DOUBLE PRECISION:: NFx,NFy,NFz,nabx,naby,nabz
1193 DOUBLE PRECISION :: dot_denom,dot_num
1194 DOUBLE PRECISION :: VP1Ax,VP1Ay,VP1Az
1195 DOUBLE PRECISION :: Px,Py,Pz
1196 DOUBLE PRECISION :: tt
1197 DOUBLE PRECISION :: d_ac,d_bc
1198 LOGICAL :: INSIDE_FACET,INTERSECT_FLAG
1213 intersect_flag = .false.
1229 dot_denom = nfx*nabx + nfy*naby + nfz*nabz
1234 IF(dabs(dot_denom)<
tol_stl)
THEN 1236 intersect_flag = .false.
1246 vp1ax =
vertex(1,1,facet) - xa
1247 vp1ay =
vertex(1,2,facet) - ya
1248 vp1az =
vertex(1,3,facet) - za
1250 dot_num = nfx*vp1ax + nfy*vp1ay + nfz*vp1az
1252 tt = dot_num / dot_denom
1261 IF((tt>=
zero).AND.(tt<=
one))
THEN 1270 IF(inside_facet)
THEN 1271 intersect_flag = .true.
1276 intersect_flag = .false.
1282 intersect_flag = .false.
1290 d_ac = sqrt((xc-xa)**2 + (yc-ya)**2 + (zc-za)**2)
1291 d_bc = sqrt((xc-xb)**2 + (yc-yb)**2 + (zc-zb)**2)
1295 intersect_flag = .false.
1299 1000
FORMAT(a,3(2
x,g12.5))
1336 DOUBLE PRECISION :: NFx,NFy,NFz
1337 DOUBLE PRECISION :: Px,Py,Pz,V0x,V0y,V0z,V1x,V1y,V1z,V2x,V2y,V2z
1338 DOUBLE PRECISION :: dot00,dot01,dot02,dot11,dot12,dot_check
1339 DOUBLE PRECISION :: Inv_denom
1340 DOUBLE PRECISION :: u,v
1341 LOGICAL :: U_POSITIVE,V_POSITIVE,UPVL1,INSIDE_FACET
1343 DOUBLE PRECISION :: Vx,Vy,Vz
1344 DOUBLE PRECISION :: D(3),MINVAL_D,DH
1354 d(vv) = sqrt((px - vx)**2 + (py - vy)**2 + (pz - vz)**2 )
1357 minval_d = minval(d)
1360 inside_facet = .true.
1387 v2x = px -
vertex(1,1,facet)
1388 v2y = py -
vertex(1,2,facet)
1389 v2z = pz -
vertex(1,3,facet)
1391 dot_check = nfx*v2x + nfy*v2y + nfz*v2z
1398 dh = nfx * v2x + nfy * v2y + nfz * v2z
1401 inside_facet = .false.
1405 dot00 = v0x*v0x + v0y*v0y + v0z*v0z
1406 dot01 = v0x*v1x + v0y*v1y + v0z*v1z
1407 dot02 = v0x*v2x + v0y*v2y + v0z*v2z
1408 dot11 = v1x*v1x + v1y*v1y + v1z*v1z
1409 dot12 = v1x*v2x + v1y*v2y + v1z*v2z
1411 inv_denom =
one / (dot00*dot11 - dot01*dot01)
1413 u = (dot11*dot02 - dot01*dot12) * inv_denom
1414 v = (dot00*dot12 - dot01*dot02) * inv_denom
1420 inside_facet = (u_positive.AND.v_positive.AND.upvl1)
double precision scale_msh
subroutine skip(FILE_UNIT, N_SKIP)
double precision zmin_stl
subroutine eval_stl_fct_at(TYPE_OF_CELL, IJK, NODE, f_stl, CLIP_FLAG, B
double precision out_msh_value
double precision, parameter one
subroutine text_hex2int(STRING, INT)
double precision, dimension(3, 3, dim_stl) vertex
subroutine is_point_inside_facet(Px, Py, Pz, FACET, INSIDE_FACET)
character(len=60) run_name
double precision zmin_msh
integer, parameter dimension_bc
double precision zmax_stl
integer, dimension(dimension_bc) bc_type_enum
double precision scale_stl
double precision, parameter undefined
integer, dimension(dim_stl) bc_id_stl_face
double precision, dimension(:), allocatable a
double precision, dimension(:), allocatable f_at
double precision function, dimension(3) cross_product(A, B)
double precision xmax_stl
subroutine mfix_exit(myID, normal_termination)
double precision ymax_msh
double precision, dimension(3, dim_stl) norm_face
double precision tol_stl_dp
double precision stl_small_angle
character(len=16), dimension(dimension_bc) bc_type
double precision out_stl_value
double precision ymin_msh
double precision xmax_msh
double precision ymin_stl
double precision xmin_stl
double precision zmax_msh
double precision, parameter pi
double precision xmin_msh
integer, dimension(0:15) ijk_of_node
double precision ymax_stl
subroutine text_dec2int(STRING, INT)
double precision, dimension(:), allocatable x
double precision, parameter zero
logical function is_cg(boundary_condition)
subroutine intersect_line_with_facet(xa, ya, za, xb, yb, zb, FACET, INTERSECT