7 #include "sll_errors.h"
8 #include "sll_memory.h"
9 #include "sll_working_precision.h"
89 sll_real64,
parameter ::
grandx = 1.d+20
99 sll_real64,
dimension(:),
allocatable :: vnx
100 sll_real64,
dimension(:),
allocatable :: vny
101 logical,
dimension(:),
allocatable :: naux
102 sll_real64,
dimension(:),
allocatable :: gradx
103 sll_real64,
dimension(:),
allocatable :: grady
104 sll_real64,
dimension(:),
allocatable :: grgr
105 sll_int32,
dimension(:),
allocatable :: mors1
106 sll_int32,
dimension(:),
allocatable :: mors2
107 sll_int32,
dimension(:),
allocatable :: iprof
108 sll_int32,
dimension(:),
allocatable :: ifron
109 sll_real64,
dimension(:),
allocatable :: amass
110 sll_real64,
dimension(:),
allocatable :: vtantx
111 sll_real64,
dimension(:),
allocatable :: vtanty
112 sll_real64,
dimension(:),
allocatable :: sv1
113 sll_real64,
dimension(:),
allocatable :: sv2
116 sll_int32 :: ntypfr(5)
117 sll_real64 :: potfr(5)
118 sll_real64 :: eps0 = 1.0_f64
130 sll_int32,
dimension(:),
intent(in) :: ntypfr
131 sll_real64,
dimension(:),
intent(in) :: potfr
142 print *,
'delete poisson solver'
155 sll_real64,
intent(in) :: rho(:)
156 sll_real64,
intent(out) :: phi(:)
157 sll_real64,
intent(out) :: ex(:)
158 sll_real64,
intent(out) :: ey(:)
160 call poissn(self, rho, phi, ex, ey)
167 sll_real64,
intent(in) :: rho(:)
168 sll_real64,
intent(out) :: phi(:)
170 call poissn(self, rho, phi)
176 sll_real64,
intent(in) :: phi(:)
177 sll_real64,
intent(out) :: ex(:)
178 sll_real64,
intent(out) :: ey(:)
180 call poliss(self, phi, ex, ey)
187 sll_int32,
parameter :: nfrmx = 5
188 sll_int32,
intent(out) :: ntypfr(nfrmx)
189 sll_real64,
intent(out) :: potfr(nfrmx)
194 character(len=72) :: argv
195 character(len=132) :: inpfil
197 character(len=*),
parameter :: self_sub_name =
'read_data_solver'
199 namelist /nlcham/ ntypfr, potfr
201 call get_command_argument(1, argv);
write (*,
'(1x, a)') argv
210 inpfil = trim(argv)//
'.inp'
212 write (*,
"(/10x,'Fichier d''entree : ',a)") inpfil
214 open (10, file=inpfil, status=
'OLD', err=80)
215 write (*, 1050, advance=
'no') trim(inpfil)
221 write (*, 1900) inpfil
222 write (*, 1800, advance=
'no')
223 read (*,
"(a)") inpfil
224 write (*, 1700) trim(inpfil)
232 open (10, file=inpfil)
233 write (*, *)
"Lecture de la namelist nlcham"
234 read (10, nlcham, err=100)
237 write (*, *)
"Error de lecture de la namelist nlcham"
238 write (*, *)
"Valeurs par defaut"
246 write (6, 922) i, ntypfr(i), potfr(i)
254 else if (ityp == 3)
then
257 write (6, 910) ifr, ityp
258 sll_error(self_sub_name,
"Unspecified error.")
262 900
format(//10x,
'Boundary conditions')
263 902
format(/10x,
'Reference :', i3, 5x,
'Dirichlet ')
264 904
format(/10x,
'Reference :', i3, 5x,
'Neumann')
265 910
format(/10x,
'Option not available'/ &
266 10x,
'Reference :', i3, 5x,
'Type :', i3/)
267 921
format(//5x,
'Frontiere', 5x,
'ntypfr', 7x,
'potfr')
268 922
format(5x, i3, 4x, i10, 2e12.3, 2i10, e12.3)
269 932
format(//10x,
'Boundary conditions'/)
270 1050
format(/
' Read settings from file ', a,
' ? Y')
271 1700
format(/
' New parameters write to file ', a,/)
272 1800
format(/
' Settings may have been changed - New title :')
273 1900
format(/
' Input file ', a,
' not found')
281 sll_int32 :: ntypfr(5)
282 sll_real64 :: potfr(5)
310 sll_int32,
intent(in) :: ntypfr(:)
311 sll_real64,
intent(in) :: potfr(:)
313 sll_real64,
allocatable :: tmp1(:)
314 character(len=*),
parameter :: self_sub_name =
'read_data_solver'
315 character(len=128) :: err_msg
317 sll_int32 :: nref, nn, ndir
321 if (mesh%analyzed)
then
324 err_msg =
"Call sll_s_analyze_triangular_mesh before initialize_poisson_solver."
325 sll_error(self_sub_name, err_msg)
331 allocate (self%sv1(mesh%nbtcot)); self%sv1 = 0.0_f64
332 allocate (self%sv2(mesh%nbtcot)); self%sv2 = 0.0_f64
333 allocate (self%vtantx(mesh%nbtcot)); self%vtantx = 0.0_f64
334 allocate (self%vtanty(mesh%nbtcot)); self%vtanty = 0.0_f64
336 allocate (self%mors1(mesh%num_nodes + 1)); self%mors1 = 0
340 allocate (self%mors2(12*mesh%num_nodes)); self%mors2 = 0
344 call morse(mesh%npoel1, &
347 mesh%num_triangles, &
352 allocate (self%iprof(mesh%num_nodes + 1)); self%iprof = 0
365 allocate (self%amass(mesh%num_nodes)); self%amass = 0.0_f64
368 allocate (self%grgr(self%iprof(mesh%num_nodes + 1))); self%grgr = 0.0_f64
371 allocate (self%gradx(self%mors1(mesh%num_nodes + 1))); self%gradx = 0.0_f64
372 allocate (self%grady(self%mors1(mesh%num_nodes + 1))); self%grady = 0.0_f64
377 do nn = 1, mesh%num_nodes
380 if (self%ntypfr(nref) == 1)
then
386 allocate (self%ifron(ndir)); self%ifron = 0
389 do nn = 1, mesh%num_nodes
392 if (self%ntypfr(nref) == 1)
then
394 self%ifron(ndir) = nn
407 allocate (tmp1(self%iprof(mesh%num_nodes + 1))); tmp1 = 0.0_f64
412 do i = 1, self%iprof(mesh%num_nodes + 1)
413 self%grgr(i) = tmp1(i)
418 sll_clear_allocate(self%vnx(1:self%mesh%num_nodes), ierr)
419 sll_clear_allocate(self%vny(1:self%mesh%num_nodes), ierr)
420 sll_allocate(self%naux(1:self%mesh%num_nodes), ierr)
445 subroutine morse(npoel1, npoel2, ntri, nbt, nbs, mors1, mors2)
447 sll_int32,
intent(in) :: nbt
448 sll_int32,
intent(in) :: nbs
449 sll_int32,
dimension(:),
intent(in) :: npoel1
450 sll_int32,
dimension(:),
intent(in) :: npoel2
451 sll_int32,
dimension(3, nbt),
intent(in) :: ntri
452 sll_int32,
dimension(:),
intent(out) :: mors1
453 sll_int32,
dimension(:),
intent(out) :: mors2
454 sll_int32,
dimension(20) :: ilign
456 sll_int32 :: l, itest1, itest2, js1, js2, is1, is2, is3, numel
457 sll_int32 :: iel, nlign, nel, is, im, k
468 nel = npoel1(is + 1) - npoel1(is)
478 is1 = ntri(1, numel); is2 = ntri(2, numel); is3 = ntri(3, numel)
493 itest1 = 0; itest2 = 0
494 if (nlign .NE. 0)
then
496 if (js1 == ilign(l))
then
499 if (js2 == ilign(l))
then
505 if (itest1 == 0)
then
509 if (itest2 == 0)
then
517 mors1(is + 1) = mors1(is) + nlign + 1
522 if (nlign .NE. 0)
then
573 sll_real64 :: amloc(3), aggloc(9), grxloc(9), gryloc(9)
574 sll_real64 :: dntx1, dntx2, dntx3, dnty1, dnty2, dnty3
575 sll_real64 :: x1t, x2t, x3t, y1t, y2t, y3t, coef
576 sll_int32 :: is1t, is2t, is3t, iel
581 do iel = 1, self%mesh%num_triangles
585 is1t = self%mesh%nodes(1, iel)
586 is2t = self%mesh%nodes(2, iel)
587 is3t = self%mesh%nodes(3, iel)
589 x1t = self%mesh%coord(1, is1t)
590 x2t = self%mesh%coord(1, is2t)
591 x3t = self%mesh%coord(1, is3t)
593 y1t = self%mesh%coord(2, is1t)
594 y2t = self%mesh%coord(2, is2t)
595 y3t = self%mesh%coord(2, is3t)
607 amloc(1) = self%mesh%area(iel)/3.
608 amloc(2) = self%mesh%area(iel)/3.
609 amloc(3) = self%mesh%area(iel)/3.
613 call asbld(amloc, is1t, is2t, is3t, self%amass)
617 coef = 1./(4.*self%mesh%area(iel))
619 aggloc(1) = (dntx1**2 + dnty1**2)*coef
620 aggloc(2) = (dntx1*dntx2 + dnty1*dnty2)*coef
621 aggloc(3) = (dntx1*dntx3 + dnty1*dnty3)*coef
622 aggloc(4) = (dntx2**2 + dnty2**2)*coef
623 aggloc(5) = (dntx2*dntx3 + dnty2*dnty3)*coef
624 aggloc(6) = (dntx3**2 + dnty3**2)*coef
628 grxloc(1) = -dntx1/6.; gryloc(1) = -dnty1/6.
629 grxloc(2) = -dntx2/6.; gryloc(2) = -dnty2/6.
630 grxloc(3) = -dntx3/6.; gryloc(3) = -dnty3/6.
631 grxloc(4) = -dntx1/6.; gryloc(4) = -dnty1/6.
632 grxloc(5) = -dntx2/6.; gryloc(5) = -dnty2/6.
633 grxloc(6) = -dntx3/6.; gryloc(6) = -dnty3/6.
634 grxloc(7) = -dntx1/6.; gryloc(7) = -dnty1/6.
635 grxloc(8) = -dntx2/6.; gryloc(8) = -dnty2/6.
636 grxloc(9) = -dntx3/6.; gryloc(9) = -dnty3/6.
640 call asblp(self%iprof, aggloc, is1t, is2t, is3t, self%grgr)
657 do j = 1, self%ndiric
659 self%grgr(self%iprof(is + 1)) =
grandx
695 subroutine poissn(self, rho, phi, ex, ey)
698 sll_real64,
dimension(:),
intent(in) :: rho
699 sll_real64,
dimension(:),
intent(out) :: phi
700 sll_real64,
dimension(:),
intent(out),
optional :: ex
701 sll_real64,
dimension(:),
intent(out),
optional :: ey
703 sll_real64,
dimension(:),
allocatable :: sdmb
704 sll_real64,
dimension(:),
allocatable :: sdmb12
706 sll_int32 :: i, is, nref, ierr
712 sll_allocate(sdmb(self%mesh%num_nodes), ierr)
716 do is = 1, self%mesh%num_nodes
717 sdmb(is) = self%amass(is)*rho(is)/self%eps0
724 do is = 1, self%ndiric
725 nref = self%mesh%refs(self%ifron(is))
726 sdmb(self%ifron(is)) = self%potfr(nref)*
grandx
729 call sll_s_desrem(self%iprof, self%grgr, sdmb, self%mesh%num_nodes, phi)
733 if (
present(ex) .and.
present(ey))
then
735 sll_allocate(sdmb12(self%mesh%num_nodes), ierr)
738 call m1p(self%gradx, self%mors1, self%mors2, phi, self%mesh%num_nodes, sdmb12)
740 do i = 1, self%mesh%num_nodes
741 ex(i) = sdmb12(i)/self%amass(i)
746 call m1p(self%grady, self%mors1, self%mors2, phi, self%mesh%num_nodes, sdmb12)
748 do i = 1, self%mesh%num_nodes
749 ey(i) = sdmb12(i)/self%amass(i)
776 sll_real64 :: ex(:), ey(:)
777 sll_real64 :: pscal, xnor
778 sll_int32 :: is1, is2, ict
786 self%vnx = 0.0_f64; self%vny = 0.0_f64; self%naux = .false.
788 do ict = 1, self%mesh%nctfrt
790 if (self%ntypfr(self%mesh%krefro(ict)) == 1)
then
792 is1 = self%mesh%ksofro(1, ict)
793 is2 = self%mesh%ksofro(2, ict)
795 self%vnx(is1) = self%vnx(is1) + self%mesh%vnofro(1, ict)
796 self%vny(is1) = self%vny(is1) + self%mesh%vnofro(2, ict)
797 self%vnx(is2) = self%vnx(is2) + self%mesh%vnofro(1, ict)
798 self%vny(is2) = self%vny(is2) + self%mesh%vnofro(2, ict)
800 self%naux(is1) = .true.
801 self%naux(is2) = .true.
809 do i = 1, self%mesh%num_nodes
811 if (self%naux(i))
then
813 xnor = sqrt(self%vnx(i)**2 + self%vny(i)**2)
814 if (xnor > self%mesh%petitl)
then
815 self%vnx(i) = self%vnx(i)/xnor
816 self%vny(i) = self%vny(i)/xnor
818 pscal = self%vnx(i)*ex(i) + self%vny(i)*ey(i)
819 ex(i) = self%vnx(i)*pscal
820 ey(i) = self%vny(i)*pscal
830 self%vnx = 0.0_f64; self%vny = 0.0_f64; self%naux = .false.
834 do ict = 1, self%mesh%nctfrt
836 if (self%ntypfr(self%mesh%krefro(ict)) == 3)
then
838 is1 = self%mesh%ksofro(1, ict)
839 is2 = self%mesh%ksofro(2, ict)
841 self%vnx(is1) = self%vnx(is1) + self%mesh%vnofro(1, ict)
842 self%vny(is1) = self%vny(is1) + self%mesh%vnofro(2, ict)
843 self%vnx(is2) = self%vnx(is2) + self%mesh%vnofro(1, ict)
844 self%vny(is2) = self%vny(is2) + self%mesh%vnofro(2, ict)
846 self%naux(is1) = .true.
847 self%naux(is2) = .true.
855 do i = 1, self%mesh%num_nodes
857 if (self%naux(i))
then
859 xnor = sqrt(self%vnx(i)**2 + self%vny(i)**2)
860 if (xnor > self%mesh%petitl)
then
861 self%vnx(i) = self%vnx(i)/xnor
862 self%vny(i) = self%vny(i)/xnor
863 pscal = self%vnx(i)*ex(i) + self%vny(i)*ey(i)
864 ex(i) = ex(i) - self%vnx(i)*pscal
865 ey(i) = ey(i) - self%vny(i)*pscal
892 subroutine profil(ntri, nbs, npoel1, npoel2, iprof)
894 sll_int32,
dimension(:) :: iprof
895 sll_int32,
dimension(:),
intent(in) :: npoel1, npoel2
896 sll_int32,
dimension(:, :),
intent(in) :: ntri
897 sll_int32 :: in, k, is1, is2, is3, numel, ind, iel, nel
898 sll_int32,
intent(in) :: nbs
913 nel = npoel1(in + 1) - npoel1(in)
924 if (iprof(ind) .eq. 0)
then
925 iprof(ind) = is1 - in + 1
929 if (iprof(ind) .eq. 0)
then
930 iprof(ind) = is2 - in + 1
934 if (iprof(ind) .eq. 0)
then
935 iprof(ind) = is3 - in + 1
947 iprof(ind) = iprof(ind - 1) + iprof(ind)
967 subroutine asbld(aele, i1, i2, i3, xmass)
969 sll_real64,
dimension(:) :: aele, xmass
970 sll_int32 :: i1, i2, i3
972 xmass(i1) = xmass(i1) + aele(1)
973 xmass(i2) = xmass(i2) + aele(2)
974 xmass(i3) = xmass(i3) + aele(3)
998 subroutine asblm2(aele1, aele2, mors1, mors2, i1, i2, i3, a1, a2)
1000 sll_int32,
intent(in) :: i1, i2, i3
1001 sll_int32,
dimension(:),
intent(in) :: mors1, mors2
1002 sll_real64,
dimension(:),
intent(in) :: aele1, aele2
1003 sll_real64,
dimension(:),
intent(out) :: a1, a2
1004 sll_int32 :: j, j1, j2, ind1, ind2, ind3
1008 ind1 = mors1(i1 + 1)
1009 a1(ind1) = a1(ind1) + aele1(1)
1010 a2(ind1) = a2(ind1) + aele2(1)
1012 ind2 = mors1(i2 + 1)
1013 a1(ind2) = a1(ind2) + aele1(5)
1014 a2(ind2) = a2(ind2) + aele2(5)
1016 ind3 = mors1(i3 + 1)
1017 a1(ind3) = a1(ind3) + aele1(9)
1018 a2(ind3) = a2(ind3) + aele2(9)
1027 if (i2 == mors2(j))
then
1028 a1(j) = a1(j) + aele1(2)
1029 a2(j) = a2(j) + aele2(2)
1031 if (i3 == mors2(j))
then
1032 a1(j) = a1(j) + aele1(3)
1033 a2(j) = a2(j) + aele2(3)
1043 if (i1 == mors2(j))
then
1044 a1(j) = a1(j) + aele1(4)
1045 a2(j) = a2(j) + aele2(4)
1047 if (i3 == mors2(j))
then
1048 a1(j) = a1(j) + aele1(6)
1049 a2(j) = a2(j) + aele2(6)
1059 if (i1 == mors2(j))
then
1060 a1(j) = a1(j) + aele1(7)
1061 a2(j) = a2(j) + aele2(7)
1063 if (i2 == mors2(j))
then
1064 a1(j) = a1(j) + aele1(8)
1065 a2(j) = a2(j) + aele2(8)
1093 subroutine asblp(iprof, aele, i1, i2, i3, xmass)
1095 sll_int32,
dimension(:) :: iprof
1096 sll_real64,
dimension(:) :: aele(*), xmass(*)
1097 sll_int32 :: i1, i2, i3, idiag1, idiag2, idiag3, ind
1101 idiag1 = iprof(i1 + 1)
1102 idiag2 = iprof(i2 + 1)
1103 idiag3 = iprof(i3 + 1)
1105 xmass(idiag1) = xmass(idiag1) + aele(1)
1106 xmass(idiag2) = xmass(idiag2) + aele(4)
1107 xmass(idiag3) = xmass(idiag3) + aele(6)
1113 ind = idiag2 + i1 - i2
1115 ind = idiag1 + i2 - i1
1118 xmass(ind) = xmass(ind) + aele(2)
1121 ind = idiag3 + i1 - i3
1123 ind = idiag1 + i3 - i1
1126 xmass(ind) = xmass(ind) + aele(3)
1129 ind = idiag3 + i2 - i3
1131 ind = idiag2 + i3 - i2
1134 xmass(ind) = xmass(ind) + aele(5)
1138 end subroutine asblp
1156 subroutine m1p(xmors, mors1, mors2, xvect, nlign, yvect)
1158 sll_real64 :: xmors(*), xvect(*), yvect(*)
1159 sll_int32 :: mors1(*), mors2(*)
1160 sll_int32 :: il, nlign, noeui
1164 noeui = mors1(il + 1) - mors1(il)
1168 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1169 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1170 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1171 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1172 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1173 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5))
1176 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1177 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1178 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1179 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1180 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4))
1183 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1184 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1185 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1186 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1187 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1188 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5)) + &
1189 xmors(mors1(il + 1) - 6)*xvect(mors2(mors1(il + 1) - 6))
1192 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1193 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1194 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1195 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3))
1198 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1199 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1200 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1201 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1202 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1203 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5)) + &
1204 xmors(mors1(il + 1) - 6)*xvect(mors2(mors1(il + 1) - 6)) + &
1205 xmors(mors1(il + 1) - 7)*xvect(mors2(mors1(il + 1) - 7))
1208 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1209 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1210 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2))
1213 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1214 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1215 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1216 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1217 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1218 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5)) + &
1219 xmors(mors1(il + 1) - 6)*xvect(mors2(mors1(il + 1) - 6)) + &
1220 xmors(mors1(il + 1) - 7)*xvect(mors2(mors1(il + 1) - 7)) + &
1221 xmors(mors1(il + 1) - 8)*xvect(mors2(mors1(il + 1) - 8))
1224 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1225 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1226 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1227 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1228 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1229 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5)) + &
1230 xmors(mors1(il + 1) - 6)*xvect(mors2(mors1(il + 1) - 6)) + &
1231 xmors(mors1(il + 1) - 7)*xvect(mors2(mors1(il + 1) - 7)) + &
1232 xmors(mors1(il + 1) - 8)*xvect(mors2(mors1(il + 1) - 8)) + &
1233 xmors(mors1(il + 1) - 9)*xvect(mors2(mors1(il + 1) - 9))
1236 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1237 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1238 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1239 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1240 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1241 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5)) + &
1242 xmors(mors1(il + 1) - 6)*xvect(mors2(mors1(il + 1) - 6)) + &
1243 xmors(mors1(il + 1) - 7)*xvect(mors2(mors1(il + 1) - 7)) + &
1244 xmors(mors1(il + 1) - 8)*xvect(mors2(mors1(il + 1) - 8)) + &
1245 xmors(mors1(il + 1) - 9)*xvect(mors2(mors1(il + 1) - 9)) + &
1246 xmors(mors1(il + 1) - 10)*xvect(mors2(mors1(il + 1) - 10))
1249 yvect(il) = xmors(mors1(il + 1))*xvect(mors2(mors1(il + 1))) + &
1250 xmors(mors1(il + 1) - 1)*xvect(mors2(mors1(il + 1) - 1)) + &
1251 xmors(mors1(il + 1) - 2)*xvect(mors2(mors1(il + 1) - 2)) + &
1252 xmors(mors1(il + 1) - 3)*xvect(mors2(mors1(il + 1) - 3)) + &
1253 xmors(mors1(il + 1) - 4)*xvect(mors2(mors1(il + 1) - 4)) + &
1254 xmors(mors1(il + 1) - 5)*xvect(mors2(mors1(il + 1) - 5)) + &
1255 xmors(mors1(il + 1) - 6)*xvect(mors2(mors1(il + 1) - 6)) + &
1256 xmors(mors1(il + 1) - 7)*xvect(mors2(mors1(il + 1) - 7)) + &
1257 xmors(mors1(il + 1) - 8)*xvect(mors2(mors1(il + 1) - 8)) + &
1258 xmors(mors1(il + 1) - 9)*xvect(mors2(mors1(il + 1) - 9)) + &
1259 xmors(mors1(il + 1) - 10)*xvect(mors2(mors1(il + 1) - 10)) + &
1260 xmors(mors1(il + 1) - 11)*xvect(mors2(mors1(il + 1) - 11))
1272 sll_real64,
dimension(:),
intent(in) :: phi
1273 sll_real64,
dimension(:),
intent(out) :: ex
1274 sll_real64,
dimension(:),
intent(out) :: ey
1276 sll_int32 :: is, ic, nbc, iac
1281 do ic = 1, self%mesh%nbtcot
1282 self%vtanty(ic) = (phi(self%mesh%nuvac(1, ic)) - phi(self%mesh%nuvac(2, ic)))/self%mesh%xlcod(ic)
1285 do ic = 1, self%mesh%nbtcot
1286 self%vtantx(ic) = self%vtanty(ic)*self%mesh%vtaux(ic)
1289 do ic = 1, self%mesh%nbtcot
1290 self%vtanty(ic) = self%vtanty(ic)*self%mesh%vtauy(ic)
1293 do is = 1, self%mesh%num_nodes
1295 iac = self%mesh%nbcov(is) + 1
1296 nbc = self%mesh%nbcov(is + 1) - self%mesh%nbcov(is)
1300 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1301 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1302 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1303 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1304 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1305 + self%vtantx(self%mesh%nugcv(iac + 5))
1307 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1308 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1309 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1310 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1311 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1312 + self%vtanty(self%mesh%nugcv(iac + 5))
1314 else if (nbc == 5)
then
1316 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1317 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1318 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1319 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1320 + self%vtantx(self%mesh%nugcv(iac + 4))
1322 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1323 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1324 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1325 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1326 + self%vtanty(self%mesh%nugcv(iac + 4))
1328 else if (nbc == 7)
then
1330 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1331 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1332 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1333 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1334 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1335 + self%vtantx(self%mesh%nugcv(iac + 5)) &
1336 + self%vtantx(self%mesh%nugcv(iac + 6))
1338 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1339 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1340 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1341 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1342 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1343 + self%vtanty(self%mesh%nugcv(iac + 5)) &
1344 + self%vtanty(self%mesh%nugcv(iac + 6))
1346 else if (nbc == 4)
then
1348 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1349 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1350 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1351 + self%vtantx(self%mesh%nugcv(iac + 3))
1353 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1354 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1355 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1356 + self%vtanty(self%mesh%nugcv(iac + 3))
1358 else if (nbc == 8)
then
1360 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1361 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1362 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1363 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1364 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1365 + self%vtantx(self%mesh%nugcv(iac + 5)) &
1366 + self%vtantx(self%mesh%nugcv(iac + 6)) &
1367 + self%vtantx(self%mesh%nugcv(iac + 7))
1369 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1370 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1371 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1372 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1373 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1374 + self%vtanty(self%mesh%nugcv(iac + 5)) &
1375 + self%vtanty(self%mesh%nugcv(iac + 6)) &
1376 + self%vtanty(self%mesh%nugcv(iac + 7))
1378 else if (nbc == 3)
then
1380 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1381 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1382 + self%vtantx(self%mesh%nugcv(iac + 2))
1384 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1385 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1386 + self%vtanty(self%mesh%nugcv(iac + 2))
1388 else if (nbc == 9)
then
1390 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1391 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1392 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1393 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1394 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1395 + self%vtantx(self%mesh%nugcv(iac + 5)) &
1396 + self%vtantx(self%mesh%nugcv(iac + 6)) &
1397 + self%vtantx(self%mesh%nugcv(iac + 7)) &
1398 + self%vtantx(self%mesh%nugcv(iac + 8))
1400 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1401 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1402 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1403 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1404 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1405 + self%vtanty(self%mesh%nugcv(iac + 5)) &
1406 + self%vtanty(self%mesh%nugcv(iac + 6)) &
1407 + self%vtanty(self%mesh%nugcv(iac + 7)) &
1408 + self%vtanty(self%mesh%nugcv(iac + 8))
1410 else if (nbc == 2)
then
1412 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1413 + self%vtantx(self%mesh%nugcv(iac + 1))
1415 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1416 + self%vtanty(self%mesh%nugcv(iac + 1))
1418 else if (nbc == 10)
then
1420 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1421 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1422 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1423 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1424 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1425 + self%vtantx(self%mesh%nugcv(iac + 5)) &
1426 + self%vtantx(self%mesh%nugcv(iac + 6)) &
1427 + self%vtantx(self%mesh%nugcv(iac + 7)) &
1428 + self%vtantx(self%mesh%nugcv(iac + 8)) &
1429 + self%vtantx(self%mesh%nugcv(iac + 9))
1431 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1432 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1433 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1434 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1435 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1436 + self%vtanty(self%mesh%nugcv(iac + 5)) &
1437 + self%vtanty(self%mesh%nugcv(iac + 6)) &
1438 + self%vtanty(self%mesh%nugcv(iac + 7)) &
1439 + self%vtanty(self%mesh%nugcv(iac + 8)) &
1440 + self%vtanty(self%mesh%nugcv(iac + 9))
1442 else if (nbc == 11)
then
1444 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1445 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1446 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1447 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1448 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1449 + self%vtantx(self%mesh%nugcv(iac + 5)) &
1450 + self%vtantx(self%mesh%nugcv(iac + 6)) &
1451 + self%vtantx(self%mesh%nugcv(iac + 7)) &
1452 + self%vtantx(self%mesh%nugcv(iac + 8)) &
1453 + self%vtantx(self%mesh%nugcv(iac + 9)) &
1454 + self%vtantx(self%mesh%nugcv(iac + 10))
1456 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1457 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1458 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1459 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1460 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1461 + self%vtanty(self%mesh%nugcv(iac + 5)) &
1462 + self%vtanty(self%mesh%nugcv(iac + 6)) &
1463 + self%vtanty(self%mesh%nugcv(iac + 7)) &
1464 + self%vtanty(self%mesh%nugcv(iac + 8)) &
1465 + self%vtanty(self%mesh%nugcv(iac + 9)) &
1466 + self%vtanty(self%mesh%nugcv(iac + 10))
1468 else if (nbc == 12)
then
1470 self%sv1(is) = self%vtantx(self%mesh%nugcv(iac)) &
1471 + self%vtantx(self%mesh%nugcv(iac + 1)) &
1472 + self%vtantx(self%mesh%nugcv(iac + 2)) &
1473 + self%vtantx(self%mesh%nugcv(iac + 3)) &
1474 + self%vtantx(self%mesh%nugcv(iac + 4)) &
1475 + self%vtantx(self%mesh%nugcv(iac + 5)) &
1476 + self%vtantx(self%mesh%nugcv(iac + 6)) &
1477 + self%vtantx(self%mesh%nugcv(iac + 7)) &
1478 + self%vtantx(self%mesh%nugcv(iac + 8)) &
1479 + self%vtantx(self%mesh%nugcv(iac + 9)) &
1480 + self%vtantx(self%mesh%nugcv(iac + 10)) &
1481 + self%vtantx(self%mesh%nugcv(iac + 11))
1483 self%sv2(is) = self%vtanty(self%mesh%nugcv(iac)) &
1484 + self%vtanty(self%mesh%nugcv(iac + 1)) &
1485 + self%vtanty(self%mesh%nugcv(iac + 2)) &
1486 + self%vtanty(self%mesh%nugcv(iac + 3)) &
1487 + self%vtanty(self%mesh%nugcv(iac + 4)) &
1488 + self%vtanty(self%mesh%nugcv(iac + 5)) &
1489 + self%vtanty(self%mesh%nugcv(iac + 6)) &
1490 + self%vtanty(self%mesh%nugcv(iac + 7)) &
1491 + self%vtanty(self%mesh%nugcv(iac + 8)) &
1492 + self%vtanty(self%mesh%nugcv(iac + 9)) &
1493 + self%vtanty(self%mesh%nugcv(iac + 10)) &
1494 + self%vtanty(self%mesh%nugcv(iac + 11))
1510 do is = 1, self%mesh%num_nodes
1511 ex(is) = self%mesh%xmal2(is)*self%sv1(is) - self%mesh%xmal3(is)*self%sv2(is)
1512 ey(is) = self%mesh%xmal1(is)*self%sv2(is) - self%mesh%xmal3(is)*self%sv1(is)
1517 900
format(//10x,
'Error dans POLISS' &
1518 /10x,
'On a trouve more de 12 edges')
subroutine, public sll_s_choles(mudl, ae, as)
subroutine, public sll_s_desrem(mudl, a, be, ntdl, bs)
subroutine asblp(iprof, aele, i1, i2, i3, xmass)
subroutine read_data_solver(ntypfr, potfr)
subroutine morse(npoel1, npoel2, ntri, nbt, nbs, mors1, mors2)
subroutine initialize_poisson_solver(self, mesh, ntypfr, potfr)
subroutine poifrc(self, ex, ey)
subroutine m1p(xmors, mors1, mors2, xvect, nlign, yvect)
subroutine poissn(self, rho, phi, ex, ey)
subroutine initialize_poisson_solver_from_file(self, mesh)
subroutine, public sll_s_poisson_2d_triangular_free(self)
Delete the solver derived type.
subroutine asblm2(aele1, aele2, mors1, mors2, i1, i2, i3, a1, a2)
subroutine, public sll_s_poisson_2d_triangular_init(solver, mesh, ntypfr, potfr)
subroutine, public sll_s_compute_e_from_phi(self, phi, ex, ey)
subroutine profil(ntri, nbs, npoel1, npoel2, iprof)
subroutine, public sll_s_compute_e_from_rho(self, rho, phi, ex, ey)
Compute electric field from charge density.
real(kind=f64), parameter grandx
subroutine asbld(aele, i1, i2, i3, xmass)
subroutine poliss(self, phi, ex, ey)
subroutine, public sll_s_compute_phi_from_rho(self, rho, phi)
Derived type for Poisson solver on unstructured mesh with triangles.