~airpollution/fluidity/fluidity_airpollution

« back to all changes in this revision

Viewing changes to libadaptivity/adapt3d/src/edgeig.F

  • Committer: ziyouzhj
  • Date: 2013-12-09 16:51:29 UTC
  • Revision ID: ziyouzhj@gmail.com-20131209165129-ucoetc3u0atyy05c
airpolution

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
C Copyright (C) 2006 Imperial College London and others.
 
2
 
3
C Please see the AUTHORS file in the main source directory for a full list
 
4
C of copyright holders.
 
5
 
6
C Adrian Umpleby
 
7
C Applied Modelling and Computation Group
 
8
C Department of Earth Science and Engineering
 
9
C Imperial College London
 
10
 
11
C adrian@Imperial.ac.uk
 
12
 
13
C This library is free software; you can redistribute it and/or
 
14
C modify it under the terms of the GNU Lesser General Public
 
15
C License as published by the Free Software Foundation; either
 
16
C version 2.1 of the License.
 
17
 
18
C This library is distributed in the hope that it will be useful,
 
19
C but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
21
C Lesser General Public License for more details.
 
22
 
23
C You should have received a copy of the GNU Lesser General Public
 
24
C License along with this library; if not, write to the Free Software
 
25
C Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 
26
C USA
 
27
      SUBROUTINE EDGEIG( BIGLST, NODLST, NOD1, NOD2, V1, V2, V3,
 
28
     :                   D1, D2, D3 )
 
29
C-----------------------------------------------------------------------
 
30
C
 
31
C - This subroutine takes the hessian(s) at the two nodes supplied and
 
32
C - forms an 'average' hessian for the edge, which is then made +ve def.
 
33
C - and 'solved' for the eigenvectors (V1,V2,V3) and the eigenvalues,
 
34
C - which are then turned into length-scales (D1,D2,D3).
 
35
C
 
36
C-----------------------------------------------------------------------
 
37
      IMPLICIT NONE
 
38
C
 
39
      INTEGER NOD1, NOD2
 
40
C
 
41
      REAL V1(3), V2(3), V3(3), D1, D2, D3, a, b, c
 
42
C
 
43
      REAL X(2), Y(2), Z(2), XX, YY, ZZ, D1N1, D2N1, D3N1, D1N2, D2N2,
 
44
     :     D3N2, V1N1(3), V2N1(3), V3N1(3), V1N2(3), V2N2(3), V3N2(3)
 
45
C
 
46
      INCLUDE 'blknew.i'
 
47
C
 
48
      INCLUDE 'blkbig.i'
 
49
C
 
50
      X(1) = NODLST( 1, NOD1 )
 
51
      Y(1) = NODLST( 2, NOD1 )
 
52
      Z(1) = NODLST( 3, NOD1 )
 
53
C
 
54
      X(2) = NODLST( 1, NOD2 )
 
55
      Y(2) = NODLST( 2, NOD2 )
 
56
      Z(2) = NODLST( 3, NOD2 )
 
57
C
 
58
      XX = ( X(1) + X(2) ) / 2
 
59
      YY = ( Y(1) + Y(2) ) / 2
 
60
      ZZ = ( Z(1) + Z(2) ) / 2
 
61
C
 
62
c      CALL NODEIG( NOD1, V1N1, V2N1, V3N1, D1N1, D2N1, D3N1 )
 
63
c      CALL NODEIG( NOD2, V1N2, V2N2, V3N2, D1N2, D2N2, D3N2 )
 
64
C
 
65
C - just use a set length scale over set directions for now
 
66
C
 
67
      INCLUDE 'fixeig.i'
 
68
C
 
69
      return
 
70
c
 
71
      IF( ABS(D1N1/D1) .LT. 0.4 .OR.
 
72
     :    ABS(D2N1/D2) .LT. 0.4 .OR.
 
73
     :    ABS(D3N1/D3) .LT. 0.4 ) THEN
 
74
         D1 = D1N1
 
75
         D2 = D2N1
 
76
         D3 = D3N1
 
77
         V1(1) = V1N1(1)
 
78
         V1(2) = V1N1(2)
 
79
         V1(3) = V1N1(3)
 
80
         V2(1) = V2N1(1)
 
81
         V2(2) = V2N1(2)
 
82
         V2(3) = V2N1(3)
 
83
         V3(1) = V3N1(1)
 
84
         V3(2) = V3N1(2)
 
85
         V3(3) = V3N1(3)
 
86
      ELSE IF( ABS(D1N2/D1) .LT. 0.4 .OR.
 
87
     :         ABS(D2N2/D2) .LT. 0.4 .OR.
 
88
     :         ABS(D3N2/D3) .LT. 0.4 ) THEN
 
89
         D1 = D1N2
 
90
         D2 = D2N2
 
91
         D3 = D3N2
 
92
         V1(1) = V1N2(1)
 
93
         V1(2) = V1N2(2)
 
94
         V1(3) = V1N2(3)
 
95
         V2(1) = V2N2(1)
 
96
         V2(2) = V2N2(2)
 
97
         V2(3) = V2N2(3)
 
98
         V3(1) = V3N2(1)
 
99
         V3(2) = V3N2(2)
 
100
         V3(3) = V3N2(3)
 
101
      END IF
 
102
C
 
103
      RETURN
 
104
      END
 
105
C