From f9dcd181c841772f4756bd36247e03c507a14a20 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Mon, 18 Oct 2021 10:29:45 +0200 Subject: [PATCH] Issue reading EM field Fixed an issue reading the EM field from input file. --- src/modules/moduleInput.f90 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/modules/moduleInput.f90 b/src/modules/moduleInput.f90 index d97f92c..56f5f79 100644 --- a/src/modules/moduleInput.f90 +++ b/src/modules/moduleInput.f90 @@ -172,7 +172,7 @@ MODULE moduleInput CHARACTER(:), ALLOCATABLE:: object !simulation final and initial times in [t] REAL(8):: finalTime, initialTime - CHARACTER(:), ALLOCATABLE:: pusherType, EMType, WSType + CHARACTER(:), ALLOCATABLE:: pusherType, WSType INTEGER:: nTau, nSolver INTEGER:: i CHARACTER(2):: iString @@ -221,15 +221,6 @@ MODULE moduleInput END DO - !Gets the solver for the electromagnetic field - CALL config%get(object // '.EMSolver', EMType, found) - CALL solver%initEM(EMType) - SELECT CASE(EMType) - CASE("Electrostatic") - CALL readEMBoundary(config) - - END SELECT - !Gest the non-analogue scheme CALL config%get(object // '.WeightingScheme', WSType, found) CALL solver%initWS(WSType) @@ -809,12 +800,13 @@ MODULE moduleInput USE moduleErrors USE moduleOutput USE moduleRefParam + USE moduleSolver USE json_module IMPLICIT NONE TYPE(json_file), INTENT(inout):: config LOGICAL:: found - CHARACTER(:), ALLOCATABLE:: meshFormat, meshFile + CHARACTER(:), ALLOCATABLE:: meshFormat, meshFile, EMType REAL(8):: volume !Firstly, indicates if a specific mesh for MC collisions is being use @@ -906,6 +898,16 @@ MODULE moduleInput END IF + !Gest EM solver + CALL config%get('case.EMSolver', EMType, found) + CALL solver%initEM(EMType) + SELECT CASE(EMType) + CASE("Electrostatic") + !Reads BC + CALL readEMBoundary(config) + + END SELECT + END SUBROUTINE readGeometry SUBROUTINE readProbes(config)