From 7dfcc480ba1e19bd3232349fc733caef94034292 Mon Sep 17 00:00:00 2001 From: stainer_t Date: Mon, 8 Sep 2025 13:48:49 +0200 Subject: Initial commit from Polytechnique Montreal --- Donjon/src/NAPFTD.f | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Donjon/src/NAPFTD.f (limited to 'Donjon/src/NAPFTD.f') diff --git a/Donjon/src/NAPFTD.f b/Donjon/src/NAPFTD.f new file mode 100644 index 0000000..a1058a7 --- /dev/null +++ b/Donjon/src/NAPFTD.f @@ -0,0 +1,58 @@ +*DECK NAPFTD + SUBROUTINE NAPFTD(NXP,MXP,NXD,MXD,FXTD) +* +*----------------------------------------------------------------------- +* +*Purpose: +* Perform a projection of second geometry on first one to compute +* fraction of region of the first geometry occupied by the second +* geometry regions +* +*Copyright: +* Copyright (C) 2014 Ecole Polytechnique de Montreal. +* +*Author(s): +* R. Chambon +* +*Parameters: input/output +* for core with heterogeneous mixture +* NXP number of region along X direction for first geometry +* MXP mesh of region along X direction for first geometry +* NXD number of region along X direction for second geometry +* MXD mesh of region along X direction for second geometry +* FXTD fraction of region along X direction +* +*----------------------------------------------------------------------- +* + USE GANLIB + IMPLICIT NONE +*---- +* SUBROUTINE ARGUMENTS +*---- + INTEGER NXP,NXD + REAL MXP(NXP),MXD(NXD),FXTD(NXP,NXD) +*---- +* LOCAL VARIABLES +*---- + INTEGER IP,ID + REAL DXP + + DO IP=1,NXP + DXP=MXP(IP+1)-MXP(IP) + DO ID=1,NXD + IF((MXD(ID).LE.MXP(IP)).AND.(MXD(ID+1).GE.MXP(IP+1))) THEN + FXTD(IP,ID)=1.0 + ELSEIF ((MXD(ID).LE.MXP(IP)).AND.(MXD(ID+1).GT.MXP(IP))) THEN + FXTD(IP,ID)=(MXD(ID+1)-MXP(IP))/DXP + ELSEIF ((MXD(ID).GE.MXP(IP)).AND. + 1 (MXD(ID+1).LE.MXP(IP+1))) THEN + FXTD(IP,ID)=(MXD(ID+1)-MXD(ID))/DXP + ELSEIF ((MXD(ID).LT.MXP(IP+1)).AND. + 1 (MXD(ID+1).GE.MXP(IP+1))) THEN + FXTD(IP,ID)=(MXP(IP+1)-MXD(ID))/DXP + ENDIF + ENDDO + ENDDO + + RETURN + END -- cgit v1.2.3