Big one...
I should've commited before, but I wanted to make things compile. The big change is that I've added a global time step so the parameter does not need to be passed in each function. This is useful as we are moving towards using time profiles for boundary conditions and injection of particles (not in this branch, but in the future and the procedure will be quite similar)
This commit is contained in:
parent
49025a6965
commit
ac27725940
14 changed files with 340 additions and 220 deletions
|
|
@ -215,17 +215,16 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
END SUBROUTINE writeEM
|
||||
|
||||
SUBROUTINE writeCollection(fileID, t, fileNameStep, fileNameCollection)
|
||||
SUBROUTINE writeCollection(fileID, fileNameStep, fileNameCollection)
|
||||
USE moduleCaseParam
|
||||
USE moduleOutput
|
||||
USE moduleRefParam
|
||||
IMPLICIT NONE
|
||||
|
||||
INTEGER:: fileID
|
||||
INTEGER, INTENT(in):: t
|
||||
CHARACTER(*):: fileNameStep, fileNameCollection
|
||||
|
||||
IF (t == tInitial) THEN
|
||||
IF (timeStep == tInitial) THEN
|
||||
!Create collection file
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileNameCollection
|
||||
OPEN (fileID + 1, file = path // folder // '/' // fileNameCollection)
|
||||
|
|
@ -237,10 +236,11 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
!Write iteration file in collection
|
||||
OPEN (fileID + 1, file = path // folder // '/' // fileNameCollection, ACCESS='APPEND')
|
||||
WRITE(fileID + 1, "(4X, A, ES20.6E3, A, A, A)") '<DataSet timestep="', DBLE(t)*tauMin*ti_ref,'" file="', fileNameStep,'"/>'
|
||||
WRITE(fileID + 1, "(4X, A, ES20.6E3, A, A, A)") &
|
||||
'<DataSet timestep="', DBLE(timeStep)*tauMin*ti_ref,'" file="', fileNameStep,'"/>'
|
||||
|
||||
!Close collection file
|
||||
IF (t == tFinal) THEN
|
||||
IF (timeStep == tFinal) THEN
|
||||
WRITE (fileID + 1, "(2X, A)") '</Collection>'
|
||||
WRITE (fileID + 1, "(A)") '</VTKFile>'
|
||||
|
||||
|
|
@ -307,21 +307,21 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
END SUBROUTINE writeAverage
|
||||
|
||||
SUBROUTINE printOutputVTU(self,t)
|
||||
SUBROUTINE printOutputVTU(self)
|
||||
USE moduleMesh
|
||||
USE moduleSpecies
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshParticles), INTENT(in):: self
|
||||
INTEGER, INTENT(in):: t
|
||||
INTEGER:: i, fileID
|
||||
CHARACTER(:), ALLOCATABLE:: fileName, fileNameCollection
|
||||
|
||||
fileID = 60
|
||||
|
||||
DO i = 1, nSpecies
|
||||
fileName = formatFileName(prefix, species(i)%obj%name, 'vtu', t)
|
||||
fileName = formatFileName(prefix, species(i)%obj%name, 'vtu', timeStep)
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
|
|
@ -337,28 +337,27 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
!Write collection file for time plotting
|
||||
fileNameCollection = formatFileName('Collection', species(i)%obj%name, 'pvd')
|
||||
CALL writeCollection(fileID, t, fileName, filenameCollection)
|
||||
CALL writeCollection(fileID, fileName, filenameCollection)
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE printOutputVTU
|
||||
|
||||
SUBROUTINE printCollVTU(self,t)
|
||||
SUBROUTINE printCollVTU(self)
|
||||
USE moduleMesh
|
||||
USE moduleOutput
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshGeneric), INTENT(in):: self
|
||||
INTEGER, INTENT(in):: t
|
||||
INTEGER:: fileID
|
||||
CHARACTER(:), ALLOCATABLE:: fileName, fileNameCollection
|
||||
CHARACTER (LEN=iterationDigits):: tstring
|
||||
|
||||
fileID = 62
|
||||
|
||||
IF (collOutput) THEN
|
||||
fileName = formatFileName(prefix, 'Collisions', 'vtu', t)
|
||||
fileName = formatFileName(prefix, 'Collisions', 'vtu', timeStep)
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
|
|
@ -374,26 +373,26 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
!Write collection file for time plotting
|
||||
fileNameCollection = formatFileName('Collection', 'Collisions', 'pvd')
|
||||
CALL writeCollection(fileID, t, fileName, filenameCollection)
|
||||
CALL writeCollection(fileID, fileName, filenameCollection)
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE printCollVTU
|
||||
|
||||
SUBROUTINE printEMVTU(self, t)
|
||||
SUBROUTINE printEMVTU(self)
|
||||
USE moduleMesh
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshParticles), INTENT(in):: self
|
||||
INTEGER, INTENT(in):: t
|
||||
INTEGER:: fileID
|
||||
CHARACTER(:), ALLOCATABLE:: fileName, fileNameCollection
|
||||
|
||||
fileID = 64
|
||||
|
||||
IF (emOutput) THEN
|
||||
fileName = formatFileName(prefix, 'EMField', 'vtu', t)
|
||||
fileName = formatFileName(prefix, 'EMField', 'vtu', timeStep)
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
|
|
@ -409,7 +408,7 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
!Write collection file for time plotting
|
||||
fileNameCollection = formatFileName('Collection', 'EMField', 'pvd')
|
||||
CALL writeCollection(fileID, t, fileName, filenameCollection)
|
||||
CALL writeCollection(fileID, fileName, filenameCollection)
|
||||
|
||||
END IF
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue