1 |
USE HPF_LIBRARY
|
2 |
REAL x(nnode), flux(nedge)
|
3 |
INTEGER iedge(nedge,2)
|
4 |
INTEGER permute_node(nnode), permute_edge(nedge)
|
5 |
!HPF$ DISTRIBUTE x(BLOCK)
|
6 |
!HPF$ DISTRIBUTE flux(BLOCK)
|
7 |
!HPF$ ALIGN iedge(i,*) WITH flux(i)
|
8 |
!HPF$ ALIGN permute_edge(i) WITH flux(i)
|
9 |
!HPF$ ALIGN permute_node(i) WITH x(i)
|
10 |
CALL renumber_nodes( iedge, permute_node )
|
11 |
x( permute_node(:) ) = x
|
12 |
FORALL (i=1:nedge) iedge(i,:) = permute_node(iedge(i,:))
|
13 |
permute_edge = GRADE_UP( iedge(:,1) )
|
14 |
FORALL (i=1:nedge) iedge(i,:) = iedge(permute_edge(i),:)
|
15 |
err = tol * 1e6
|
16 |
DO WHILE (err > tol)
-
flux=(x(iedge(1:nedge,1))-x(iedge(1:nedge,2)))/2
-
x=SUM_SCATTER(-flux(1:nedge),x,iedge(1:nedge,1))
-
x=SUM_SCATTER( flux(1:nedge),x,iedge(1:nedge,2))
-
err = SUM( flux*flux ) / nedge
|
17 |
END DO
|