only read relevant lines
This commit is contained in:
parent
57db134c6d
commit
7b0850f929
|
@ -119,21 +119,24 @@ subroutine mesh_init
|
||||||
|
|
||||||
if (worldrank == 0) then
|
if (worldrank == 0) then
|
||||||
fileContent = IO_read_ASCII(geometryFile)
|
fileContent = IO_read_ASCII(geometryFile)
|
||||||
j = 0
|
|
||||||
l = 0
|
l = 0
|
||||||
found = .false.
|
|
||||||
do
|
do
|
||||||
l = l + 1
|
l = l + 1
|
||||||
if (IO_isBlank(fileContent(l))) cycle ! need also to ignore C and C++ style comments?
|
if (IO_isBlank(fileContent(l))) cycle ! need also to ignore C and C++ style comments?
|
||||||
if (trim(fileContent(l)) == '$EndElements') exit
|
if (trim(fileContent(l)) == '$Elements') then
|
||||||
if (trim(fileContent(l)) == '$Elements') found = .true.
|
j = 0
|
||||||
if (found) then
|
l = l + 1
|
||||||
chunkPos = IO_stringPos(fileContent(l))
|
do
|
||||||
if (chunkPos(1) == 3+IO_intValue(fileContent(l),chunkPos,3)+dimPlex+1) then
|
l = l + 1
|
||||||
call DMSetLabelValue(globalMesh,'material',j,IO_intValue(fileContent(l),chunkPos,4),ierr)
|
if (trim(fileContent(l)) == '$EndElements') exit
|
||||||
CHKERRQ(ierr)
|
chunkPos = IO_stringPos(fileContent(l))
|
||||||
j = j + 1
|
if (chunkPos(1) == 3+IO_intValue(fileContent(l),chunkPos,3)+dimPlex+1) then
|
||||||
endif ! count all identifiers to allocate memory and do sanity check
|
call DMSetLabelValue(globalMesh,'material',j,IO_intValue(fileContent(l),chunkPos,4),ierr)
|
||||||
|
CHKERRQ(ierr)
|
||||||
|
j = j + 1
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
exit
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
call DMClone(globalMesh,geomMesh,ierr)
|
call DMClone(globalMesh,geomMesh,ierr)
|
||||||
|
|
Loading…
Reference in New Issue