From e92e5cae5351d248e4786f0ed47bb4a55211c495 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 18 Jul 2011 09:15:20 +0000 Subject: [PATCH] restarting now works with Abaqus (standard, cannot test explicit due to lack of license) you have to specify the job you are restarting from in the job description (cae), if you prepare your input file by hand this is the first line after *Heading example: if the first job was using Oldjob.inp the first entry in the job description needs to be Oldjob (without the .inp) as for Marc restart works only from last converged increment, i.e. ther restart writing should be specified like this: *retsart, write, frequency=1, overlay Overlay is not essential but saves a lot of disk space and as stated before you can only restart from the last converged increment anyway --- code/FEsolving.f90 | 18 +++++++++++++----- code/IO.f90 | 10 ++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index 99957e147..03408a921 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -80,9 +80,14 @@ restartRead = iand(IO_intValue(line,positions,1),2_pInt) > 0_pInt case ('*restart') do i=2,positions(1) - restartWrite = IO_lc(IO_StringValue(line,positions,i)) == 'write' -! restartRead = IO_lc(IO_StringValue(line,positions,i)) == 'read' + restartWrite = (IO_lc(IO_StringValue(line,positions,i)) == 'write') .or. restartWrite + restartRead = (IO_lc(IO_StringValue(line,positions,i)) == 'read') .or. restartRead enddo + if(restartWrite) then + do i=2,positions(1) + restartWrite = (IO_lc(IO_StringValue(line,positions,i)) /= 'frequency=0') .and. restartWrite + enddo + endif end select enddo else @@ -103,13 +108,16 @@ IO_lc(IO_stringValue(line,positions,4)) == 'id' ) & FEmodelGeometry = IO_StringValue(line,positions,6) enddo - elseif (FEsolver == 'Abaqus' .and. IO_open_jobFile(fileunit, 'com')) then + elseif (FEsolver == 'Abaqus' .and. IO_open_inputFile(fileunit,FEmodelGeometry)) then rewind(fileunit) do read (fileunit,'(a1024)',END=200) line positions = IO_stringPos(line,maxNchunks) -! if ( IO_lc(IO_stringValue(line,positions,?)) == 'oldjob?') & -! FEmodelGeometry = IO_StringValue(line,positions,?) + if ( IO_lc(IO_stringValue(line,positions,1))=='*heading') then + read (fileunit,'(a1024)',END=200) line + positions = IO_stringPos(line,maxNchunks) + FEmodelGeometry = IO_StringValue(line,positions,1) + endif enddo else call IO_error(106) ! cannot open file for old job info diff --git a/code/IO.f90 b/code/IO.f90 index c077a697f..f08387661 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -76,12 +76,18 @@ recursive function IO_abaqus_assembleInputFile(unit1,unit2) result(createSuccess character(len=300) line,fname integer(pInt), intent(in) :: unit1, unit2 logical createSuccess,fexist + integer(pInt), parameter :: maxNchunks = 6 + integer(pInt), dimension(1+2*maxNchunks) :: positions + do read(unit2,'(A300)',END=220) line - line = IO_lc(trim(line)) +! line = IO_lc(trim(line)) +! do not change the whole line to lower case, file names in Linux are case sensitive! + positions = IO_stringPos(line,maxNchunks) + ! call IO_lcInPlace(line) - if (line(1:8)=='*include') then + if (IO_lc(IO_StringValue(line,positions,1))=='*include') then fname = trim(getSolverWorkingDirectoryName())//trim(line(9+scan(line(9:),'='):)) inquire(file=fname, exist=fexist) if (.not.(fexist)) then