From 4da3bf120cea62171e1777b764aed99e93b4c934 Mon Sep 17 00:00:00 2001 From: JGonzalez Date: Mon, 13 Apr 2026 19:49:53 +0200 Subject: [PATCH] Structure for Neumann BC --- src/modules/mesh/moduleMesh.f90 | 27 ++++++++++++++++++++++ src/modules/mesh/moduleMesh@boundaryEM.f90 | 21 +++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/modules/mesh/moduleMesh.f90 b/src/modules/mesh/moduleMesh.f90 index e257cf2..5fc6f2e 100644 --- a/src/modules/mesh/moduleMesh.f90 +++ b/src/modules/mesh/moduleMesh.f90 @@ -1056,6 +1056,33 @@ MODULE moduleMesh end interface + ! Neumann boundary condition (constant electric field normal to edge) + type, extends(boundaryEMGeneric):: boundaryEMNeumann + real(8):: electricField ! Electric field normal to the edge + contains + ! boundaryEMGeneric deferred procedures + procedure, pass:: apply => applyNeumann + + end type boundaryEMNeumann + + interface + module subroutine initNeumann(self, config, object) + use json_module + + class(boundaryEMGeneric), allocatable, intent(inout):: self + type(json_file), intent(inout):: config + character(:), allocatable, intent(in):: object + + end subroutine initNeumann + + module subroutine applyNeumann(self, vectorF) + class(boundaryEMNeumann), intent(in):: self + real(8), intent(inout):: vectorF(:) + + end subroutine applyNeumann + + end interface + ! Floating: Floating surface, ie, zero net current type, extends(boundaryEMGeneric):: boundaryEMFloating real(8):: potential diff --git a/src/modules/mesh/moduleMesh@boundaryEM.f90 b/src/modules/mesh/moduleMesh@boundaryEM.f90 index f20804a..19dde6c 100644 --- a/src/modules/mesh/moduleMesh@boundaryEM.f90 +++ b/src/modules/mesh/moduleMesh@boundaryEM.f90 @@ -123,6 +123,27 @@ submodule(moduleMesh) boundaryEM end subroutine updateDirichletTime + ! Neumann constant value + ! Init + module subroutine initNeumann(self, config, object) + use json_module + implicit none + + class(boundaryEMGeneric), allocatable, intent(inout):: self + type(json_file), intent(inout):: config + character(:), allocatable, intent(in):: object + + end subroutine initNeumann + + ! Apply + module subroutine applyNeumann(self, vectorF) + implicit none + + class(boundaryEMNeumann), intent(in):: self + real(8), intent(inout):: vectorF(:) + + end subroutine applyNeumann + ! Floating surface ! Init module subroutine initFloating(self, config, object)