From 027b346a842b22b18c2ff9e2fd34eb8925954860 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Wed, 21 Apr 2021 16:01:01 +0200 Subject: [PATCH] Copy input files to output folder After reading the input, the code copies the JSON input file but the mesh(es) to the output directory. --- src/modules/mesh/moduleMesh.f90 | 5 +++++ src/modules/moduleInput.f90 | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/modules/mesh/moduleMesh.f90 b/src/modules/mesh/moduleMesh.f90 index 1f6c795..1b1f70a 100644 --- a/src/modules/mesh/moduleMesh.f90 +++ b/src/modules/mesh/moduleMesh.f90 @@ -417,6 +417,11 @@ MODULE moduleMesh END INTERFACE + !Logical to indicate if an specific mesh for MC Collisions is used + LOGICAL:: doubleMesh + !Complete path for the two meshes + CHARACTER(:), ALLOCATABLE:: pathMeshColl, pathMeshParticle + CONTAINS !Constructs the global K matrix SUBROUTINE constructGlobalK(self) diff --git a/src/modules/moduleInput.f90 b/src/modules/moduleInput.f90 index b63427c..b420861 100644 --- a/src/modules/moduleInput.f90 +++ b/src/modules/moduleInput.f90 @@ -11,6 +11,7 @@ MODULE moduleInput USE moduleBoundary USE moduleInject USE moduleOutput + USE moduleMesh IMPLICIT NONE CHARACTER(:), ALLOCATABLE, INTENT(in):: inputFile @@ -71,6 +72,14 @@ MODULE moduleInput !If everything is correct, creates the output folder CALL EXECUTE_COMMAND_LINE('mkdir ' // path // folder ) + !Copies input file to output folder + CALL EXECUTE_COMMAND_LINE('cp ' // inputFile // ' ' // path // folder) + !Copies particle mesh + CALL EXECUTE_COMMAND_LINE('cp ' // pathMeshParticle // ' ' // path // folder) + IF (doubleMesh) THEN + CALL EXECUTE_COMMAND_LINE('cp ' // pathMeshColl // ' ' // path // folder) + + END IF END SUBROUTINE readConfig @@ -780,9 +789,7 @@ MODULE moduleInput TYPE(json_file), INTENT(inout):: config LOGICAL:: found - LOGICAL:: doubleMesh CHARACTER(:), ALLOCATABLE:: meshFormat, meshFile - CHARACTER(:), ALLOCATABLE:: fullPath REAL(8):: volume !Firstly, indicates if a specific mesh for MC collisions is being use @@ -810,14 +817,14 @@ MODULE moduleInput !Reads the mesh file CALL config%get('geometry.meshFile', meshFile, found) - fullpath = path // meshFile - CALL mesh%readMesh(fullPath) - DEALLOCATE(fullPath, meshFile) + pathMeshParticle = path // meshFile + CALL mesh%readMesh(pathMeshParticle) + DEALLOCATE(meshFile) IF (doubleMesh) THEN !Reads the mesh file for collisions CALL config%get('interactions.meshCollisions', meshFile, found) - fullpath = path // meshFile - CALL meshColl%readMesh(fullPath) + pathMeshColl = path // meshFile + CALL meshColl%readMesh(pathMeshColl) END IF