54 SUBROUTINE mesh2d(nprocs,iProcs,ichr4)
71 LOGICAL :: surfaceelonproc
72 INTEGER :: testnumsurfel
73 INTEGER,
POINTER,
DIMENSION(:,:) :: nodeflag2d
80 TYPE user_type_surfndlist
81 TYPE(link_type
) :: link
83 END TYPE user_type_surfndlist
85 TYPE user_data_type_surfndlist
87 END TYPE user_data_type_surfndlist
90 TYPE user_ptr_type_surfndlist
91 TYPE(user_type_surfndlist
),
POINTER :: p
92 END TYPE user_ptr_type_surfndlist
94 TYPE(user_ptr_type_surfndlist
) :: user_surfndlist
95 TYPE(list_type
) :: surfndlist
97 TYPE(link_ptr_type
) :: link
99 TYPE(surfmesh_tri3_ptr
),
POINTER :: ptrtri3
100 TYPE(surfmesh_tri6_ptr
),
POINTER :: ptrtri6
101 TYPE(surfmesh_hex8_ptr
),
POINTER :: ptrhex8
103 INTEGER,
POINTER,
DIMENSION(:) :: bcsurfflagzero,bcsurfflagone,bcsurfflagtwo
106 CHARACTER(*),
PARAMETER :: surwin =
"sfrac"
108 REAL*8,
POINTER,
DIMENSION(:,:) :: meshcoor
110 INTEGER,
POINTER,
DIMENSION(:) :: elflag_list
113 INTEGER :: inb, ibu, ini
115 LOGICAL :: appendtoggle = .false.
116 appendtoggle = .false.
117 WRITE (*,*)
'**** iProc = ', iprocs,
' appendToggle = ', appendtoggle
122 write_attr = com_get_function_handle(
'OUT.write_attribute')
123 set_option = com_get_function_handle(
'OUT.set_option')
127 CALL com_call_function(
set_option, 2,
'rankwidth',
'0')
130 CALL com_new_window( surwin )
144 IF(meshtype2d.EQ.6)
THEN
148 ptrtri6 => surfmesh_tri6_sf_head
149 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
152 glbndnum = ptrtri6%ElemData(
i)
153 IF( nodeflag(glbndnum).GT.0)
THEN
154 numnpnew = numnpnew + 1
155 nodeflag(glbndnum) = -nodeflag(glbndnum)
158 ptrtri6 => ptrtri6%next
163 ptrtri6 => surfmesh_tri6_sf_head
164 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
166 glbndnum = ptrtri6%ElemData(
i)
167 DO k = 1,maxnumberofprocstosharenode
168 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
169 print*,
'Detected surface sliver for pressure'
170 numnpnew = numnpnew + 1
171 nodeflag(glbndnum) = -nodeflag(glbndnum)
175 ptrtri6 => ptrtri6%next
180 IF(numeltet2d(1,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
181 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
182 print*,
'Found ',numeltet2d(1,iprocs),
'triangles but no nodes'
187 IF(numeltet2d(1,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
188 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
189 print*,
'Found ',numnpnew,
' nodes but no triangles'
196 nodeflag(:)= abs( nodeflag(:))
198 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
203 ptrtri6 => surfmesh_tri6_sf_head
204 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
207 glbndnum = ptrtri6%ElemData(
i)
208 IF( nodeflag(glbndnum).GT.0)
THEN
209 numnpnew = numnpnew + 1
212 nodeflag2d(1,numnpnew) = glbndnum
213 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
214 nodeflag(glbndnum) = - numnpnew
217 ptrtri6 => ptrtri6%next
219 ptrtri6 => surfmesh_tri6_sf_head
220 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
222 glbndnum = ptrtri6%ElemData(
i)
223 DO k = 1,maxnumberofprocstosharenode
224 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
225 numnpnew = numnpnew + 1
226 print*,
'ROCFRAC: Dectected surface sliver for pressure, writing'
228 nodeflag2d(1,numnpnew) = glbndnum
229 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
230 nodeflag(glbndnum) = - numnpnew
234 ptrtri6 => ptrtri6%next
237 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
238 CALL com_set_size( surwin//
'.nc', ibu, numnpnew )
239 CALL com_resize_array(surwin//
'.nc', ibu, meshcoor, 3)
242 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
247 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'm')
248 CALL com_set_array( surwin//
'.bv', ibu, nodeflag2d(2,1), 2)
252 testnumsurfel = numeltet2d(1,iprocs)
254 CALL com_set_size( surwin//
'.:t6', ibu, testnumsurfel)
255 CALL com_resize_array( surwin//
'.:t6', ibu, elconntable, 6)
260 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
261 CALL com_resize_array(surwin//
'.bf2c', ibu, elflag_list, 1)
263 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
264 CALL com_set_size( surwin//
'.bcflag', ibu, 1)
265 CALL com_resize_array(surwin//
'.bcflag', ibu, bcsurfflagone, 1)
270 ptrtri6 => surfmesh_tri6_sf_head
271 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
272 surfaceelonproc = .false.
280 IF(epart(ptrtri6%ElemData(7)).EQ.iprocs) surfaceelonproc = .true.
281 IF(surfaceelonproc)
THEN
285 testnumsurfel = testnumsurfel + 1
286 elconntable(1:6,testnumsurfel) = abs(nodeflag(ptrtri6%ElemData(1:6)))
287 elflag_list(testnumsurfel) = elflag(ptrtri6%ElemData(7))
294 ptrtri6 => ptrtri6%next
297 IF(testnumsurfel.NE.numeltet2d(1,iprocs))
THEN
298 print*,
'ERROR, number of triangles from link list in for ignitable surfaces'
299 print*,
' different then that in read_patran'
300 print*,testnumsurfel,numeltet2d(1,iprocs)
314 CALL com_call_function(
set_option, 2,
'mode',
'w')
335 ELSE IF(meshtype2d.EQ.3)
THEN
339 ptrtri3 => surfmesh_tri3_sf_head
340 do while(
associated(ptrtri3))
343 glbndnum = ptrtri3%ElemData(
i)
344 IF( nodeflag(glbndnum).GT.0)
THEN
345 numnpnew = numnpnew + 1
346 nodeflag(glbndnum) = -nodeflag(glbndnum)
349 ptrtri3 => ptrtri3%next
354 ptrtri3 => surfmesh_tri3_sf_head
355 do while(
associated(ptrtri3))
357 glbndnum = ptrtri3%ElemData(
i)
358 DO k = 1,maxnumberofprocstosharenode
359 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
360 print*,
'Dectected surface sliver for pressure'
361 numnpnew = numnpnew + 1
362 nodeflag(glbndnum) = -nodeflag(glbndnum)
366 ptrtri3 => ptrtri3%next
371 IF(numeltet2d(1,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
372 print*,
'ERROR, found in surface mesh for Solid/Fluid interface'
373 print*,
'Found ',numeltet2d(1,iprocs),
'triangles but no nodes'
378 IF(numeltet2d(1,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
379 print*,
'Warning: found in sufrace mesh for Solid/Fluid interface'
380 print*,
'Found ',numnpnew,
' nodes but no triangles'
383 nodeflag(:)= abs( nodeflag(:))
385 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
390 ptrtri3 => surfmesh_tri3_sf_head
391 do while(
associated(ptrtri3).eqv..true.)
394 glbndnum = ptrtri3%ElemData(
i)
395 IF( nodeflag(glbndnum).GT.0)
THEN
396 numnpnew = numnpnew + 1
399 nodeflag2d(1,numnpnew) = glbndnum
400 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
401 nodeflag(glbndnum) = - numnpnew
404 ptrtri3 => ptrtri3%next
406 ptrtri3 => surfmesh_tri3_sf_head
407 do while(
associated(ptrtri3).eqv..true.)
409 glbndnum = ptrtri3%ElemData(
i)
410 DO k = 1,maxnumberofprocstosharenode
411 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
412 numnpnew = numnpnew + 1
413 print*,
'Dectected surface sliver for pressure, writing'
415 nodeflag2d(1,numnpnew) = glbndnum
416 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
417 nodeflag(glbndnum) = - numnpnew
421 ptrtri3 => ptrtri3%next
424 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
425 CALL com_set_size( surwin//
'.nc', ibu, numnpnew )
426 CALL com_resize_array(surwin//
'.nc', ibu, meshcoor, 3)
429 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
434 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'm')
435 CALL com_set_array( surwin//
'.bv', ibu, nodeflag2d(2,1), 2)
439 testnumsurfel = numeltet2d(1,iprocs)
441 CALL com_set_size( surwin//
'.:t3', ibu, testnumsurfel)
442 CALL com_resize_array( surwin//
'.:t3', ibu, elconntable, 3)
447 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
448 CALL com_resize_array(surwin//
'.bf2c', ibu, elflag_list, 1)
450 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
451 CALL com_set_size( surwin//
'.bcflag', ibu, 1)
452 CALL com_resize_array(surwin//
'.bcflag', ibu, bcsurfflagone, 1)
457 ptrtri3 => surfmesh_tri3_sf_head
458 do while(
associated(ptrtri3))
459 surfaceelonproc = .false.
467 IF(epart(ptrtri3%ElemData(4)).EQ.iprocs) surfaceelonproc = .true.
468 IF(surfaceelonproc)
THEN
472 testnumsurfel = testnumsurfel + 1
473 elconntable(1:3,testnumsurfel) = abs(nodeflag(ptrtri3%ElemData(1:3)))
474 elflag_list(testnumsurfel) = elflag(ptrtri3%ElemData(4))
478 ptrtri3 => ptrtri3%next
481 IF(testnumsurfel.NE.numeltet2d(1,iprocs))
THEN
482 print*,
'ERROR, number of triangles from link list in Ignitable surface mesh'
483 print*,
' different then that in read_patran'
484 print*,
' For Fluid Solid Inteface mesh'
485 print*,testnumsurfel,numeltet2d(1,iprocs)
497 CALL com_call_function(
set_option, 2,
'mode',
'w')
519 ELSE IF(meshtype2d.EQ.4)
THEN
524 ptrhex8 => surfmesh_hex8_sf_head
525 DO WHILE(
ASSOCIATED(ptrhex8).eqv..true.)
528 glbndnum = ptrhex8%ElemData(
i)
529 IF( nodeflag(glbndnum).GT.0)
THEN
530 numnpnew = numnpnew + 1
531 nodeflag(glbndnum) = -nodeflag(glbndnum)
534 ptrhex8 => ptrhex8%next
539 IF(numelhex2d(1,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
540 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
541 print*,
'Found ',numelhex2d(1,iprocs),
'quads but no nodes'
546 IF(numelhex2d(1,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
547 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
548 print*,
'Found ',numnpnew,
' nodes but no quads'
559 nodeflag(:)= abs( nodeflag(:))
561 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
568 ptrhex8 => surfmesh_hex8_sf_head
569 do while(
associated(ptrhex8).eqv..true.)
572 glbndnum = ptrhex8%ElemData(
i)
573 IF( nodeflag(glbndnum).GT.0)
THEN
574 numnpnew = numnpnew + 1
577 nodeflag2d(1,numnpnew) = glbndnum
578 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
579 nodeflag(glbndnum) = - numnpnew
582 ptrhex8 => ptrhex8%next
586 IF (numnpnew.GT.0)
THEN
587 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
588 CALL com_set_size( surwin//
'.nc', ibu, numnpnew )
589 CALL com_resize_array(surwin//
'.nc', ibu, meshcoor, 3)
592 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
597 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'm')
598 CALL com_set_array( surwin//
'.bv', ibu, nodeflag2d(2,1), 2)
602 testnumsurfel = numelhex2d(1,iprocs)
604 CALL com_set_size( surwin//
'.:q4', ibu, testnumsurfel)
605 CALL com_resize_array( surwin//
'.:q4', ibu, elconntable, 4)
610 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
611 CALL com_resize_array(surwin//
'.bf2c', ibu, elflag_list, 1)
613 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
614 CALL com_set_size( surwin//
'.bcflag', ibu, 1)
615 CALL com_resize_array(surwin//
'.bcflag', ibu, bcsurfflagone, 1)
622 ptrhex8 => surfmesh_hex8_sf_head
623 DO WHILE(
ASSOCIATED(ptrhex8).eqv..true.)
624 surfaceelonproc = .false.
631 IF(epart(ptrhex8%ElemData(5)).EQ.iprocs) surfaceelonproc = .true.
632 IF(surfaceelonproc)
THEN
636 testnumsurfel = testnumsurfel + 1
637 elconntable(1:4,testnumsurfel) = abs(nodeflag(ptrhex8%ElemData(1:4)))
638 elflag_list(testnumsurfel) = elflag(ptrhex8%ElemData(5))
642 ptrhex8 => ptrhex8%next
645 IF(testnumsurfel.NE.numelhex2d(1,iprocs))
THEN
646 print*,
'ERROR, number of quads from link list in Ignitable interface'
647 print*,
' different then that in read_patran'
648 print*,testnumsurfel,numelhex2d(1,iprocs)
654 CALL com_call_function(
set_option, 2,
'mode',
'w')
657 CALL com_call_function(
set_option, 2,
'mode',
'w')
659 sur_all = com_get_attribute_handle( surwin//
'.all')
663 IF (numnpnew.GT.0)
THEN
664 IF (appendtoggle.EQV..true.)
THEN
665 CALL com_call_function(
set_option, 2,
'mode',
'a')
667 CALL com_call_function(
set_option, 2,
'mode',
'w')
668 appendtoggle = .true.
670 CALL com_call_function(
write_attr, 4,
'Rocin/SurfMesh.'//ichr4, sur_all,&
671 "isolid",
"00.000000")
673 WRITE (*,*)
'iProc = ', iprocs,
' appendToggle = ', appendtoggle
676 CALL com_delete_window( surwin)
684 CALL com_new_window( surwin )
689 IF(numnpnew.NE.0)
THEN
692 nodeflag(nodeflag2d(1,
i)) = nodeflag2d(2,
i)
695 IF(
associated(nodeflag2d).eqv..true.)
deallocate(nodeflag2d)
701 IF(meshtype2d.EQ.6)
THEN
705 ptrtri6 => surfmesh_tri6_sf_nonignt_head
706 DO WHILE(
ASSOCIATED(ptrtri6))
709 glbndnum = ptrtri6%ElemData(
i)
710 IF( nodeflag(glbndnum).GT.0)
THEN
711 numnpnew = numnpnew + 1
712 nodeflag(glbndnum) = -nodeflag(glbndnum)
715 ptrtri6 => ptrtri6%next
720 ptrtri6 => surfmesh_tri6_sf_nonignt_head
721 DO WHILE(
ASSOCIATED(ptrtri6))
723 glbndnum = ptrtri6%ElemData(
i)
724 DO k = 1,maxnumberofprocstosharenode
725 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
726 print*,
'Detected surface sliver for pressure'
727 numnpnew = numnpnew + 1
728 nodeflag(glbndnum) = -nodeflag(glbndnum)
732 ptrtri6 => ptrtri6%next
737 IF(numeltet2d(3,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
738 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
739 print*,
'Found ',numeltet2d(3,iprocs),
'triangles but no nodes'
744 IF(numeltet2d(3,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
745 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
746 print*,
'Found ',numnpnew,
' nodes but no triangles'
754 nodeflag(:)= abs( nodeflag(:))
756 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
761 ptrtri6 => surfmesh_tri6_sf_nonignt_head
762 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
765 glbndnum = ptrtri6%ElemData(
i)
766 IF( nodeflag(glbndnum).GT.0)
THEN
767 numnpnew = numnpnew + 1
770 nodeflag2d(1,numnpnew) = glbndnum
771 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
772 nodeflag(glbndnum) = - numnpnew
775 ptrtri6 => ptrtri6%next
777 ptrtri6 => surfmesh_tri6_sf_nonignt_head
778 DO WHILE(
ASSOCIATED(ptrtri6))
780 glbndnum = ptrtri6%ElemData(
i)
781 DO k = 1,maxnumberofprocstosharenode
782 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
783 numnpnew = numnpnew + 1
784 print*,
'Dectected surface sliver for pressure, writing'
786 nodeflag2d(1,numnpnew) = glbndnum
787 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
788 nodeflag(glbndnum) = - numnpnew
792 ptrtri6 => ptrtri6%next
795 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
796 CALL com_set_size( surwin//
'.nc', inb, numnpnew )
797 CALL com_resize_array(surwin//
'.nc', inb, meshcoor, 3)
800 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
804 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
806 CALL com_set_array(surwin//
'.bv', inb, nodeflag2d(2,1), 2)
811 testnumsurfel = numeltet2d(3,iprocs)
813 CALL com_set_size( surwin//
'.:t6', inb, testnumsurfel)
814 CALL com_resize_array( surwin//
'.:t6', inb, elconntable, 6)
817 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
818 CALL com_resize_array(surwin//
'.bf2c', inb, elflag_list, 1)
820 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
821 CALL com_set_size( surwin//
'.bcflag', inb, 1)
822 CALL com_resize_array(surwin//
'.bcflag', inb, bcsurfflagzero, 1)
824 bcsurfflagzero(1) = 0
829 ptrtri6 => surfmesh_tri6_sf_nonignt_head
830 DO WHILE(
ASSOCIATED(ptrtri6))
831 surfaceelonproc = .false.
833 IF(epart(ptrtri6%ElemData(7)).EQ.iprocs) surfaceelonproc = .true.
834 IF(surfaceelonproc)
THEN
838 testnumsurfel = testnumsurfel + 1
839 elconntable(1:6,testnumsurfel) = abs(nodeflag(ptrtri6%ElemData(1:6)))
840 elflag_list(testnumsurfel) = elflag(ptrtri6%ElemData(7))
846 ptrtri6 => ptrtri6%next
849 IF(testnumsurfel.NE.numeltet2d(3,iprocs))
THEN
850 print*,
'ERROR, number of triangles from link list in Mesh2d'
851 print*,
' different then that in read_patran'
852 print*,testnumsurfel,numeltet2d(3,iprocs)
888 ELSE IF(meshtype2d.EQ.3)
THEN
892 ptrtri3 => surfmesh_tri3_sf_nonignt_head
893 do while(
associated(ptrtri3).eqv..true.)
896 glbndnum = ptrtri3%ElemData(
i)
897 IF( nodeflag(glbndnum).GT.0)
THEN
898 numnpnew = numnpnew + 1
899 nodeflag(glbndnum) = -nodeflag(glbndnum)
902 ptrtri3 => ptrtri3%next
907 ptrtri3 => surfmesh_tri3_sf_nonignt_head
908 do while(
associated(ptrtri3).eqv..true.)
910 glbndnum = ptrtri3%ElemData(
i)
911 DO k = 1,maxnumberofprocstosharenode
912 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
913 print*,
'Dectected surface sliver for pressure'
914 numnpnew = numnpnew + 1
915 nodeflag(glbndnum) = -nodeflag(glbndnum)
920 ptrtri3 => ptrtri3%next
928 IF(numeltet2d(3,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
929 print*,
'ERROR, found in surface mesh for Solid/Fluid interface'
930 print*,
'Found ',numeltet2d(3,iprocs),
'triangles but no nodes'
935 IF(numeltet2d(3,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
936 print*,
'Warning: found in sufrace mesh for Solid/Fluid interface'
937 print*,
'Found ',numnpnew,
' nodes but no triangles'
943 nodeflag(:)= abs( nodeflag(:))
945 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
950 ptrtri3 => surfmesh_tri3_sf_nonignt_head
951 do while(
associated(ptrtri3).eqv..true.)
954 glbndnum = ptrtri3%ElemData(
i)
955 IF( nodeflag(glbndnum).GT.0)
THEN
956 numnpnew = numnpnew + 1
959 nodeflag2d(1,numnpnew) = glbndnum
960 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
961 nodeflag(glbndnum) = - numnpnew
964 ptrtri3 => ptrtri3%next
966 ptrtri3 => surfmesh_tri3_sf_nonignt_head
967 do while(
associated(ptrtri3).eqv..true.)
969 glbndnum = ptrtri3%ElemData(
i)
970 DO k = 1,maxnumberofprocstosharenode
971 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
972 numnpnew = numnpnew + 1
973 print*,
'Dectected surface sliver for pressure, writing'
975 nodeflag2d(1,numnpnew) = glbndnum
976 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
977 nodeflag(glbndnum) = - numnpnew
981 ptrtri3 => ptrtri3%next
984 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
985 CALL com_set_size( surwin//
'.nc', inb, numnpnew )
986 CALL com_resize_array(surwin//
'.nc', inb, meshcoor, 3)
989 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
993 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
995 CALL com_set_array(surwin//
'.bv', inb, nodeflag2d(2,1), 2)
998 testnumsurfel = numeltet2d(3,iprocs)
1000 CALL com_set_size( surwin//
'.:t3', inb, testnumsurfel)
1001 CALL com_resize_array( surwin//
'.:t3', inb, elconntable, 3)
1004 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1005 CALL com_resize_array(surwin//
'.bf2c', inb, elflag_list, 1)
1007 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1008 CALL com_set_size( surwin//
'.bcflag', inb, 1)
1009 CALL com_resize_array(surwin//
'.bcflag', inb, bcsurfflagzero, 1)
1011 bcsurfflagzero(1) = 0
1014 ptrtri3 => surfmesh_tri3_sf_nonignt_head
1015 do while(
associated(ptrtri3).eqv..true.)
1016 surfaceelonproc = .false.
1024 IF(epart(ptrtri3%ElemData(4)).EQ.iprocs) surfaceelonproc = .true.
1025 IF(surfaceelonproc.eqv..true.)
THEN
1028 testnumsurfel = testnumsurfel + 1
1029 elconntable(1:3,testnumsurfel) = abs(nodeflag(ptrtri3%ElemData(1:3)))
1030 elflag_list(testnumsurfel) = elflag(ptrtri3%ElemData(4))
1032 ptrtri3 => ptrtri3%next
1035 IF(testnumsurfel.NE.numeltet2d(3,iprocs))
THEN
1036 print*,
'ERROR, number of triangles from link list in Mesh2d'
1037 print*,
' different then that in read_patran'
1038 print*,
' For Fluid Solid Inteface mesh'
1039 print*,testnumsurfel,numeltet2d(3,iprocs)
1073 ELSE IF(meshtype2d.EQ.4)
THEN
1078 ptrhex8 => surfmesh_hex8_sf_nonignt_head
1079 DO WHILE(
ASSOCIATED(ptrhex8).eqv..true.)
1082 glbndnum = ptrhex8%ElemData(
i)
1083 IF( nodeflag(glbndnum).GT.0)
THEN
1084 numnpnew = numnpnew + 1
1085 nodeflag(glbndnum) = -nodeflag(glbndnum)
1088 ptrhex8 => ptrhex8%next
1093 IF(numelhex2d(3,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
1094 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
1095 print*,
'Found ',numelhex2d(3,iprocs),
'quads but no nodes'
1100 IF(numelhex2d(3,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
1101 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
1102 print*,
'Found ',numnpnew,
' nodes but no quads'
1110 nodeflag(:)= abs( nodeflag(:))
1112 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1116 ptrhex8 => surfmesh_hex8_sf_nonignt_head
1117 do while(
associated(ptrhex8).eqv..true.)
1120 glbndnum = ptrhex8%ElemData(
i)
1121 IF( nodeflag(glbndnum).GT.0)
THEN
1122 numnpnew = numnpnew + 1
1125 nodeflag2d(1,numnpnew) = glbndnum
1126 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1127 nodeflag(glbndnum) = - numnpnew
1130 ptrhex8 => ptrhex8%next
1134 IF (numnpnew.GT.0)
THEN
1135 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1136 CALL com_set_size( surwin//
'.nc', inb, numnpnew )
1137 CALL com_resize_array(surwin//
'.nc', inb, meshcoor, 3)
1140 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1143 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1145 CALL com_set_array(surwin//
'.bv', inb, nodeflag2d(2,1), 2)
1150 testnumsurfel = numelhex2d(3,iprocs)
1152 CALL com_set_size( surwin//
'.:q4', inb, testnumsurfel)
1153 CALL com_resize_array( surwin//
'.:q4', inb, elconntable, 4)
1156 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1157 CALL com_resize_array(surwin//
'.bf2c', inb, elflag_list, 1)
1159 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1160 CALL com_set_size( surwin//
'.bcflag', inb, 1)
1161 CALL com_resize_array(surwin//
'.bcflag', inb, bcsurfflagzero, 1)
1162 bcsurfflagzero(1) = 0
1167 ptrhex8 => surfmesh_hex8_sf_nonignt_head
1168 DO WHILE(
ASSOCIATED(ptrhex8).eqv..true.)
1169 surfaceelonproc = .false.
1171 IF(epart(ptrhex8%ElemData(5)).EQ.iprocs) surfaceelonproc = .true.
1172 IF(surfaceelonproc.eqv..true.)
THEN
1176 testnumsurfel = testnumsurfel + 1
1177 elconntable(1:4,testnumsurfel) = abs(nodeflag(ptrhex8%ElemData(1:4)))
1178 elflag_list(testnumsurfel) = elflag(ptrhex8%ElemData(5))
1182 ptrhex8 => ptrhex8%next
1185 IF(testnumsurfel.NE.numelhex2d(3,iprocs))
THEN
1186 print*,
'ERROR, number of quads from link list in Non-Ignitable surface mesh'
1187 print*,
' different then that in read_patran'
1188 print*,testnumsurfel,numelhex2d(3,iprocs)
1198 IF(numnpnew.NE.0)
THEN
1201 nodeflag(nodeflag2d(1,
i)) = nodeflag2d(2,
i)
1207 CALL com_call_function(
set_option, 2,
'mode',
'a')
1209 sur_all = com_get_attribute_handle( surwin//
'.all')
1212 IF (numnpnew.GT.0)
THEN
1213 IF (appendtoggle.EQV..true.)
THEN
1214 CALL com_call_function(
set_option, 2,
'mode',
'a')
1216 CALL com_call_function(
set_option, 2,
'mode',
'w')
1217 appendtoggle = .true.
1219 CALL com_call_function(
write_attr, 4,
'Rocin/SurfMesh.'//ichr4, sur_all,&
1220 "isolid",
"00.000000")
1222 WRITE (*,*)
'iProc = ', iprocs,
' appendToggle = ', appendtoggle
1225 CALL com_delete_window( surwin)
1227 IF(
associated(nodeflag2d).eqv..true.)
deallocate(nodeflag2d)
1237 CALL com_new_window( surwin)
1239 IF(meshtype2d.EQ.6)
THEN
1244 ptrtri6 => surfmesh_tri6_s_head
1246 DO WHILE(
ASSOCIATED(ptrtri6).eqv..true.)
1249 glbndnum = ptrtri6%ElemData(
i)
1250 IF( nodeflag(glbndnum).GT.0)
THEN
1251 numnpnew = numnpnew + 1
1252 nodeflag(glbndnum) = -nodeflag(glbndnum)
1255 ptrtri6 => ptrtri6%next
1261 ptrtri6 => surfmesh_tri6_s_head
1262 do while(
associated(ptrtri6).eqv..true.)
1264 glbndnum = ptrtri6%ElemData(
i)
1265 DO k = 1,maxnumberofprocstosharenode
1266 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1267 print*,
'Dectected surface sliver for pressure'
1268 numnpnew = numnpnew + 1
1269 nodeflag(glbndnum) = -nodeflag(glbndnum)
1273 ptrtri6 => ptrtri6%next
1279 nodeflag(:)= abs( nodeflag(:))
1281 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1286 ptrtri6 => surfmesh_tri6_s_head
1288 do while(
associated(ptrtri6).eqv..true.)
1291 glbndnum = ptrtri6%ElemData(
i)
1292 IF( nodeflag(glbndnum).GT.0)
THEN
1293 numnpnew = numnpnew + 1
1296 nodeflag2d(1,numnpnew) = glbndnum
1297 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1298 nodeflag(ptrtri6%ElemData(
i)) = - numnpnew
1301 ptrtri6 => ptrtri6%next
1303 ptrtri6 => surfmesh_tri6_s_head
1304 do while(
associated(ptrtri6).eqv..true.)
1306 glbndnum = ptrtri6%ElemData(
i)
1307 DO k = 1,maxnumberofprocstosharenode
1308 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1309 print*,
'Dectected surface sliver for pressure'
1310 numnpnew = numnpnew + 1
1312 nodeflag2d(1,numnpnew) = glbndnum
1313 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1314 nodeflag(glbndnum) = - numnpnew
1318 ptrtri6 => ptrtri6%next
1322 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1323 CALL com_set_size( surwin//
'.nc', ini, numnpnew )
1324 CALL com_resize_array(surwin//
'.nc', ini, meshcoor, 3)
1327 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1331 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1333 CALL com_set_array( surwin//
'.bv', ini, nodeflag2d(2,1), 2)
1337 testnumsurfel = numeltet2d(2,iprocs)
1338 print*,
'Number of Non-Interacting nodes and elements',numnpnew,testnumsurfel
1340 CALL com_set_size( surwin//
'.:t6', ini, testnumsurfel)
1341 CALL com_resize_array( surwin//
'.:t6', ini, elconntable, 6)
1344 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1345 CALL com_resize_array(surwin//
'.bf2c', ini, elflag_list, 1)
1347 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1348 CALL com_set_size( surwin//
'.bcflag', ini, 1)
1349 CALL com_resize_array(surwin//
'.bcflag', ini, bcsurfflagtwo, 1)
1351 bcsurfflagtwo(1) = 2
1354 ptrtri6 => surfmesh_tri6_s_head
1355 do while(
associated(ptrtri6).eqv..true.)
1356 surfaceelonproc = .false.
1363 IF(epart(ptrtri6%ElemData(7)).EQ.iprocs) surfaceelonproc = .true.
1364 IF(surfaceelonproc)
THEN
1370 testnumsurfel = testnumsurfel + 1
1371 elconntable(1:6,testnumsurfel) = abs(nodeflag(ptrtri6%ElemData(1:6)))
1373 ptrtri6 => ptrtri6%next
1376 IF(testnumsurfel.NE.numeltet2d(2,iprocs))
THEN
1377 print*,
'ERROR, number of triangles from link list in Mesh2d'
1378 print*,
' different then that in read_patran'
1379 print*,testnumsurfel,numeltet2d(2,iprocs)
1410 ELSE IF(meshtype2d.EQ.3)
THEN
1416 ptrtri3 => surfmesh_tri3_s_head
1418 do while(
associated(ptrtri3).eqv..true.)
1421 glbndnum = ptrtri3%ElemData(
i)
1422 IF( nodeflag(glbndnum).GT.0)
THEN
1423 numnpnew = numnpnew + 1
1424 nodeflag(glbndnum) = -nodeflag(glbndnum)
1427 ptrtri3 => ptrtri3%next
1433 ptrtri3 => surfmesh_tri3_s_head
1434 do while(
associated(ptrtri3).eqv..true.)
1436 glbndnum = ptrtri3%ElemData(
i)
1437 DO k = 1,maxnumberofprocstosharenode
1438 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1439 print*,
'Dectected surface sliver for pressure'
1440 numnpnew = numnpnew + 1
1441 nodeflag(glbndnum) = -nodeflag(glbndnum)
1445 ptrtri3 => ptrtri3%next
1450 nodeflag(:)= abs( nodeflag(:))
1452 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1457 ptrtri3 => surfmesh_tri3_s_head
1459 do while(
associated(ptrtri3).eqv..true.)
1462 glbndnum = ptrtri3%ElemData(
i)
1463 IF( nodeflag(glbndnum).GT.0)
THEN
1464 numnpnew = numnpnew + 1
1467 nodeflag2d(1,numnpnew) = glbndnum
1468 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1469 nodeflag(ptrtri3%ElemData(
i)) = - numnpnew
1472 ptrtri3 => ptrtri3%next
1474 ptrtri3 => surfmesh_tri3_s_head
1475 do while(
associated(ptrtri3).eqv..true.)
1477 glbndnum = ptrtri3%ElemData(
i)
1478 DO k = 1,maxnumberofprocstosharenode
1479 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1480 print*,
'Dectected surface sliver for pressure'
1481 numnpnew = numnpnew + 1
1483 nodeflag2d(1,numnpnew) = glbndnum
1484 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1485 nodeflag(ptrtri3%ElemData(
i)) = - numnpnew
1489 ptrtri3 => ptrtri3%next
1493 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1494 CALL com_set_size( surwin//
'.nc', ini, numnpnew )
1495 CALL com_resize_array(surwin//
'.nc', ini, meshcoor, 3)
1498 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1501 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1503 CALL com_set_array( surwin//
'.bv', ini, nodeflag2d(2,1), 2)
1507 testnumsurfel = numeltet2d(2,iprocs)
1509 CALL com_set_size( surwin//
'.:t3', ini, testnumsurfel)
1510 CALL com_resize_array( surwin//
'.:t3', ini, elconntable, 3)
1513 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1514 CALL com_resize_array(surwin//
'.bf2c', ini, elflag_list, 1)
1517 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1518 CALL com_set_size( surwin//
'.bcflag', ini,1)
1519 CALL com_resize_array(surwin//
'.bcflag', ini, bcsurfflagtwo, 1)
1521 bcsurfflagtwo(1) = 2
1524 ptrtri3 => surfmesh_tri3_s_head
1525 do while(
associated(ptrtri3).eqv..true.)
1526 surfaceelonproc = .false.
1533 IF(epart(ptrtri3%ElemData(4)).EQ.iprocs) surfaceelonproc = .true.
1534 IF(surfaceelonproc.eqv..true.)
THEN
1540 testnumsurfel = testnumsurfel + 1
1541 elconntable(1:3,testnumsurfel) = abs(nodeflag(ptrtri3%ElemData(1:3)))
1542 elflag_list(testnumsurfel) = elflag(ptrtri3%ElemData(4))
1544 ptrtri3 => ptrtri3%next
1547 IF(testnumsurfel.NE.numeltet2d(2,iprocs))
THEN
1548 print*,
'ERROR, number of triangles from link list in Mesh2d'
1549 print*,
' different then that in read_patran'
1550 print*,testnumsurfel,numeltet2d(2,iprocs)
1579 ELSE IF(meshtype2d.EQ.4)
THEN
1586 ptrhex8 => surfmesh_hex8_s_head
1588 DO WHILE(
ASSOCIATED(ptrhex8).eqv..true.)
1591 glbndnum = ptrhex8%ElemData(
i)
1592 IF( nodeflag(glbndnum).GT.0)
THEN
1593 numnpnew = numnpnew + 1
1594 nodeflag(glbndnum) = -nodeflag(glbndnum)
1597 ptrhex8 => ptrhex8%next
1601 IF(numelhex2d(2,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
1602 print*,
'ERROR, found in surface mesh for Solid/Fluid interface'
1603 print*,
'Found ',numelhex2d(2,iprocs),
'quads but no nodes'
1608 IF(numelhex2d(2,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
1609 print*,
'Warning: found in sufrace mesh for Solid/Fluid interface'
1610 print*,
'Found ',numnpnew,
' nodes but no quads'
1617 nodeflag(:)= abs( nodeflag(:))
1619 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1623 ptrhex8 => surfmesh_hex8_s_head
1624 do while(
associated(ptrhex8).eqv..true.)
1627 glbndnum = ptrhex8%ElemData(
i)
1628 IF( nodeflag(glbndnum).GT.0)
THEN
1629 numnpnew = numnpnew + 1
1631 nodeflag2d(1,numnpnew) = glbndnum
1632 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1633 nodeflag(glbndnum) = - numnpnew
1636 ptrhex8 => ptrhex8%next
1640 IF (numnpnew.GT.0)
THEN
1641 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1642 CALL com_set_size( surwin//
'.nc', ini, numnpnew )
1643 CALL com_resize_array(surwin//
'.nc', ini, meshcoor, 3)
1646 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1650 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1652 CALL com_set_array( surwin//
'.bv', ini, nodeflag2d(2,1), 2)
1656 testnumsurfel = numelhex2d(2,iprocs)
1657 print*,
'Number of Non-Interacting nodes and elements',numnpnew,testnumsurfel
1659 CALL com_set_size( surwin//
'.:q4', ini, testnumsurfel)
1660 CALL com_resize_array( surwin//
'.:q4', ini, elconntable, 4)
1663 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1664 CALL com_resize_array(surwin//
'.bf2c', ini, elflag_list, 1)
1666 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1667 CALL com_set_size( surwin//
'.bcflag', ini, 1)
1668 CALL com_resize_array(surwin//
'.bcflag', ini, bcsurfflagtwo, 1)
1669 bcsurfflagtwo(1) = 2
1678 ptrhex8 => surfmesh_hex8_s_head
1679 do while(
associated(ptrhex8).eqv..true.)
1680 surfaceelonproc = .false.
1681 IF(epart(ptrhex8%ElemData(5)).EQ.iprocs) surfaceelonproc = .true.
1682 IF(surfaceelonproc.eqv..true.)
THEN
1685 testnumsurfel = testnumsurfel + 1
1687 elconntable(1:4,testnumsurfel) = abs(nodeflag(ptrhex8%ElemData(1:4)))
1689 ptrhex8 => ptrhex8%next
1692 IF(testnumsurfel.NE.numelhex2d(2,iprocs))
THEN
1693 print*,
'Error: Number of Solid Surface hex elements in linked list'
1694 print*,
' does not match that given by NumElhex2D(2,iProcs)'
1695 print*,
' In linked list =',testnumsurfel
1696 print*,
' NumElhex2D(2,iProcs) =',numelhex2d(2,iprocs)
1702 IF(
associated(nodeflag2d).eqv..true.)
deallocate(nodeflag2d)
1707 CALL com_call_function(
set_option, 2,
'mode',
'a')
1709 sur_all = com_get_attribute_handle( surwin//
'.all')
1712 IF (numnpnew.GT.0)
THEN
1713 IF (appendtoggle.EQV..true.)
THEN
1714 CALL com_call_function(
set_option, 2,
'mode',
'a')
1716 CALL com_call_function(
set_option, 2,
'mode',
'w')
1717 appendtoggle = .true.
1719 CALL com_call_function(
write_attr, 4,
'Rocin/SurfMesh.'//ichr4, sur_all,&
1720 "isolid",
"00.000000")
1722 WRITE (*,*)
'iProc = ', iprocs,
' appendToggle = ', appendtoggle
1726 CALL com_delete_window( surwin)
1729 IF(
associated(nodeflag2d).eqv..true.)
deallocate(nodeflag2d)
void set_option(const char *option_name, const char *option_val)
Set an option for Rocout, such as controlling the output format.
static void write_attr(std::ostream &os, const COM::Attribute *attr, int i)
subroutine mesh2d(nprocs, iProcs, ichr4)