2
! CalculiX - A 3-dimensional finite element program
3
! Copyright (C) 1998-2015 Guido Dhondt
5
! This program is free software; you can redistribute it and/or
6
! modify it under the terms of the GNU General Public License as
7
! published by the Free Software Foundation(version 2);
10
! This program is distributed in the hope that it will be useful,
11
! but WITHOUT ANY WARRANTY; without even the implied warranty of
12
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
! GNU General Public License for more details.
15
! You should have received a copy of the GNU General Public License
16
! along with this program; if not, write to the Free Software
17
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
subroutine extrapolate_ad_h_comp(nface,ielfa,xrlfa,adv,advfa,
20
& hel,hfa,icyclic,c,ifatie)
22
! inter/extrapolation of adv at the center of the elements
23
! to the center of the faces
25
! inter/extrapolation of h at the center of the elements
26
! to the center of the faces; division through advfa to obtain
31
integer nface,ielfa(4,*),ipo1,iel2,ipo3,i,j,icyclic,ifatie(*)
33
real*8 xrlfa(3,*),xl1,xl2,advfa(*),adv(*),hel(3,*),hfa(3,*),c(3,3)
35
c$omp parallel default(none)
36
c$omp& shared(nface,ielfa,xrlfa,advfa,adv,hfa,hel,icyclic,c,ifatie)
37
c$omp& private(i,ipo1,xl1,iel2,j,ipo3,xl2)
48
advfa(i)=1.d0/(xl1/adv(ipo1)+xl2/adv(iel2))
49
if((icyclic.eq.0).or.(ifatie(i).eq.0)) then
51
hfa(j,i)=(xl1*hel(j,ipo1)/adv(ipo1)
52
& +xl2*hel(j,iel2)/adv(iel2))
54
elseif(ifatie(i).gt.0) then
56
hfa(j,i)=(xl1*hel(j,ipo1)/adv(ipo1)
57
& +xl2*(c(j,1)*hel(1,iel2)+
59
& c(j,3)*hel(3,iel2))/adv(iel2))
63
hfa(j,i)=(xl1*hel(j,ipo1)/adv(ipo1)
64
& +xl2*(c(1,j)*hel(1,iel2)+
66
& c(3,j)*hel(3,iel2))/adv(iel2))
69
elseif(ielfa(3,i).gt.0) then
71
! external face; linear extrapolation
74
advfa(i)=1.d0/(xl1/adv(ipo1)+xrlfa(3,i)/adv(ipo3))
76
hfa(j,i)=(xl1*hel(j,ipo1)/adv(ipo1)+
77
& xrlfa(3,i)*hel(j,ipo3)/adv(ipo3))
81
! external face: constant extrapolation (only one adjacent
86
hfa(j,i)=hel(j,ipo1)/adv(ipo1)