summaryrefslogtreecommitdiff
path: root/Trivac/src/FLDBN2.f
blob: 073f5ba297ddf9e45dc2add1842a8b96b3d1eb7a (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
*DECK FLDBN2
      SUBROUTINE FLDBN2 (NEL,LL4,IELEM,CYLIND,EVECT,XX,DD,MAT,VOL,IDL,
     1 KN,LC,T,TS)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Calculation of the averaged flux with a primal finite element method.
*
*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
* NEL     total number of finite elements.
* LL4     order of the system matrices.
* IELEM   degree of the Lagrangian finite elements: =1 (linear);
*         =2 (parabolic); =3 (cubic); =4 (quartic).
* CYLIND  cylindrical geometry flag (set with CYLIND=.true.).
* EVECT   variational coefficients of the flux. The information is
*         contained in position EVECT(1) to EVECT(LL4).
* XX      X-side of each element.
* DD      used with cylindrical geometry.
* 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.
* LC      order of the finite element basis.
* T       linear product vector.
* TS      linear product vector.
*
*Parameters: output
* EVECT   averaged fluxes. The information is contained in positions
*         EVECT(IDL(I)).
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER NEL,LL4,IELEM,MAT(NEL),IDL(NEL),KN(NEL*IELEM*IELEM),LC
      REAL EVECT(LL4+NEL),XX(NEL),DD(NEL),VOL(NEL),T(LC),TS(LC)
      LOGICAL CYLIND
*----
*  LOCAL VARIABLES
*----
      INTEGER IJ1(25),IJ2(25)
*----
*  COMPUTE VECTORS IJ1 AND IJ2
*----
      LL=LC*LC
      DO 10 I=1,LL
      IJ1(I)=1+MOD(I-1,LC)
      IJ2(I)=1+(I-IJ1(I))/LC
   10 CONTINUE
*
      NUM1=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,LL
      IND1=KN(NUM1+I)
      IF(IND1.EQ.0) GO TO 20
      I1=IJ1(I)
      I2=IJ2(I)
      IF(CYLIND) THEN
         SS=(T(I1)+TS(I1)*XX(K)/DD(K))*T(I2)
      ELSE
         SS=T(I1)*T(I2)
      ENDIF
      EVECT(IDL(K))=EVECT(IDL(K))+SS*EVECT(IND1)
   20 CONTINUE
   30 NUM1=NUM1+LL
   40 CONTINUE
      RETURN
      END