summaryrefslogtreecommitdiff
path: root/Trivac/src/KINT01.f
blob: 59ae9b2e751ae441c74cf58551129896db8dbf2a (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
90
91
*DECK KINT01
      SUBROUTINE KINT01(MAXKN,SGD,CYLIND,NREG,LL4,NBMIX,XX,DD,MAT,KN,
     1 VOL,LC,T,TS,F2,F3)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Multiplication of a matrix by a vector in primal finite element
* diffusion approximation (Cartesian geometry). Special version for
* Trivac.
*
*Copyright:
* Copyright (C) 2010 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
* MAXKN   dimension of array KN.
* SGD     mixture-ordered cross sections.
* CYLIND  cylinderization flag (=.true. for cylindrical geometry).
* NREG    number of elements in TRIVAC.
* LL4     order of matrix SYS.
* NBMIX   number of macro-mixtures.
* XX      X-directed mesh spacings.
* DD      value used with a cylindrical geometry.
* MAT     mixture index per region.
* KN      element-ordered unknown list.
* VOL     volume of regions.
* LC      number of polynomials in a complete 1-D basis.
* T       Cartesian linear product vector.
* TS      cylindrical linear product vector.
* F2      vector to multiply.
*
*Parameters: output
* F3      result of the multiplication.
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER MAXKN,NREG,LL4,NBMIX,MAT(NREG),KN(MAXKN),LC
      REAL SGD(NBMIX),XX(NREG),DD(NREG),VOL(NREG),T(LC),TS(LC),F2(LL4),
     1 F3(LL4)
      LOGICAL CYLIND
*----
*  LOCAL VARIABLES
*----
      REAL R3DP(125),R3DC(125)
*----
*  CALCULATION OF 3-D MASS MATRICES FROM TENSORIAL PRODUCT OF 1-D
*  MATRICES
*----
      LL=LC*LC*LC
      DO 20 L=1,LL
      L1=1+MOD(L-1,LC)
      L2=1+(L-L1)/LC
      L3=1+MOD(L2-1,LC)
      I1=L1
      I2=L3
      I3=1+(L2-L3)/LC
      R3DP(L)=T(I1)*T(I2)*T(I3)
      R3DC(L)=TS(I1)*T(I2)*T(I3)
   20 CONTINUE
*----
*  MULTIPLICATION.
*----
      NUM1=0
      DO 90 K=1,NREG
      L=MAT(K)
      IF(L.EQ.0) GO TO 90
      IF(VOL(K).EQ.0.0) GO TO 80
      DX=XX(K)
      DO 50 I=1,LL
      IND1=KN(NUM1+I)
      IF(IND1.EQ.0) GO TO 50
      IF(CYLIND) THEN
         RR=(R3DP(I)+R3DC(I)*DX/DD(K))
      ELSE
         RR=R3DP(I)
      ENDIF
      F3(IND1)=F3(IND1)+RR*SGD(L)*VOL(K)*F2(IND1)
   50 CONTINUE
   80 NUM1=NUM1+LL
   90 CONTINUE
      RETURN
      END