53 SUBROUTINE mesh2d(nprocs,iProcs,ichr4)
70 LOGICAL :: surfaceelonproc
71 INTEGER :: testnumsurfel
72 INTEGER,
POINTER,
DIMENSION(:,:) :: nodeflag2d
79 TYPE user_type_surfndlist
80 TYPE(link_type
) :: link
82 END TYPE user_type_surfndlist
84 TYPE user_data_type_surfndlist
86 END TYPE user_data_type_surfndlist
89 TYPE user_ptr_type_surfndlist
90 TYPE(user_type_surfndlist
),
POINTER :: p
91 END TYPE user_ptr_type_surfndlist
93 TYPE(user_ptr_type_surfndlist
) :: user_surfndlist
94 TYPE(list_type
) :: surfndlist
96 TYPE(link_ptr_type
) :: link
98 TYPE(surfmesh_tri3_ptr
),
POINTER :: ptrtri3
99 TYPE(surfmesh_tri6_ptr
),
POINTER :: ptrtri6
100 TYPE(surfmesh_hex8_ptr
),
POINTER :: ptrhex8
102 INTEGER,
POINTER,
DIMENSION(:) :: bcsurfflagzero,bcsurfflagone,bcsurfflagtwo
105 CHARACTER(*),
PARAMETER :: surwin =
"sfrac"
107 REAL*8,
POINTER,
DIMENSION(:,:) :: meshcoor
109 INTEGER,
POINTER,
DIMENSION(:) :: elflag_list
112 INTEGER :: inb, ibu, ini
116 write_attr = com_get_function_handle(
'OUT.write_attribute')
117 set_option = com_get_function_handle(
'OUT.set_option')
121 CALL com_call_function(
set_option, 2,
'rankwidth',
'0')
124 CALL com_new_window( surwin )
138 IF(meshtype2d.EQ.6)
THEN
142 ptrtri6 => surfmesh_tri6_sf_head
143 DO WHILE(
ASSOCIATED(ptrtri6))
146 glbndnum = ptrtri6%ElemData(
i)
147 IF( nodeflag(glbndnum).GT.0)
THEN
148 numnpnew = numnpnew + 1
149 nodeflag(glbndnum) = -nodeflag(glbndnum)
152 ptrtri6 => ptrtri6%next
157 ptrtri6 => surfmesh_tri6_sf_head
158 DO WHILE(
ASSOCIATED(ptrtri6))
160 glbndnum = ptrtri6%ElemData(
i)
161 DO k = 1,maxnumberofprocstosharenode
162 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
163 print*,
'Detected surface sliver for pressure'
164 numnpnew = numnpnew + 1
165 nodeflag(glbndnum) = -nodeflag(glbndnum)
169 ptrtri6 => ptrtri6%next
174 IF(numeltet2d(1,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
175 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
176 print*,
'Found ',numeltet2d(1,iprocs),
'triangles but no nodes'
181 IF(numeltet2d(1,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
182 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
183 print*,
'Found ',numnpnew,
' nodes but no triangles'
190 nodeflag(:)= abs( nodeflag(:))
192 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
197 ptrtri6 => surfmesh_tri6_sf_head
198 DO WHILE(
ASSOCIATED(ptrtri6))
201 glbndnum = ptrtri6%ElemData(
i)
202 IF( nodeflag(glbndnum).GT.0)
THEN
203 numnpnew = numnpnew + 1
206 nodeflag2d(1,numnpnew) = glbndnum
207 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
208 nodeflag(glbndnum) = - numnpnew
211 ptrtri6 => ptrtri6%next
213 ptrtri6 => surfmesh_tri6_sf_head
214 DO WHILE(
ASSOCIATED(ptrtri6))
216 glbndnum = ptrtri6%ElemData(
i)
217 DO k = 1,maxnumberofprocstosharenode
218 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
219 numnpnew = numnpnew + 1
220 print*,
'Dectected surface sliver for pressure, writing'
222 nodeflag2d(1,numnpnew) = glbndnum
223 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
224 nodeflag(glbndnum) = - numnpnew
228 ptrtri6 => ptrtri6%next
231 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
232 CALL com_set_size( surwin//
'.nc', ibu, numnpnew )
233 CALL com_allocate_array(surwin//
'.nc', ibu, meshcoor, 3)
236 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
241 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'm')
242 CALL com_set_array( surwin//
'.bv', ibu, nodeflag2d(2,1), 2)
246 testnumsurfel = numeltet2d(1,iprocs)
248 CALL com_set_size( surwin//
'.:t6', ibu, testnumsurfel)
249 CALL com_allocate_array( surwin//
'.:t6', ibu, elconntable, 6)
254 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
255 CALL com_allocate_array(surwin//
'.bf2c', ibu, elflag_list, 1)
257 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
258 CALL com_set_size( surwin//
'.bcflag', ibu, 1)
259 CALL com_allocate_array(surwin//
'.bcflag', ibu, bcsurfflagone, 1)
264 ptrtri6 => surfmesh_tri6_sf_head
265 DO WHILE(
ASSOCIATED(ptrtri6))
266 surfaceelonproc = .false.
274 IF(epart(ptrtri6%ElemData(7)).EQ.iprocs) surfaceelonproc = .true.
275 IF(surfaceelonproc)
THEN
279 testnumsurfel = testnumsurfel + 1
280 elconntable(1:6,testnumsurfel) = abs(nodeflag(ptrtri6%ElemData(1:6)))
281 elflag_list(testnumsurfel) = elflag(ptrtri6%ElemData(7))
288 ptrtri6 => ptrtri6%next
291 IF(testnumsurfel.NE.numeltet2d(1,iprocs))
THEN
292 print*,
'ERROR, number of triangles from link list in for ignitable surfaces'
293 print*,
' different then that in read_patran'
294 print*,testnumsurfel,numeltet2d(1,iprocs)
308 CALL com_call_function(
set_option, 2,
'mode',
'w')
329 ELSE IF(meshtype2d.EQ.3)
THEN
333 ptrtri3 => surfmesh_tri3_sf_head
334 do while(
associated(ptrtri3))
337 glbndnum = ptrtri3%ElemData(
i)
338 IF( nodeflag(glbndnum).GT.0)
THEN
339 numnpnew = numnpnew + 1
340 nodeflag(glbndnum) = -nodeflag(glbndnum)
343 ptrtri3 => ptrtri3%next
348 ptrtri3 => surfmesh_tri3_sf_head
349 do while(
associated(ptrtri3))
351 glbndnum = ptrtri3%ElemData(
i)
352 DO k = 1,maxnumberofprocstosharenode
353 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
354 print*,
'Dectected surface sliver for pressure'
355 numnpnew = numnpnew + 1
356 nodeflag(glbndnum) = -nodeflag(glbndnum)
360 ptrtri3 => ptrtri3%next
365 IF(numeltet2d(1,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
366 print*,
'ERROR, found in surface mesh for Solid/Fluid interface'
367 print*,
'Found ',numeltet2d(1,iprocs),
'triangles but no nodes'
372 IF(numeltet2d(1,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
373 print*,
'Warning: found in sufrace mesh for Solid/Fluid interface'
374 print*,
'Found ',numnpnew,
' nodes but no triangles'
377 nodeflag(:)= abs( nodeflag(:))
379 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
384 ptrtri3 => surfmesh_tri3_sf_head
385 do while(
associated(ptrtri3))
388 glbndnum = ptrtri3%ElemData(
i)
389 IF( nodeflag(glbndnum).GT.0)
THEN
390 numnpnew = numnpnew + 1
393 nodeflag2d(1,numnpnew) = glbndnum
394 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
395 nodeflag(glbndnum) = - numnpnew
398 ptrtri3 => ptrtri3%next
400 ptrtri3 => surfmesh_tri3_sf_head
401 do while(
associated(ptrtri3))
403 glbndnum = ptrtri3%ElemData(
i)
404 DO k = 1,maxnumberofprocstosharenode
405 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
406 numnpnew = numnpnew + 1
407 print*,
'Dectected surface sliver for pressure, writing'
409 nodeflag2d(1,numnpnew) = glbndnum
410 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
411 nodeflag(glbndnum) = - numnpnew
415 ptrtri3 => ptrtri3%next
418 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
419 CALL com_set_size( surwin//
'.nc', ibu, numnpnew )
420 CALL com_allocate_array(surwin//
'.nc', ibu, meshcoor, 3)
423 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
428 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'm')
429 CALL com_set_array( surwin//
'.bv', ibu, nodeflag2d(2,1), 2)
433 testnumsurfel = numeltet2d(1,iprocs)
435 CALL com_set_size( surwin//
'.:t3', ibu, testnumsurfel)
436 CALL com_allocate_array( surwin//
'.:t3', ibu, elconntable, 3)
441 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
442 CALL com_allocate_array(surwin//
'.bf2c', ibu, elflag_list, 1)
444 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
445 CALL com_set_size( surwin//
'.bcflag', ibu, 1)
446 CALL com_allocate_array(surwin//
'.bcflag', ibu, bcsurfflagone, 1)
451 ptrtri3 => surfmesh_tri3_sf_head
452 do while(
associated(ptrtri3))
453 surfaceelonproc = .false.
461 IF(epart(ptrtri3%ElemData(4)).EQ.iprocs) surfaceelonproc = .true.
462 IF(surfaceelonproc)
THEN
466 testnumsurfel = testnumsurfel + 1
467 elconntable(1:3,testnumsurfel) = abs(nodeflag(ptrtri3%ElemData(1:3)))
468 elflag_list(testnumsurfel) = elflag(ptrtri3%ElemData(4))
472 ptrtri3 => ptrtri3%next
475 IF(testnumsurfel.NE.numeltet2d(1,iprocs))
THEN
476 print*,
'ERROR, number of triangles from link list in Ignitable surface mesh'
477 print*,
' different then that in read_patran'
478 print*,
' For Fluid Solid Inteface mesh'
479 print*,testnumsurfel,numeltet2d(1,iprocs)
491 CALL com_call_function(
set_option, 2,
'mode',
'w')
513 ELSE IF(meshtype2d.EQ.4)
THEN
518 ptrhex8 => surfmesh_hex8_sf_head
519 DO WHILE(
ASSOCIATED(ptrhex8))
522 glbndnum = ptrhex8%ElemData(
i)
523 IF( nodeflag(glbndnum).GT.0)
THEN
524 numnpnew = numnpnew + 1
525 nodeflag(glbndnum) = -nodeflag(glbndnum)
528 ptrhex8 => ptrhex8%next
533 IF(numelhex2d(1,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
534 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
535 print*,
'Found ',numelhex2d(1,iprocs),
'quads but no nodes'
540 IF(numelhex2d(1,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
541 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
542 print*,
'Found ',numnpnew,
' nodes but no quads'
553 nodeflag(:)= abs( nodeflag(:))
555 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
562 ptrhex8 => surfmesh_hex8_sf_head
563 do while(
associated(ptrhex8))
566 glbndnum = ptrhex8%ElemData(
i)
567 IF( nodeflag(glbndnum).GT.0)
THEN
568 numnpnew = numnpnew + 1
571 nodeflag2d(1,numnpnew) = glbndnum
572 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
573 nodeflag(glbndnum) = - numnpnew
576 ptrhex8 => ptrhex8%next
579 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
580 CALL com_set_size( surwin//
'.nc', ibu, numnpnew )
581 CALL com_allocate_array(surwin//
'.nc', ibu, meshcoor, 3)
584 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
589 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'm')
590 CALL com_set_array( surwin//
'.bv', ibu, nodeflag2d(2,1), 2)
594 testnumsurfel = numelhex2d(1,iprocs)
596 CALL com_set_size( surwin//
'.:q4', ibu, testnumsurfel)
597 CALL com_allocate_array( surwin//
'.:q4', ibu, elconntable, 4)
602 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
603 CALL com_allocate_array(surwin//
'.bf2c', ibu, elflag_list, 1)
605 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
606 CALL com_set_size( surwin//
'.bcflag', ibu, 1)
607 CALL com_allocate_array(surwin//
'.bcflag', ibu, bcsurfflagone, 1)
612 ptrhex8 => surfmesh_hex8_sf_head
613 DO WHILE(
ASSOCIATED(ptrhex8))
614 surfaceelonproc = .false.
621 IF(epart(ptrhex8%ElemData(5)).EQ.iprocs) surfaceelonproc = .true.
622 IF(surfaceelonproc)
THEN
626 testnumsurfel = testnumsurfel + 1
627 elconntable(1:4,testnumsurfel) = abs(nodeflag(ptrhex8%ElemData(1:4)))
628 elflag_list(testnumsurfel) = elflag(ptrhex8%ElemData(5))
632 ptrhex8 => ptrhex8%next
635 IF(testnumsurfel.NE.numelhex2d(1,iprocs))
THEN
636 print*,
'ERROR, number of quads from link list in Ignitable interface'
637 print*,
' different then that in read_patran'
638 print*,testnumsurfel,numelhex2d(1,iprocs)
644 CALL com_call_function(
set_option, 2,
'mode',
'w')
647 CALL com_call_function(
set_option, 2,
'mode',
'w')
649 sur_all = com_get_attribute_handle( surwin//
'.all')
651 CALL com_call_function(
write_attr, 4,
'Rocin/SurfMesh.'//ichr4, sur_all,&
652 "isolid",
"00.000000")
655 CALL com_delete_window( surwin)
663 CALL com_new_window( surwin )
668 IF(numnpnew.NE.0)
THEN
671 nodeflag(nodeflag2d(1,
i)) = nodeflag2d(2,
i)
674 IF(
associated(nodeflag2d))
deallocate(nodeflag2d)
680 IF(meshtype2d.EQ.6)
THEN
684 ptrtri6 => surfmesh_tri6_sf_nonignt_head
685 DO WHILE(
ASSOCIATED(ptrtri6))
688 glbndnum = ptrtri6%ElemData(
i)
689 IF( nodeflag(glbndnum).GT.0)
THEN
690 numnpnew = numnpnew + 1
691 nodeflag(glbndnum) = -nodeflag(glbndnum)
694 ptrtri6 => ptrtri6%next
699 ptrtri6 => surfmesh_tri6_sf_nonignt_head
700 DO WHILE(
ASSOCIATED(ptrtri6))
702 glbndnum = ptrtri6%ElemData(
i)
703 DO k = 1,maxnumberofprocstosharenode
704 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
705 print*,
'Detected surface sliver for pressure'
706 numnpnew = numnpnew + 1
707 nodeflag(glbndnum) = -nodeflag(glbndnum)
711 ptrtri6 => ptrtri6%next
716 IF(numeltet2d(3,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
717 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
718 print*,
'Found ',numeltet2d(3,iprocs),
'triangles but no nodes'
723 IF(numeltet2d(3,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
724 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
725 print*,
'Found ',numnpnew,
' nodes but no triangles'
733 nodeflag(:)= abs( nodeflag(:))
735 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
740 ptrtri6 => surfmesh_tri6_sf_nonignt_head
741 DO WHILE(
ASSOCIATED(ptrtri6))
744 glbndnum = ptrtri6%ElemData(
i)
745 IF( nodeflag(glbndnum).GT.0)
THEN
746 numnpnew = numnpnew + 1
749 nodeflag2d(1,numnpnew) = glbndnum
750 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
751 nodeflag(glbndnum) = - numnpnew
754 ptrtri6 => ptrtri6%next
756 ptrtri6 => surfmesh_tri6_sf_nonignt_head
757 DO WHILE(
ASSOCIATED(ptrtri6))
759 glbndnum = ptrtri6%ElemData(
i)
760 DO k = 1,maxnumberofprocstosharenode
761 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
762 numnpnew = numnpnew + 1
763 print*,
'Dectected surface sliver for pressure, writing'
765 nodeflag2d(1,numnpnew) = glbndnum
766 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
767 nodeflag(glbndnum) = - numnpnew
771 ptrtri6 => ptrtri6%next
774 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
775 CALL com_set_size( surwin//
'.nc', inb, numnpnew )
776 CALL com_allocate_array(surwin//
'.nc', inb, meshcoor, 3)
779 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
783 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
785 CALL com_set_array(surwin//
'.bv', inb, nodeflag2d(2,1), 2)
790 testnumsurfel = numeltet2d(3,iprocs)
792 CALL com_set_size( surwin//
'.:t6', inb, testnumsurfel)
793 CALL com_allocate_array( surwin//
'.:t6', inb, elconntable, 6)
796 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
797 CALL com_allocate_array(surwin//
'.bf2c', inb, elflag_list, 1)
799 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
800 CALL com_set_size( surwin//
'.bcflag', inb, 1)
801 CALL com_allocate_array(surwin//
'.bcflag', inb, bcsurfflagzero, 1)
803 bcsurfflagzero(1) = 0
808 ptrtri6 => surfmesh_tri6_sf_nonignt_head
809 DO WHILE(
ASSOCIATED(ptrtri6))
810 surfaceelonproc = .false.
812 IF(epart(ptrtri6%ElemData(7)).EQ.iprocs) surfaceelonproc = .true.
813 IF(surfaceelonproc)
THEN
817 testnumsurfel = testnumsurfel + 1
818 elconntable(1:6,testnumsurfel) = abs(nodeflag(ptrtri6%ElemData(1:6)))
819 elflag_list(testnumsurfel) = elflag(ptrtri6%ElemData(7))
825 ptrtri6 => ptrtri6%next
828 IF(testnumsurfel.NE.numeltet2d(3,iprocs))
THEN
829 print*,
'ERROR, number of triangles from link list in Mesh2d'
830 print*,
' different then that in read_patran'
831 print*,testnumsurfel,numeltet2d(3,iprocs)
867 ELSE IF(meshtype2d.EQ.3)
THEN
871 ptrtri3 => surfmesh_tri3_sf_nonignt_head
872 do while(
associated(ptrtri3))
875 glbndnum = ptrtri3%ElemData(
i)
876 IF( nodeflag(glbndnum).GT.0)
THEN
877 numnpnew = numnpnew + 1
878 nodeflag(glbndnum) = -nodeflag(glbndnum)
881 ptrtri3 => ptrtri3%next
886 ptrtri3 => surfmesh_tri3_sf_nonignt_head
887 do while(
associated(ptrtri3))
889 glbndnum = ptrtri3%ElemData(
i)
890 DO k = 1,maxnumberofprocstosharenode
891 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
892 print*,
'Dectected surface sliver for pressure'
893 numnpnew = numnpnew + 1
894 nodeflag(glbndnum) = -nodeflag(glbndnum)
899 ptrtri3 => ptrtri3%next
907 IF(numeltet2d(3,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
908 print*,
'ERROR, found in surface mesh for Solid/Fluid interface'
909 print*,
'Found ',numeltet2d(3,iprocs),
'triangles but no nodes'
914 IF(numeltet2d(3,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
915 print*,
'Warning: found in sufrace mesh for Solid/Fluid interface'
916 print*,
'Found ',numnpnew,
' nodes but no triangles'
922 nodeflag(:)= abs( nodeflag(:))
924 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
929 ptrtri3 => surfmesh_tri3_sf_nonignt_head
930 do while(
associated(ptrtri3))
933 glbndnum = ptrtri3%ElemData(
i)
934 IF( nodeflag(glbndnum).GT.0)
THEN
935 numnpnew = numnpnew + 1
938 nodeflag2d(1,numnpnew) = glbndnum
939 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
940 nodeflag(glbndnum) = - numnpnew
943 ptrtri3 => ptrtri3%next
945 ptrtri3 => surfmesh_tri3_sf_nonignt_head
946 do while(
associated(ptrtri3))
948 glbndnum = ptrtri3%ElemData(
i)
949 DO k = 1,maxnumberofprocstosharenode
950 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
951 numnpnew = numnpnew + 1
952 print*,
'Dectected surface sliver for pressure, writing'
954 nodeflag2d(1,numnpnew) = glbndnum
955 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
956 nodeflag(glbndnum) = - numnpnew
960 ptrtri3 => ptrtri3%next
963 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
964 CALL com_set_size( surwin//
'.nc', inb, numnpnew )
965 CALL com_allocate_array(surwin//
'.nc', inb, meshcoor, 3)
968 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
972 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
974 CALL com_set_array(surwin//
'.bv', inb, nodeflag2d(2,1), 2)
977 testnumsurfel = numeltet2d(3,iprocs)
979 CALL com_set_size( surwin//
'.:t3', inb, testnumsurfel)
980 CALL com_allocate_array( surwin//
'.:t3', inb, elconntable, 3)
983 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
984 CALL com_allocate_array(surwin//
'.bf2c', inb, elflag_list, 1)
986 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
987 CALL com_set_size( surwin//
'.bcflag', inb, 1)
988 CALL com_allocate_array(surwin//
'.bcflag', inb, bcsurfflagzero, 1)
990 bcsurfflagzero(1) = 0
993 ptrtri3 => surfmesh_tri3_sf_nonignt_head
994 do while(
associated(ptrtri3))
995 surfaceelonproc = .false.
1003 IF(epart(ptrtri3%ElemData(4)).EQ.iprocs) surfaceelonproc = .true.
1004 IF(surfaceelonproc)
THEN
1007 testnumsurfel = testnumsurfel + 1
1008 elconntable(1:3,testnumsurfel) = abs(nodeflag(ptrtri3%ElemData(1:3)))
1009 elflag_list(testnumsurfel) = elflag(ptrtri3%ElemData(4))
1011 ptrtri3 => ptrtri3%next
1014 IF(testnumsurfel.NE.numeltet2d(3,iprocs))
THEN
1015 print*,
'ERROR, number of triangles from link list in Mesh2d'
1016 print*,
' different then that in read_patran'
1017 print*,
' For Fluid Solid Inteface mesh'
1018 print*,testnumsurfel,numeltet2d(3,iprocs)
1052 ELSE IF(meshtype2d.EQ.4)
THEN
1057 ptrhex8 => surfmesh_hex8_sf_nonignt_head
1058 DO WHILE(
ASSOCIATED(ptrhex8))
1061 glbndnum = ptrhex8%ElemData(
i)
1062 IF( nodeflag(glbndnum).GT.0)
THEN
1063 numnpnew = numnpnew + 1
1064 nodeflag(glbndnum) = -nodeflag(glbndnum)
1067 ptrhex8 => ptrhex8%next
1072 IF(numelhex2d(3,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
1073 print*,
'ERROR, found in surface mesh for Solid/Fluid Ignitable interface'
1074 print*,
'Found ',numelhex2d(3,iprocs),
'quads but no nodes'
1079 IF(numelhex2d(3,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
1080 print*,
'Warning: found in sufrace mesh for Solid/Fluid Ignitable interface'
1081 print*,
'Found ',numnpnew,
' nodes but no quads'
1089 nodeflag(:)= abs( nodeflag(:))
1091 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1095 ptrhex8 => surfmesh_hex8_sf_nonignt_head
1096 do while(
associated(ptrhex8))
1099 glbndnum = ptrhex8%ElemData(
i)
1100 IF( nodeflag(glbndnum).GT.0)
THEN
1101 numnpnew = numnpnew + 1
1104 nodeflag2d(1,numnpnew) = glbndnum
1105 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1106 nodeflag(glbndnum) = - numnpnew
1109 ptrhex8 => ptrhex8%next
1112 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1113 CALL com_set_size( surwin//
'.nc', inb, numnpnew )
1114 CALL com_allocate_array(surwin//
'.nc', inb, meshcoor, 3)
1117 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1120 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1122 CALL com_set_array(surwin//
'.bv', inb, nodeflag2d(2,1), 2)
1127 testnumsurfel = numelhex2d(3,iprocs)
1129 CALL com_set_size( surwin//
'.:q4', inb, testnumsurfel)
1130 CALL com_allocate_array( surwin//
'.:q4', inb, elconntable, 4)
1133 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1134 CALL com_allocate_array(surwin//
'.bf2c', inb, elflag_list, 1)
1136 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1137 CALL com_set_size( surwin//
'.bcflag', inb, 1)
1138 CALL com_allocate_array(surwin//
'.bcflag', inb, bcsurfflagzero, 1)
1140 bcsurfflagzero(1) = 0
1144 ptrhex8 => surfmesh_hex8_sf_nonignt_head
1145 DO WHILE(
ASSOCIATED(ptrhex8))
1146 surfaceelonproc = .false.
1148 IF(epart(ptrhex8%ElemData(5)).EQ.iprocs) surfaceelonproc = .true.
1149 IF(surfaceelonproc)
THEN
1153 testnumsurfel = testnumsurfel + 1
1154 elconntable(1:4,testnumsurfel) = abs(nodeflag(ptrhex8%ElemData(1:4)))
1155 elflag_list(testnumsurfel) = elflag(ptrhex8%ElemData(5))
1159 ptrhex8 => ptrhex8%next
1162 IF(testnumsurfel.NE.numelhex2d(3,iprocs))
THEN
1163 print*,
'ERROR, number of quads from link list in Non-Ignitable surface mesh'
1164 print*,
' different then that in read_patran'
1165 print*,testnumsurfel,numelhex2d(3,iprocs)
1175 IF(numnpnew.NE.0)
THEN
1178 nodeflag(nodeflag2d(1,
i)) = nodeflag2d(2,
i)
1184 CALL com_call_function(
set_option, 2,
'mode',
'a')
1186 sur_all = com_get_attribute_handle( surwin//
'.all')
1188 CALL com_call_function(
write_attr, 4,
'Rocin/SurfMesh.'//ichr4, sur_all,&
1189 "isolid",
"00.000000")
1192 CALL com_delete_window( surwin)
1194 IF(
associated(nodeflag2d))
deallocate(nodeflag2d)
1204 CALL com_new_window( surwin)
1206 IF(meshtype2d.EQ.6)
THEN
1211 ptrtri6 => surfmesh_tri6_s_head
1213 DO WHILE(
ASSOCIATED(ptrtri6))
1216 glbndnum = ptrtri6%ElemData(
i)
1217 IF( nodeflag(glbndnum).GT.0)
THEN
1218 numnpnew = numnpnew + 1
1219 nodeflag(glbndnum) = -nodeflag(glbndnum)
1222 ptrtri6 => ptrtri6%next
1228 ptrtri6 => surfmesh_tri6_s_head
1229 do while(
associated(ptrtri6))
1231 glbndnum = ptrtri6%ElemData(
i)
1232 DO k = 1,maxnumberofprocstosharenode
1233 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1234 print*,
'Dectected surface sliver for pressure'
1235 numnpnew = numnpnew + 1
1236 nodeflag(glbndnum) = -nodeflag(glbndnum)
1240 ptrtri6 => ptrtri6%next
1246 nodeflag(:)= abs( nodeflag(:))
1248 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1253 ptrtri6 => surfmesh_tri6_s_head
1255 do while(
associated(ptrtri6))
1258 glbndnum = ptrtri6%ElemData(
i)
1259 IF( nodeflag(glbndnum).GT.0)
THEN
1260 numnpnew = numnpnew + 1
1263 nodeflag2d(1,numnpnew) = glbndnum
1264 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1265 nodeflag(ptrtri6%ElemData(
i)) = - numnpnew
1268 ptrtri6 => ptrtri6%next
1270 ptrtri6 => surfmesh_tri6_s_head
1271 do while(
associated(ptrtri6))
1273 glbndnum = ptrtri6%ElemData(
i)
1274 DO k = 1,maxnumberofprocstosharenode
1275 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1276 print*,
'Dectected surface sliver for pressure'
1277 numnpnew = numnpnew + 1
1279 nodeflag2d(1,numnpnew) = glbndnum
1280 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1281 nodeflag(glbndnum) = - numnpnew
1285 ptrtri6 => ptrtri6%next
1289 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1290 CALL com_set_size( surwin//
'.nc', ini, numnpnew )
1291 CALL com_allocate_array(surwin//
'.nc', ini, meshcoor, 3)
1294 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1298 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1300 CALL com_set_array( surwin//
'.bv', ini, nodeflag2d(2,1), 2)
1304 testnumsurfel = numeltet2d(2,iprocs)
1305 print*,
'Number of Non-Interacting nodes and elements',numnpnew,testnumsurfel
1307 CALL com_set_size( surwin//
'.:t6', ini, testnumsurfel)
1308 CALL com_allocate_array( surwin//
'.:t6', ini, elconntable, 6)
1311 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1312 CALL com_allocate_array(surwin//
'.bf2c', ini, elflag_list, 1)
1314 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1315 CALL com_set_size( surwin//
'.bcflag', ini, 1)
1316 CALL com_allocate_array(surwin//
'.bcflag', ini, bcsurfflagtwo, 1)
1318 bcsurfflagtwo(1) = 2
1321 ptrtri6 => surfmesh_tri6_s_head
1322 do while(
associated(ptrtri6))
1323 surfaceelonproc = .false.
1330 IF(epart(ptrtri6%ElemData(7)).EQ.iprocs) surfaceelonproc = .true.
1331 IF(surfaceelonproc)
THEN
1337 testnumsurfel = testnumsurfel + 1
1338 elconntable(1:6,testnumsurfel) = abs(nodeflag(ptrtri6%ElemData(1:6)))
1340 ptrtri6 => ptrtri6%next
1343 IF(testnumsurfel.NE.numeltet2d(2,iprocs))
THEN
1344 print*,
'ERROR, number of triangles from link list in Mesh2d'
1345 print*,
' different then that in read_patran'
1346 print*,testnumsurfel,numeltet2d(2,iprocs)
1377 ELSE IF(meshtype2d.EQ.3)
THEN
1383 ptrtri3 => surfmesh_tri3_s_head
1385 do while(
associated(ptrtri3))
1388 glbndnum = ptrtri3%ElemData(
i)
1389 IF( nodeflag(glbndnum).GT.0)
THEN
1390 numnpnew = numnpnew + 1
1391 nodeflag(glbndnum) = -nodeflag(glbndnum)
1394 ptrtri3 => ptrtri3%next
1400 ptrtri3 => surfmesh_tri3_s_head
1401 do while(
associated(ptrtri3))
1403 glbndnum = ptrtri3%ElemData(
i)
1404 DO k = 1,maxnumberofprocstosharenode
1405 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1406 print*,
'Dectected surface sliver for pressure'
1407 numnpnew = numnpnew + 1
1408 nodeflag(glbndnum) = -nodeflag(glbndnum)
1412 ptrtri3 => ptrtri3%next
1417 nodeflag(:)= abs( nodeflag(:))
1419 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1424 ptrtri3 => surfmesh_tri3_s_head
1426 do while(
associated(ptrtri3))
1429 glbndnum = ptrtri3%ElemData(
i)
1430 IF( nodeflag(glbndnum).GT.0)
THEN
1431 numnpnew = numnpnew + 1
1434 nodeflag2d(1,numnpnew) = glbndnum
1435 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1436 nodeflag(ptrtri3%ElemData(
i)) = - numnpnew
1439 ptrtri3 => ptrtri3%next
1441 ptrtri3 => surfmesh_tri3_s_head
1442 do while(
associated(ptrtri3))
1444 glbndnum = ptrtri3%ElemData(
i)
1445 DO k = 1,maxnumberofprocstosharenode
1446 IF(procndlist(glbndnum,
k).EQ.iprocs.AND.nodeflag(glbndnum).GT.0)
THEN
1447 print*,
'Dectected surface sliver for pressure'
1448 numnpnew = numnpnew + 1
1450 nodeflag2d(1,numnpnew) = glbndnum
1451 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1452 nodeflag(ptrtri3%ElemData(
i)) = - numnpnew
1456 ptrtri3 => ptrtri3%next
1460 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1461 CALL com_set_size( surwin//
'.nc', ini, numnpnew )
1462 CALL com_allocate_array(surwin//
'.nc', ini, meshcoor, 3)
1465 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1468 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1470 CALL com_set_array( surwin//
'.bv', ini, nodeflag2d(2,1), 2)
1474 testnumsurfel = numeltet2d(2,iprocs)
1476 CALL com_set_size( surwin//
'.:t3', ini, testnumsurfel)
1477 CALL com_allocate_array( surwin//
'.:t3', ini, elconntable, 3)
1480 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1481 CALL com_allocate_array(surwin//
'.bf2c', ini, elflag_list, 1)
1484 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1485 CALL com_set_size( surwin//
'.bcflag', ini,1)
1486 CALL com_allocate_array(surwin//
'.bcflag', ini, bcsurfflagtwo, 1)
1488 bcsurfflagtwo(1) = 2
1491 ptrtri3 => surfmesh_tri3_s_head
1492 do while(
associated(ptrtri3))
1493 surfaceelonproc = .false.
1500 IF(epart(ptrtri3%ElemData(4)).EQ.iprocs) surfaceelonproc = .true.
1501 IF(surfaceelonproc)
THEN
1507 testnumsurfel = testnumsurfel + 1
1508 elconntable(1:3,testnumsurfel) = abs(nodeflag(ptrtri3%ElemData(1:3)))
1509 elflag_list(testnumsurfel) = elflag(ptrtri3%ElemData(4))
1511 ptrtri3 => ptrtri3%next
1514 IF(testnumsurfel.NE.numeltet2d(2,iprocs))
THEN
1515 print*,
'ERROR, number of triangles from link list in Mesh2d'
1516 print*,
' different then that in read_patran'
1517 print*,testnumsurfel,numeltet2d(2,iprocs)
1546 ELSE IF(meshtype2d.EQ.4)
THEN
1553 ptrhex8 => surfmesh_hex8_s_head
1555 DO WHILE(
ASSOCIATED(ptrhex8))
1558 glbndnum = ptrhex8%ElemData(
i)
1559 IF( nodeflag(glbndnum).GT.0)
THEN
1560 numnpnew = numnpnew + 1
1561 nodeflag(glbndnum) = -nodeflag(glbndnum)
1564 ptrhex8 => ptrhex8%next
1568 IF(numelhex2d(2,iprocs).NE.0.AND.numnpnew.EQ.0)
THEN
1569 print*,
'ERROR, found in surface mesh for Solid/Fluid interface'
1570 print*,
'Found ',numelhex2d(2,iprocs),
'quads but no nodes'
1575 IF(numelhex2d(2,iprocs).EQ.0.AND.numnpnew.NE.0)
THEN
1576 print*,
'Warning: found in sufrace mesh for Solid/Fluid interface'
1577 print*,
'Found ',numnpnew,
' nodes but no quads'
1584 nodeflag(:)= abs( nodeflag(:))
1586 ALLOCATE(nodeflag2d(1:2,1:numnpnew))
1590 ptrhex8 => surfmesh_hex8_s_head
1591 do while(
associated(ptrhex8))
1594 glbndnum = ptrhex8%ElemData(
i)
1595 IF( nodeflag(glbndnum).GT.0)
THEN
1596 numnpnew = numnpnew + 1
1598 nodeflag2d(1,numnpnew) = glbndnum
1599 nodeflag2d(2,numnpnew) = nodeflag(glbndnum)
1600 nodeflag(glbndnum) = - numnpnew
1603 ptrhex8 => ptrhex8%next
1606 CALL com_new_attribute( surwin//
'.nc',
'n', com_double, 3,
'm')
1607 CALL com_set_size( surwin//
'.nc', ini, numnpnew )
1608 CALL com_allocate_array(surwin//
'.nc', ini, meshcoor, 3)
1611 meshcoor(1:3,
i) = coor(1:3,nodeflag2d(1,
i))
1615 CALL com_new_attribute( surwin//
'.bv',
'n', com_integer, 1,
'')
1617 CALL com_set_array( surwin//
'.bv', ini, nodeflag2d(2,1), 2)
1621 testnumsurfel = numelhex2d(2,iprocs)
1622 print*,
'Number of Non-Interacting nodes and elements',numnpnew,testnumsurfel
1624 CALL com_set_size( surwin//
'.:q4', ini, testnumsurfel)
1625 CALL com_allocate_array( surwin//
'.:q4', ini, elconntable, 4)
1628 CALL com_new_attribute( surwin//
'.bf2c',
'e', com_integer, 1,
'')
1629 CALL com_allocate_array(surwin//
'.bf2c', ini, elflag_list, 1)
1631 CALL com_new_attribute( surwin//
'.bcflag',
'p', com_integer, 1,
'')
1632 CALL com_set_size( surwin//
'.bcflag', ini, 1)
1633 CALL com_allocate_array(surwin//
'.bcflag', ini, bcsurfflagtwo, 1)
1636 bcsurfflagtwo(1) = 2
1641 ptrhex8 => surfmesh_hex8_s_head
1642 do while(
associated(ptrhex8))
1643 surfaceelonproc = .false.
1644 IF(epart(ptrhex8%ElemData(5)).EQ.iprocs) surfaceelonproc = .true.
1645 IF(surfaceelonproc)
THEN
1648 testnumsurfel = testnumsurfel + 1
1650 elconntable(1:4,testnumsurfel) = abs(nodeflag(ptrhex8%ElemData(1:4)))
1652 ptrhex8 => ptrhex8%next
1655 IF(testnumsurfel.NE.numelhex2d(2,iprocs))
THEN
1656 print*,
'Error: Number of Solid Surface hex elements in linked list'
1657 print*,
' does not match that given by NumElhex2D(2,iProcs)'
1658 print*,
' In linked list =',testnumsurfel
1659 print*,
' NumElhex2D(2,iProcs) =',numelhex2d(2,iprocs)
1665 IF(
associated(nodeflag2d))
deallocate(nodeflag2d)
1670 CALL com_call_function(
set_option, 2,
'mode',
'a')
1672 sur_all = com_get_attribute_handle( surwin//
'.all')
1674 CALL com_call_function(
write_attr, 4,
'Rocin/SurfMesh.'//ichr4, sur_all,&
1675 "isolid",
"00.000000")
1678 CALL com_delete_window( surwin)
1681 IF(
associated(nodeflag2d))
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)