summaryrefslogtreecommitdiff
path: root/Trivac/src/FLDTH2.f
blob: f90b0beabcafd5a78f72f04ce46ac911b23ed92e (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
*DECK FLDTH2
      SUBROUTINE FLDTH2 (ISPLH,NEL,NUN,EVECT,MAT,VOL,IDL,KN)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Calculation of the averaged flux with a linear Lagrangian finite
* element or mesh corner finite difference method in hexagonal geometry.
*
*Copyright:
* Copyright (C) 2002 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): A. Hebert
*
*Parameters: input
* ISPLH   type of hexagonal mesh-splitting: =1 for complete hexagons;
*         =2 for triangular mesh-splitting.
* NEL     total number of finite elements.
* NUN     total number of unknowns per energy group.
* EVECT   variational coefficients of the flux. The information is
*         contained in position EVECT(1) to EVECT(LL4) where LL4 is
*         the order of the system matrices.
* MAT     mixture index assigned to each element.
* VOL     volume of each element.
* IDL     position of the average flux component associated with each
*         volume.
* KN      element-ordered unknown list.
*
*Parameters: output
* EVECT   averaged fluxes. The information is contained in positions
*         EVECT(IDL(I)).
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER ISPLH,NEL,NUN,MAT(NEL),IDL(NEL),KN(14*NEL)
      REAL EVECT(NUN),VOL(NEL)
*----
*  LOCAL VARIABLES
*----
      REAL TH(14)
      SAVE TH
      DATA TH/3*0.055555555556,0.166666666667,6*0.055555555556,
     1 0.166666666667,3*0.055555555556/
*
      NUM1=0
      IF(ISPLH.EQ.1) THEN
         SS=1.0/12.0
         DO 40 K=1,NEL
         IF(MAT(K).EQ.0) GO TO 40
         EVECT(IDL(K))=0.0
         IF(VOL(K).EQ.0.0) GO TO 30
         DO 20 I=1,12
         IND1=KN(NUM1+I)
         IF(IND1.EQ.0) GO TO 20
         EVECT(IDL(K))=EVECT(IDL(K))+SS*EVECT(IND1)
   20    CONTINUE
   30    NUM1=NUM1+12
   40    CONTINUE
      ELSE IF(ISPLH.EQ.2) THEN
         DO 70 K=1,NEL
         IF(MAT(K).EQ.0) GO TO 70
         EVECT(IDL(K))=0.0
         IF(VOL(K).EQ.0.0) GO TO 60
         DO 50 I=1,14
         IND1=KN(NUM1+I)
         IF(IND1.EQ.0) GO TO 50
         EVECT(IDL(K))=EVECT(IDL(K))+TH(I)*EVECT(IND1)
   50    CONTINUE
   60    NUM1=NUM1+14
   70    CONTINUE
      ENDIF
      RETURN
      END