summaryrefslogtreecommitdiff
path: root/Dragon/src/XELTSA.f
blob: d3e32af8f9866fa3179bdbc39973264afe07b60f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
*DECK XELTSA
      SUBROUTINE XELTSA(NDIM,ITYPBC,ABSC,INDC,DENS,ANGTSA)
*
*-----------------------------------------------------------------------
*
*Purpose:
* To compute the integration points and periodic density
* for cyclic tracking.
*
*Copyright:
* Copyright (C) 1994 Ecole Polytechnique de Montreal.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): R. Roy
*
*Parameters: input
* NDIM   number of dimensions for the problem.
* ITYPBC type of boundary condition (=0/2: Cartesian/hexagonal).
* ABSC   multidimensional width of the cell.
* INDC   index of each coordinate of the angles.
*
*Parameters: output
* DENS   effective periodic density.
* ANGTSA tracking direction and its normal.
*
*Reference:
* R. Roy, G. Marleau, A. Hebert and D. Rozon,
* A Cyclic Tracking Procedure for Collision Probability Calculations
* in 2-D Lattice', Advances in Mathematics, Computations and 
* Reactor Physics, Pittsburgh, PA, April 28 - May 2 (1991).
*
*-----------------------------------------------------------------------
*
      IMPLICIT NONE
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER          NDIM,ITYPBC
      DOUBLE PRECISION ABSC(2)
      INTEGER          INDC(NDIM)
      DOUBLE PRECISION DENS
      DOUBLE PRECISION ANGTSA(NDIM,NDIM)
*----
*  LOCAL PARAMETERS
*----
      INTEGER          IOUT
      CHARACTER        NAMSBR*6
      PARAMETER       (IOUT=6,NAMSBR='XELTSA')
*----
*  LOCAL VARIABLES
*----
      INTEGER          IDIM
      IF(NDIM .NE. 2) CALL XABORT(NAMSBR//
     >': Only 2-D problems permitted yet')
      DENS=0.0D0
      DO 10 IDIM= 1,NDIM
         IF(ITYPBC.EQ.0) THEN
            ! Cartesian boundary
            ANGTSA(IDIM,1)= REAL(INDC(IDIM))/ABSC(NDIM+1-IDIM)
         ELSE
            ! hexagonal boundary
            IF(IDIM.EQ.1) THEN
              ANGTSA(IDIM,1)= REAL(INDC(IDIM))*SQRT(3.D0)
            ELSE
              ANGTSA(IDIM,1)= REAL(INDC(IDIM))
            ENDIF
         ENDIF
         DENS= DENS + ANGTSA(IDIM,1)*ANGTSA(IDIM,1)
   10 CONTINUE
      DENS= SQRT(DENS)
*----
*  ANGTSA(*,1) is the track direction 
*----
      DO 20 IDIM= 1,NDIM
         ANGTSA(IDIM,1)= ANGTSA(IDIM,1)/DENS
   20 CONTINUE
*----
*  ANGTSA(*,2) is a normal to track direction
*----
      ANGTSA(2,2)= -ANGTSA(1,1)
      ANGTSA(1,2)=  ANGTSA(2,1)
*----
*  Processing finished, return
*----
      RETURN
      END