111 real(RP),
dimension(:,:),
allocatable :: dofcoord
112 integer ,
dimension(:) ,
allocatable :: doftype
113 integer ,
dimension(:) ,
allocatable :: fetype
126 integer,
dimension(CELL_TOT_NB) :: dof_count = 0
127 integer,
dimension(0:FE_TOT_NB) :: fe_count = 0
191 call clear(x_h%clToDof)
207 type(
mesh) ,
target :: m
209 if (
choral_verb>0)
write(*,*)
'feSpace_mod : create' 212 &
"feSpace_mod: feSpace_create: mesh 'm' not valid" )
217 &
' Number of cells =', x_h%mesh%nbCl
226 integer ,
intent(in) :: ft
228 integer :: ii, jj, geo, cl_geo, cpt
233 do ii=1, x_h%mesh%nbCl
235 jj = x_h%mesh%clType(ii)
238 if (geo==cl_geo)
then 246 &
'feSpace_mod : set =', &
260 write(*,*)
"feSpace_mod : print" 261 write(*,*)
" Number of DOF =", x_h%nbDof
263 write(*,*)
' DOF per geometrical type' 265 if ( x_h%dof_count(ii)>0)
then 271 write(*,*)
' Number of cells per fe method' 273 if ( x_h%fe_count(ii)>0)
then 290 if(.NOT. (
associated(x_h%mesh) ))
return 291 if(.NOT. (
valid(x_h%mesh) ))
return 292 if(
valid(x_h%clToDof) < 0 )
return 293 if(.NOT. (
allocated(x_h%dofCoord) ))
return 294 if(.NOT. (
allocated(x_h%dofType) ))
return 295 if(.NOT. (
allocated(x_h%feType) ))
return 298 b = b .AND. ( all( shape(x_h%dofCoord) == (/3,x_h%nbdof/)) )
299 b = b .AND. (
size(x_h%dofType,1) == x_h%nbdof )
300 b = b .AND. (
size(x_h%feType,1) == x_h%mesh%nbCl )
301 b = b .AND. ( x_h%clToDof%nl == x_h%mesh%nbCl )
309 character(len=*),
intent(in) :: fileName, fileFormat
312 &
"feSpace_mod : write format = ",&
313 & trim(fileformat),
" to ", trim(filename)
315 select case(trim(fileformat))
320 call quit(
"feSpace_mod: feSpace_write: uncorrect file format" )
329 character(len=*),
intent(in) :: fileName
331 integer :: ii, cpt, ft, wdt, s1
333 integer,
dimension(:),
allocatable :: p1
335 open(unit = 999,file = filename)
337 write(999,fmt=
"(A)")
'$MeshFormat' 338 write(999,fmt=
"(A)")
'2.2 0 8' 339 write(999,fmt=
"(A)")
'$EndMeshFormat' 340 write(999,fmt=
"(A)")
'$Nodes' 341 write(999,*) x_h%nbdof
343 write(999,*) ii, x_h%dofCoord(:, ii)
345 write(999,fmt=
"(A)")
'$EndNodes' 346 write(999,fmt=
"(A)")
'$Elements' 350 cpt =
size(x_h%feType,1)
351 do ii=1,
size(x_h%feType,1)
352 if (x_h%fetype(ii)==
fe_none) cpt = cpt-1
359 wdt = x_h%clToDof%width
361 do ii=1,
size(x_h%feType,1)
368 call getrow(s1, p1, wdt, x_h%clToDof, ii)
373 write(999,*) cpt, 1, 0, p1(1:s1)
376 write(999,*) cpt, 8, 0, p1(1:s1)
379 write(999,*) cpt, 26, 0, p1(1:s1)
383 write(999,*) cpt, 2, 0, p1(1:s1)
386 write(999,*) cpt, 9, 0, p1(1:s1)
389 write(999,*) cpt, 21, 0, p1(1:s1)
392 write(999,*) cpt, 4, 0, p1(1:4)
395 write(999,*) cpt, 11, 0, p1(1:8), p1(10), p1(9)
398 call quit(
'feSpace_mod: gmsh_write: cell type not supported')
403 write(999,fmt=
"(A)")
'$EndElements' 411 subroutine gmsh_addview(X_h, v, fileName, vname, time, idx)
413 real(RP),
dimension(:),
intent(in) :: v
414 character(len=*) ,
intent(in) :: fileName, vname
415 real(RP) ,
intent(in) :: time
416 integer ,
intent(in) :: idx
421 &
"feSpace_mod : gmsh_addView = "&
424 if (
size(v,1)/=x_h%nbDof)
call quit( &
425 &
"feSpace_mod: gmsh_addView: fe function 'v' uncorrect" )
427 open(unit = 999,file = filename, position=
'append', status=
'old')
429 write(999,fmt=
"(A)")
'$NodeData' 430 write(999,fmt=
"(A)")
'1' 431 write(999,fmt=
"(A)")
'"'//trim(vname)//
'"' 432 write(999,fmt=
"(A)")
'1' 434 write(999,fmt=
"(A)")
'3' 436 write(999,fmt=
"(A)")
'1' 437 write(999,*) x_h%nbDof
439 write(999,*) ii, v(ii)
441 write(999,fmt=
"(A)")
'$EndNodeData' 468 real(RP),
dimension(:),
intent(out) :: u2
469 type(
fespace) ,
intent(in) :: X_h1, X_h2
470 real(RP),
dimension(:),
intent(in) :: u1
472 integer,
dimension(:),
allocatable :: T
473 type(
mesh),
pointer :: m1 =>null()
474 type(
graph) :: ndToNd
476 integer :: w1, nbDof, dim, ft
479 &
"feSpace_mod : interp_scal_fe" 482 &
"feSpace_mod: interp_scal_fe:& 483 & fe space 'X_h1' not valid" )
486 &
"feSpace_mod: interp_scal_fe:& 487 & fe space 'X_h2' not valid" )
489 if (
size(u1,1)/=x_h1%nbDof)
call quit( &
490 &
"feSpace_mod: interp_scal_fe:& 491 & fe function 'u1' uncorrect")
493 if (
size(u2,1)/=x_h2%nbDof)
call quit( &
494 &
"feSpace_mod: interp_scal_fe:& 495 & fe function 'u2' uncorrect")
503 call graph_prod(ndtond, x_h1%mesh%NdToCl, x_h1%mesh%clToNd)
521 if (x_h1%fe_count(ft)==0) cycle
535 integer ,
dimension(w1) :: p1
536 integer ,
dimension(nbDof) :: p2
537 real(RP),
dimension(nbDof) :: u1_loc, val
538 real(RP),
dimension(3,w1) :: Y
539 real(RP),
dimension(3) :: x,z
540 integer :: ii, cl1, s1
546 if ( x_h1%feType(cl1) /= ft ) cycle
549 x = x_h2%dofCoord(:,ii)
553 call getrow(s1, p1, w1, m1%clToNd, cl1)
561 call geotsf_t_inv(z, x, y(1:3,1:s1), s1, m1%clType(cl1) )
565 call getrow(p2, nbdof, x_h1%clToDof, cl1)
568 select case(x_h2%dofType(ii))
572 call scal_fe(val, nbdof, z(1:dim), dim, ft)
574 u2(ii) = sum( val*u1_loc )
577 call quit(
"feSpace_mod: interp_scal_fe:& 578 & DOF type not supported")
605 real(RP),
dimension(:) ,
allocatable :: val
606 type(
fespace) ,
intent(in) :: X_h
607 real(RP),
dimension(:) ,
intent(in) :: u
608 real(RP),
dimension(:,:),
intent(in) :: P
610 integer,
dimension(:),
allocatable :: T
611 type(
mesh),
pointer :: m =>null()
612 type(
graph) :: ndToNd
614 integer :: w1, nbDof, dim, ft
617 &
"feSpace_mod : eval_scal_fe_at_points" 620 &
"feSpace_mod: eval_scal_fe_at_points:& 621 & fe space 'X_h' not valid" )
623 if (
size(u,1)/=x_h%nbDof)
call quit( &
624 &
"feSpace_mod: eval_scal_fe_at_points:& 625 & fe function 'u' uncorrect")
627 if (
size(p,1)/=3 )
call quit( &
628 &
"feSpace_mod: eval_scal_fe_at_points:& 629 & argument 'P' must have shape 3 x nb_points")
660 if (x_h%fe_count(ft)==0) cycle
674 integer ,
dimension(w1) :: p1
675 integer ,
dimension(nbDof) :: p2
676 real(RP),
dimension(nbDof) :: u_loc, u_base_val
677 real(RP),
dimension(3,w1) :: Y
678 real(RP),
dimension(3) :: x,z
679 integer :: ii, cl, s1
688 if ( x_h%feType(cl) /= ft ) cycle
692 call getrow(s1, p1, w1, m%clToNd, cl)
705 call getrow(p2, nbdof, x_h%clToDof, cl)
709 call scal_fe(u_base_val, nbdof, z(1:dim), dim, ft)
711 val(ii) = sum( u_base_val*u_loc )
732 integer ,
dimension(:) ,
intent(inout):: T
733 real(RP),
dimension(:,:),
intent(in) :: P
734 type(
fespace) ,
intent(in) :: X_h
735 type(
graph) ,
intent(in) :: ndToNd
737 type(
mesh),
pointer :: m=>null()
738 integer :: nbPts, w1, w2, w3, w4, cpt1, cpt2, cpt3
742 &
'feSpace_mod : locate_nodes' 745 &
"feSpace_mod: locate_nodes:& 746 & fe space 'X_h' not valid" )
748 if (
size(p,1)/= 3)
call quit( &
749 &
"feSpace_mod: locate_nodes:& 750 & array 'P' first dimension must be 3" )
756 if (
size(t,1)/=nbpts)
call quit( &
757 &
"feSpace_mod: locate_nodes:& 758 & node tab 'T' uncorrect" )
773 a =
re(cpt1, nbpts)*100._rp
775 &
" locate_nodes, 1st search =",&
779 a =
re(cpt2, nbpts)*100._rp
781 &
" locate_nodes, 2nd search =",&
786 a =
re(cpt3, nbpts)*100._rp
788 &
" locate_nodes, 3rd search =",&
795 integer ,
dimension( w1) :: p1
796 integer ,
dimension( w2) :: p2
797 integer ,
dimension( w3) :: p3
798 integer ,
dimension( w4) :: p4, bf1
799 real(RP),
dimension(3,w1) :: Y
801 integer :: s1, s2, s3, s4
803 integer :: ii, jj, cl
805 real(RP),
dimension(3) :: x
815 call getrow(s1, p1, w1, m%ndToCl, t(ii) )
821 if (x_h%feType(cl) ==
fe_none) cycle
825 call getrow(s2, p2, w2, m%clToNd, cl )
846 call getrow(s3, p3, w3, ndtond, t(ii) )
850 call union(s4, p4, bf1, w4, p1, w1, &
851 & m%ndToCl, p3(1:s3), s3)
858 if (x_h%feType(cl) ==
fe_none) cycle
862 call getrow(s2, p2, w2, m%clToNd, cl )
902 real(RP),
dimension(3),
intent(in) :: x
903 type(
fespace) ,
intent(in) :: X_h
906 integer ,
dimension( CELL_MAX_NBNODES) :: p1
907 real(RP),
dimension(3,CELL_MAX_NBNODES) :: Y
908 integer :: ii, jj, nbVtx, s1
910 type(
mesh),
pointer :: m=>null()
919 if (x_h%feType(ii) ==
fe_none) cycle
933 a = a + sum(abs( y(:,jj) - x ))
954 integer,
dimension(:,:),
allocatable :: dofTab
955 integer,
dimension(X_h%mesh%nbCl) :: cl_row
960 &
"feSpace_mod : assemble" 962 if ( sum(x_h%feType(:))==0 )
call quit( &
963 'feSpace_mod: assemble: feType not defined' )
972 wdt = x_h%mesh%ndToCl%width
981 &
" Number of DOF =", x_h%nbDof
984 &
'feSpace_mod: feSpace_assemble: assembling not valid' )
992 type(
mesh),
pointer :: m=>null()
994 integer ,
dimension(CELL_MAX_NBNODES) :: p_cl
995 integer ,
dimension(FE_MAX_NBDOF) :: p_dof
996 real(RP),
dimension(3, CELL_MAX_NBNODES):: X
997 integer :: ft, fe_typ, cl, sz, ll, dof
998 integer :: dim, nbDof
1000 call allocmem( x_h%dofCoord, 3, x_h%nbDof)
1005 if( x_h%fe_count(ft) == 0 ) cycle
1011 do cl=1, x_h%mesh%nbCl
1012 fe_typ = x_h%feType(cl)
1014 if (ft /= fe_typ) cycle
1020 x(1:3,ll) = m%nd( 1:3, p_cl(ll) )
1024 call assemble(g, m%clType(cl), x(1:3, 1:sz), sz)
1032 x_h%dofCoord(:,dof) = g%Ty(:,ll)
1044 integer,
dimension(:,:),
allocatable,
intent(inout) :: dofTab
1045 integer,
dimension(:),
intent(out) :: cl_row
1046 type(
fespace),
intent(inout) :: X_h
1048 integer,
dimension(X_h%mesh%nbCl) :: nnz
1049 integer :: ii, cpt, fe_typ, nn
1061 do ii = 1, x_h%mesh%nbCl
1062 fe_typ = x_h%feType(ii)
1064 x_h%fe_count(fe_typ) = x_h%fe_count(fe_typ) + 1
1078 x_h%clToDof =
graph(nnz,
size(nnz,1), 0)
1090 subroutine scan_dof(dofTab, X_h, wdt)
1091 integer,
dimension(:,:),
intent(inout) :: dofTab
1092 type(
fespace),
intent(inout) :: X_h
1093 integer ,
intent(in) :: wdt
1095 type(
mesh),
pointer :: m=>null()
1096 integer ,
dimension(wdt, CELL_MAX_NBNODES):: vtx_toCl
1097 integer ,
dimension(wdt) :: dof1_cl, temp
1098 integer ,
dimension(CELL_MAX_NBNODES):: cl1_vtx, cl2_nd
1099 integer ,
dimension(CELL_MAX_NBNODES):: vtx_nbCl
1100 integer ,
dimension(CELL_MAX_NBVTX) :: dof1_vtx, dof2_vtx
1101 integer ,
dimension(CELL_MAX_NBVTX) :: dof1_vtx_g, dof2_vtx_g
1102 real(RP),
dimension(CELL_MAX_NBVTX) :: dof1_bary, dof2_bary
1103 integer ,
dimension(CELL_MAX_NBVTX) :: sort1, sort2
1104 integer ,
dimension(2) :: p_3
1107 integer :: dof_cpt, ii, jj, ll, nn, vtx
1108 integer :: cl1, cl1_nbVtx
1109 integer :: cl2, cl2_nbNd, cl2_ind
1110 integer :: dof1, dof1_type, dof1_geo
1111 integer :: dof1_nbCl
1112 integer :: dof2, dof2_type, dof2_geo
1113 integer :: geo1, ft1, ft2
1122 ft1 = x_h%feType( cl1 )
1144 call getrow(vtx_nbcl(ii), vtx_tocl(:,ii), wdt, &
1145 & m%ndToCl, cl1_vtx(ii))
1157 inner_loop:
do jj=1, vtx_nbcl(ii)
1158 ll = vtx_tocl(jj,ii)
1159 if ( ll == cl1 )
then 1169 dof_cpt = dof_cpt + 1
1174 select case(dof1_geo)
1179 doftab(3, dof_cpt) = dof1_type
1192 dof1_nbcl = vtx_nbcl(vtx)
1193 if (dof1_nbcl==0)
goto 10
1194 dof1_cl( 1: dof1_nbcl) = vtx_tocl( 1: dof1_nbcl, vtx)
1199 dof1_vtx_g(1) = cl1_vtx( dof1_vtx(1) )
1204 ngb_cl_a:
do cl2_ind=1, dof1_nbcl
1206 cl2 = dof1_cl(cl2_ind)
1207 ft2 = x_h%feType(cl2)
1208 if ( ft2 ==
fe_none ) cycle ngb_cl_a
1213 call getrow(cl2_nbnd, cl2_nd, &
1221 if ( dof2_geo /= dof1_geo) cycle dof2_a
1230 dof2_vtx_g(1) = cl2_nd( dof2_vtx(1) )
1235 bool = ( dof1_vtx_g(1) == dof2_vtx_g(1) )
1236 if ( .NOT. bool ) cycle dof2_a
1241 if ( dof2_type /= dof1_type) cycle dof2_a
1244 doftab(1:2, dof_cpt) = (/ cl2, dof2 /)
1253 doftab(3, dof_cpt) = dof1_type
1279 & vtx_tocl( 1: ll, ii), ll, &
1280 & vtx_tocl( 1: nn, jj), nn)
1282 if (dof1_nbcl==0)
goto 20
1289 dof1_vtx_g(1:2) = cl1_vtx( dof1_vtx(1:2) )
1290 sort1(1:2) = dof1_vtx_g(1:2)
1298 ngb_cl_b:
do cl2_ind=1, dof1_nbcl
1300 cl2 = dof1_cl(cl2_ind)
1301 ft2 = x_h%feType(cl2)
1302 if ( ft2 ==
fe_none ) cycle ngb_cl_b
1307 call getrow(cl2_nbnd, cl2_nd, &
1315 if ( dof2_geo /= dof1_geo) cycle dof2_b
1324 dof2_vtx_g(1:2) = cl2_nd( dof2_vtx(1:2) )
1325 sort2(1:2) = dof2_vtx_g(1:2)
1331 bool = all( sort1(1:2) == sort2(1:2) )
1333 if ( .NOT. bool ) cycle dof2_b
1343 & , dof2_vtx_g(1:2) )
1347 bool =
equal( dof1_bary(1), dof2_bary( p_2 ) )
1348 if ( .NOT. bool ) cycle dof2_b
1353 if ( dof2_type /= dof1_type) cycle dof2_b
1356 doftab(1:2, dof_cpt) = (/ cl2, dof2 /)
1367 doftab(3, dof_cpt) = dof1_type
1384 dof1_nbcl = vtx_nbcl(vtx)
1385 if (dof1_nbcl==0)
goto 30
1387 dof1_cl( 1: dof1_nbcl) = vtx_tocl( 1: dof1_nbcl, vtx)
1396 & dof1_cl( 1: dof1_nbcl), dof1_nbcl, &
1397 & vtx_tocl( 1: jj, vtx), jj)
1402 dof1_cl( 1: ll) = temp( 1: ll)
1410 dof1_vtx_g(1:3) = cl1_vtx( dof1_vtx(1:3) )
1411 sort1(1:3) = dof1_vtx_g(1:3)
1412 call sort(sort1(1:3), 3)
1419 ngb_cl_c:
do cl2_ind=1, dof1_nbcl
1421 cl2 = dof1_cl(cl2_ind)
1422 ft2 = x_h%feType(cl2)
1423 if ( ft2 ==
fe_none ) cycle ngb_cl_c
1428 call getrow(cl2_nbnd, cl2_nd, &
1436 if ( dof2_geo /= dof1_geo) cycle dof2_c
1446 dof2_vtx_g(1:3) = cl2_nd( dof2_vtx(1:3) )
1447 sort2(1:3) = dof2_vtx_g(1:3)
1448 call sort(sort2(1:3), 3)
1453 bool = all( sort1(1:3) == sort2(1:3) )
1454 if ( .NOT. bool ) cycle dof2_c
1464 & , dof2_vtx_g(1:3) )
1468 bool =
equal( dof1_bary(1), dof2_bary( p_3(1) ) )
1470 &
equal( dof1_bary(2), dof2_bary( p_3(2) ) )
1472 if ( .NOT. bool ) cycle dof2_c
1477 if ( dof2_type /= dof1_type) cycle dof2_c
1480 doftab(1:2, dof_cpt) = (/ cl2, dof2 /)
1490 doftab(3, dof_cpt) = dof1_type
1494 call quit(
'feSpace_mod: scan_dof:& 1495 & cell type not supported')
1507 integer,
dimension(:,:),
intent(inout) :: dofTab
1508 integer,
dimension(:) ,
intent(in) :: cl_row
1509 type(
fespace) ,
intent(inout) :: X_h
1511 integer :: cpt, ii, jj, cl, dof, fe_typ, j1, j2
1517 do ii = 1,
size( doftab, 2)
1518 if ( doftab(1, ii) == 0 )
then 1525 if (cpt/=sum( x_h%dof_count))
call quit( &
1526 &
'feSpace_mod: build_clToDof: 1')
1527 if (cpt == 0 )
call quit( &
1528 &
'feSpace_mod: build_clToDof: 2')
1530 x_h%clToDof%nc = cpt
1533 call allocmem(x_h%dofType, x_h%nbDof)
1534 do ii = 1,
size( doftab, 2)
1535 if ( doftab(2, ii) == 0 )
then 1537 x_h%dofType(dof) = doftab(3, ii)
1544 do ii = 1,
size( doftab, 2)
1546 if ( doftab(2, ii) == 0 ) cycle
1549 do while( doftab(2, jj) /= 0 )
1554 jj = cl_row( cl ) + dof
1557 doftab(1, ii) = doftab(1, jj)
1563 do cl = 1, x_h%mesh%nbCl
1564 fe_typ = x_h%feType(cl)
1566 if (fe_typ==0) cycle
1571 j2 = cl_row(cl) + jj
1573 call setrow(x_h%clToDof, doftab(1, j1:j2), jj, cl)
1586 integer,
dimension(2),
intent(out) :: p
1587 integer,
dimension(3),
intent(in) :: t1, t2
1589 if (t1(1)==t2(1))
then 1591 if (t1(2)==t2(2))
then 1597 else if (t1(1)==t2(2))
then 1599 if (t1(2)==t2(1))
then 1607 if (t1(2)==t2(2))
then 1624 integer,
intent(out) :: p
1625 integer,
dimension(2),
intent(in) :: t1, t2
1627 if (t1(1)==t2(1))
then 1641 real(RP),
dimension(:),
allocatable :: uh
1642 type(
fespace) ,
intent(in) :: X_h
1643 procedure(r3tor) :: u
1648 &
"feSpace_mod : interp_scal_func" 1651 &
"feSpace_mod: interp_scal_func:& 1652 & fe space 'X_h' not valid" )
1657 select case (x_h%dofType(ii))
1659 uh(ii) = u(x_h%dofCoord(:,ii))
1661 call quit(
"feSpace_mod: interp_scal_func:& 1662 & DOF type not supported" )
1675 real(RP),
dimension(:),
allocatable :: phi_h
1676 type(
fespace) ,
intent(in) :: X_h
1677 procedure(r3tor3) :: phi
1679 type(
mesh),
pointer :: m
1680 integer :: dim, nbDof, ft, nbItf
1683 &
"feSpace_mod : interp_vect_func" 1687 if (m%nbItf<=0)
call quit(
"feSpace_mod:& 1688 & feSpace_interp_vect_func: mesh interfaces not defined" )
1694 if (x_h%fe_count(ft)==0) cycle
1708 integer ,
dimension(nbDof) :: p
1709 integer ,
dimension(CELL_MAX_NBNODES) :: p_cl
1710 real(RP),
dimension(3, CELL_MAX_NBNODES) :: X
1711 real(RP),
dimension(nbDof) :: val
1712 integer ,
dimension(CELL_MAX_NBITF) :: eps
1714 real(RP),
dimension(3) :: vec
1716 integer :: cl, ii, jj, cl_nd, nb_itf
1719 real(RP),
dimension(3,nbItf) :: nf
1720 real(RP),
dimension(nbItf) :: msf
1737 x(1:3,ii) = m%nd( 1:3, p_cl(ii) )
1741 call assemble(g, m%clType(cl), x(1:3, 1:cl_nd), cl_nd)
1750 &
"feSpace_mod: feSpace_interp_vect_func:& 1751 & cell orientation incorrect" )
1764 val(ii) = sum( nf(:,ii) * phi(g%Ty(:,ii)) )
1765 val(ii) = val(ii) * msf(ii)
1767 if (eps(ii)==1) cycle
1775 val(ii) = sum( nf(:,ii) * phi(g%Ty(:,ii)) )
1776 val(ii) = val(ii) * msf(ii)
1778 if (eps(ii)==1) cycle
1782 vec = phi(g%Ty(:,3))
1791 val(jj) = sum( nf(:,ii) * phi(g%Ty(:,jj)) )
1792 val(jj) = val(jj) * msf(ii)
1795 val(jj) = sum( nf(:,ii) * phi(g%Ty(:,jj)) )
1796 val(jj) = val(jj) * msf(ii)
1798 if ( eps(ii) == 1 ) cycle
1799 val(jj-1:jj) = -val(jj-1:jj)
1803 vec = phi(g%Ty(:,7)) * 2.0_rp * msk
1804 val(7) = sum( vec * nf(:,3) )
1805 val(8) = sum( vec * nf(:,1) )
1807 vec = x(:,2) - x(:,1)
1808 val(7) = val(7) / sum( vec * nf(:,3) )
1810 vec = x(:,3) - x(:,1)
1811 val(8) = val(8) / sum( vec * nf(:,1) )
1814 call quit(
"feSpace_mod: feSpace_interp_vect_func:& 1815 & fe type not supported")
1820 call getrow(p, nbdof, x_h%clTodof, cl)
1840 logical,
dimension(:),
allocatable :: dof_flag
1841 type(
fespace) ,
intent(in) :: X_h
1842 integer ,
intent(in) :: dim
1843 procedure(r3tor) ,
optional :: f
1845 logical ,
dimension(:),
allocatable :: flag
1847 integer,
dimension(FE_MAX_NBDOF) :: dof_tab
1848 integer :: ii, jj, nb_dof
1851 &
"feSpace_mod : flag_X_h_dof" 1853 if (.NOT.
valid(x_h))
call quit(
'feSpace_mod:& 1854 & flag_X_h_dof: X_h not valid')
1860 do ii=1, x_h%mesh%nbCl
1863 if (.NOT.flag(ii)) cycle
1868 dof_flag( dof_tab(jj) ) = .true.
DERIVED TYPE geoTsf: geometrical transformation of reference cells
integer, parameter fe_rt0_2d
integer, dimension(fe_tot_nb), public fe_dim
Reference cell dimension for each fe method.
subroutine get_perm_3(p, t1, t2)
t2 is a permutation of t1
subroutine fespace_clear(X_h)
Destructor for feSpace type.
subroutine scan_dof(dofTab, X_h, wdt)
Checks every local dof to say wether it is equal to dof 'dof2' of cell 'cl2' for cl2 < cell...
DEFINITION OF ABSTRACT_INTERFACES FOR THE LIBRARY CHORAL
type(r_2d), dimension(fe_tot_nb), public fe_dof_coord
DOF node coordinates.
integer, dimension(fe_max_nbdof, fe_tot_nb), public fe_dof_geo
FE_DOF_GEO(i, j) = Geometric type of DOF i of the FE method j.
DERIVED TYPE graph: sparse matrices of boolean in CSR format
print a short description
integer, parameter cell_tot_nb
Number of CELL types.
integer, parameter cell_tet
Tetrahedron.
subroutine initialise_doftab(dofTab, cl_row, X_h)
subroutine, public eval_scal_fe_at_points(val, P, u, X_h)
u is a finite element function on the finite element space X_h
deallocate memory for real(RP) arrays
integer, dimension(cell_tot_nb), public cell_nbvtx
Number of vertexes for each cell type.
subroutine fespace_write(X_h, fileName, fileFormat)
Write feSpace to file 'fileName' with format 'fileFormat'.
subroutine get_perm_2(p, t1, t2)
t2 is a permutation of t1
subroutine x_h_dofcoord(X_h)
integer, parameter fe_p2_2d
subroutine, public interp_scal_fe(u2, X_h2, u1, X_h1)
Interpolate a scalar finite element function u1 on a second finite element space X_h2.
QUADRATURE RULES ON REFERENCE CELLS
subroutine, public flag_x_h_dof(dof_flag, X_h, dim, f)
OUTPUT: flag(:) array of logical with size X_hnbDof.
DEFINITION OF FINITE ELEMENT METHODS
logical function, public belongstocell(x, Y, n, ct)
Tests if the node x belongs to the cell with node coordinates Y and of type ct.
subroutine, public graph_prod(g, A, B)
Matrix product g = A*B.
integer, parameter fe_p1_2d_disc_ortho
integer, dimension(cell_tot_nb), public cell_geo
Associated reference cell for each cell type.
subroutine, public flag_mesh_cells(flag, m, dim, f)
OUTPUT: flag(:) array of logical with size mnbCl.
integer, parameter fe_rt1_2d_2
integer, parameter cell_edg
Edge (line segment)
integer, parameter fe_tot_nb
Number of FE methods.
subroutine fespace_assemble(X_h)
sets cell dof local indexing –> global dof indexing connectivity
subroutine, public interface_orientation(nb_itf, eps, n, m, cl)
eps(ii) = +1 if the interface ii of the cell cl in mesh m is oriented outwards the cell cl = -1 other...
conversion integers or rational to real
subroutine fespace_interp_vect_func(phi_h, phi, X_h)
Interp : vector function case.
integer, parameter fe_max_nbdof
Maximum number of dof for an element.
REAL NUMBERS PRECISION IN CHORAL: selects simple/double/quad
integer, parameter fe_p2_3d
Geometrical transformation .
subroutine, public cell_ms_itf_n(ms, n, itf_ms, nbItf, g)
INPUT :: g = geoTsf, must have been set nbItf = number of interfaces OUTPUT : ms = measure of T(K_ref...
logical function fespace_valid(X_h)
Check if the structure content is correct.
integer function closest_cell(x, X_h)
finds the cell in X_h with non void feType the closest from node x
DERIVED TYPE feSpace: finite element spaces
integer, parameter fe_p3_1d
integer, parameter cell_trg
Triangle.
integer, dimension(fe_tot_nb), public fe_nbdof
Number of DOF for each fe method.
subroutine build_cltodof(dofTab, cl_row, X_h)
integer, dimension(cell_tot_nb), public cell_nbitf
Number of interfaces for each cell type.
type(fespace) function fespace_create(m)
Constructor for the type feSpace
ALGEBRAIC OPERATIONS ON SETS
subroutine fespace_print(X_h)
Print a short description.
integer, parameter, public cell_max_nbitf
Cell maximal number of interfaces.
subroutine, public getndcoord(ndCoord, s, ndInd, n, m)
returns node coordinates of node indexes in ndInd
subroutine, public union(sz, tab, bf1, n, bf2, p, g, rows, m)
graph row union
integer, parameter fe_p1_2d
subroutine fespace_set(X_h, ft)
Apply the finite element method 'ft' to all cells with comptible geometry.
allocate memory for real(RP) arrays
Derived type feSpace: finite element space on a mesh.
subroutine, public geotsf_t_inv(z, X, Y, n, ct)
x = 3D node 3D cell of type ct with nodes = A, B, C, ... given by Y(:,1)=A, Y(:,2)=B, ..., Y(:,n)
subroutine, public order_2(t)
order an array of size 2
character(len=4), dimension(cell_tot_nb), public cell_name
CELL_ARRAY Arrays describing cells.
integer choral_verb
Verbosity level.
integer, dimension(cell_max_nbvtx, fe_max_nbdof, fe_tot_nb), public fe_dof_vtx
FE_DOF_VTX(1:n,i,j) = for the DOF i of the FE method j :
subroutine locate_nodes(T, P, X_h, ndToNd)
Locate each point P(:,i) inside a cell of X_hmesh associated to a non void finite element...
integer, parameter fe_dof_lag
Nodal value (Lagrangian DOF, scalar finite element)
subroutine, public interp_scal_func(uh, u, X_h)
Interpolation of a scalar function to a scalar finite element function.
integer, dimension(fe_tot_nb), public fe_geo
Reference cell geometry for each fe method.
character(len=16), dimension(0:fe_tot_nb), public fe_name
Name for each fe method.
integer, parameter fe_rt1_1d
subroutine, public sort(t, n)
Sorts the array t of length N in ascending order by the straight insertion method.
subroutine, public closest_node(V, dist, pt, m, nDToNd, start)
For each point X=pt(:,ii), determines a node V in the mesh m that minimises |X-V|.
DEFINITION OF GLOBAL VARIABLES FOR THE LIBRARY CHORAL
integer, parameter fe_none
integer, parameter cell_vtx
Vertex.
real(rp), dimension(cell_max_nbvtx, fe_max_nbdof, fe_tot_nb), public fe_dof_bary
FE_DOF_BARY(1:n,i,j) = for the DOF i of the FE method j :
subroutine, public cap_sorted_set(cpt, t, n, t1, n1, t2, n2)
t(1:cpt) = t1(1:n1) \cap t2(1:n2)
integer, parameter fe_p3_2d
integer, dimension(fe_max_nbdof, fe_tot_nb), public fe_dof_type
FE_DOF_TYPE(i,j) = dof type of the DOF i of the FE method j (Lagrange, ...)
subroutine gmsh_write(X_h, fileName)
Write feSpace m to file 'fileName' gmsh ASCII format.
integer, parameter fe_p1_3d
integer, parameter fe_p1_1d
logical function, public cell_orientation(m, cl)
has cell 'cl' the direct orientation ?
The type graph stores sparse matrices of boolean in CSR format.
DEFINITION OF GEOMETRICAL CELLS (for meshes)
integer, parameter fe_rt0_1d
integer, parameter fe_p2_1d
subroutine, public scal_fe(val, nbDof, x, dim, ft)
Evaluate FE basis functions at point x.
write a finite element space to a file
subroutine, public gmsh_addview(X_h, v, fileName, vname, time, idx)
add a view to X_h output file gmesh file format
integer, parameter, public cell_max_nbnodes
Cell maximal number of nodes.