Choral
mesh_mod.F90
Go to the documentation of this file.
1 
55 
56 
57 module mesh_mod
58 
59 
62  use real_type
63  use basic_tools
64  use abstract_interfaces, only: r3tor
65  use algebra_lin
66  use cell_mod
67  use graph_mod
68 
69  implicit none
70  private
71 
72  public :: mesh
73  public :: clear, print, valid
74  public :: closest_node !! TESTED
75  public :: write
76  public :: getndcoord
77  public :: flag_mesh_cells
78  public :: cell_orientation
79  public :: interface_orientation
81  public :: mesh_clear_2
82 
83  ! %----------------------------------------%
84  ! | |
85  ! | DERIVED TYPE |
86  ! | |
87  ! %----------------------------------------%
92  type mesh
93 
95  integer :: nbcl=0
97  integer :: nbnd=0
99  integer :: dim=0
101  integer :: nbitf = 0
102 
104  real(RP), dimension(:,:), allocatable :: nd
105 
107  integer , dimension(:) , allocatable :: cltype
108 
110  integer , dimension(:) , allocatable :: cltag
111 
114  integer, dimension(CELL_TOT_NB) :: cell_count = 0
115 
117  type(graph) :: cltond
119  type(graph) :: ndtocl
121  type(graph) :: itftocl
123  type(graph) :: cltoitf
124 
125  contains
126 
128  final :: mesh_clear
129 
130  end type mesh
131 
132  ! %----------------------------------------%
133  ! | |
134  ! | GENERIc SUBROUTINES |
135  ! | |
136  ! %----------------------------------------%
137  interface clear
138  module procedure mesh_clear
139  end interface clear
140 
141  interface mesh
142  module procedure readmesh, mesh_create_1d
143  end interface mesh
144 
145  interface write
146  module procedure mesh_write
147  end interface write
148 
149  interface valid
150  module procedure mesh_valid
151  end interface valid
152 
153  interface print
154  module procedure mesh_print
155  end interface print
156 
157 contains
158 
159 
161  subroutine mesh_clear(m)
162  type(mesh), intent(inout) :: m
163 
164  !! clears the data tn the mesh built by 'call create(...)'
165  !!
166  m%nbCl = 0
167  m%nbNd = 0
168  call freemem(m%nd)
169  call freemem(m%clType)
170  call freemem(m%clTag)
171  call clear(m%clToNd)
172 
173 
174  !! clears the data tn the mesh built after 'call create(...)'
175  !!
176  call mesh_clear_2(m)
177 
178  end subroutine mesh_clear
179 
183  subroutine mesh_clear_2(m)
184  type(mesh), intent(inout) :: m
185 
186  m%dim = 0
187  m%nbItf = 0
188 
189  call clear(m%ndToCl)
190 
191  call clear(m%itfToCl)
192  call clear(m%clToItf)
193 
194  m%cell_count = 0
195 
196  end subroutine mesh_clear_2
197 
198 
201  subroutine mesh_print(m)
202  type(mesh), intent(in) :: m
203 
204  integer :: ii
205 
206  write(*,*)"mesh_mod : print"
207  if (valid(m)) then
208  write(*,*)" Status = valid"
209  else
210  write(*,*)" Status = not valid"
211  end if
212 
213  write(*,*)" Number of nodes =", m%nbNd
214 
215  if (m%nbItf>0) then
216  write(*,*)" Interfaces assembled"
217  write(*,*)" Number of interfaces =", m%nbItf
218  else
219  write(*,*)" Interfaces not assembled"
220  end if
221 
222  write(*,*)" Number of cells =", m%nbCl
223  write(*,*)" Number of cells per cell type"
224  do ii=1, cell_tot_nb
225 
226  if ( m%cell_count(ii) == 0 ) cycle
227 
228  write(*,*)" "&
229  &//cell_name(ii)//&
230  &" =", m%cell_count(ii)
231 
232  end do
233 
234  end subroutine mesh_print
235 
236 
238  function mesh_valid(m) result(b)
239  type(mesh), intent(in) :: m
240  logical :: b
241 
242  b = .false.
243  if (.NOT. ( allocated(m%nd) )) return
244  if (.NOT. ( allocated(m%clType) )) return
245  if (.NOT. ( allocated(m%clTag) )) return
246  if ( valid(m%clToNd) < 0 ) return
247  if ( valid(m%ndToCl) < 0 ) return
248 
249  b = ( m%nbCl>0 ) .AND. ( m%nbNd>0 )
250  b = b .AND. ( m%nbCl == sum(m%cell_count) )
251  b = b .AND. ( m%dim>0 ) .AND. ( m%dim<4 )
252  b = b .AND. ( all( shape(m%nd) == (/3,m%nbNd/)) )
253  b = b .AND. ( size(m%clType,1) == m%nbCl )
254  b = b .AND. ( size(m%clTag,1) == m%nbCl )
255  b = b .AND. ( m%clToNd%nl == m%nbCl )
256  b = b .AND. ( m%ndToCl%nl == m%nbNd )
257 
258  ! mesh with interfaces
259  if (m%nbItf>0) then
260  b = b .AND. ( valid(m%clToItf) > 0 )
261  b = b .AND. ( valid(m%itfToCl) > 0 )
262  if (.NOT.b) return
263 
264  b = b .AND. ( m%clToItf%nl == m%nbCl )
265  b = b .AND. ( m%itfToCl%nl == m%nbItf)
266  end if
267 
268  end function mesh_valid
269 
270 
284  function readmesh(fileName, fileFormat) result(m)
285  type(mesh) :: m
286  character(len=*), intent(in) :: fileName, fileFormat
287 
288  logical :: b
289 
290  if (choral_verb>0) write(*,*)&
291  &"mesh_mod : readMesh = "//trim(filename)
292  call clear(m)
293 
294  inquire(file=filename, exist=b)
295  if (.NOT.b) call quit( 'mesh_mod: readMesh: uncorrect file ')
296 
297  open(unit=10, file=filename)
298  select case(trim(fileformat))
299  case("gmsh")
300  call gmesh_readmesh(m)
301 
302  case default
303  call quit( 'mesh_mod: readMesh: uncorrect file format' )
304  end select
305  close(10)
306 
307  call mesh_create_end(m)
308 
309  if (.NOT.valid(m)) call quit('mesh_mod: &
310  & readMesh: construction not valid')
311 
312  end function readmesh
313 
315  subroutine gmesh_readmesh(m)
316  type(mesh), intent(out) :: m
317 
318  integer :: ii, jj, kk, ll, nn
319  integer, dimension(CELL_MAX_NBNODES + 8) :: tab
320  integer, dimension(:,:), allocatable :: clTab
321 
322  !! reading the number of nodes
323  do ii=1, 4
324  read(10,*)
325  end do
326  read(10,*) nn
327  if (nn<=0) call quit( "mesh_mod: gmesh_readMesh: 1" )
328 
329  !! reading the nodes
330  m%nbNd = nn
331  call allocmem(m%nd, 3, nn)
332  do ii=1, nn
333  read (10, *) jj, m%nd(1:3,ii)
334  end do
335 
336  !! reading the number of cells
337  read(10,*) ; read(10,*)
338  read(10,*) nn
339  if (nn<=0) call quit( "mesh_mod: gmesh_readMesh: 2" )
340  m%nbCl = nn
341 
342  !! reading cell nodes
343  call allocmem(m%clType, nn)
344  call allocmem(m%clTag , nn)
345  call allocmem(cltab, cell_max_nbnodes, nn )
346  do ii=1, nn
347  ! jj=cell index, kk=cel type, ll=cell number of tags
348  read(10,*) jj, kk, ll, m%clTag(ii)
349 
350  ! cell type
351  kk = gmsh_to_cell(kk)
352  m%clType(ii) = kk
353 
354  ! cell number of nodes
355  jj = cell_nbnodes(kk)
356 
357  ! read cell nodes
358  kk = 3 + ll + 1 ! first nd index
359  ll = 3 + ll + jj ! last nd index
360  backspace(10)
361  read(10,*) tab(1:ll)
362 
363  ! store cell nodes
364  cltab(1:jj, ii) = tab(kk:ll)
365 
366  end do
367 
368  call mesh_create_cltab(m, cltab)
369 
370  end subroutine gmesh_readmesh
371 
379  subroutine mesh_create_cltab(m, clTab)
380  type(mesh), intent(inout) :: m
381  integer , dimension(:,:) :: clTab
382 
383  integer, dimension(:), allocatable :: nnz
384  integer :: ii, jj, ll
385 
386  call allocmem(nnz, size(cltab, 2))
387 
388  ! cell number of nodes
389  do ii=1, size(cltab, 2)
390 
391  ll = m%clType(ii)
392  jj = cell_nbnodes(ll)
393  nnz(ii) = jj
394 
395  end do
396 
397  ! create cell to node graph
398  m%clToNd = graph(nnz, m%nbCl, m%nbNd)
399 
400  ! fill in graph
401  !
402  jj = 1
403  do ii=1, size(cltab, 2)
404 
405  ll = nnz(ii)
406  m%clToNd%col(jj: jj+ll-1) = cltab(1:ll, ii)
407  jj = jj + ll
408 
409  end do
410 
411  end subroutine mesh_create_cltab
412 
413 
419  subroutine mesh_write(m, fileName, fileFormat, cell_tags)
420  type(mesh) , intent(in) :: m
421  character(len=*) , intent(in) :: fileName, fileFormat
422  logical, optional, intent(in) :: cell_tags
423 
424  if (choral_verb>0) write(*,*)&
425  &"mesh_mod : writee = "//trim(filename)
426 
427  if (.NOT.valid(m)) call quit('mesh_mod: mesh_write: mesh not valid')
428 
429  open(unit=10, file=filename)
430  select case(trim(fileformat))
431  case("gmsh")
432  call gmesh_writemesh(m, cell_tags)
433 
434  case default
435  call quit( 'mesh_mod: mesh_write: uncorrect file format' )
436  end select
437  close(10)
438 
439  end subroutine mesh_write
440 
442  subroutine gmesh_writemesh(m, cell_tags)
443  type(mesh) , intent(in) :: m
444  logical, optional, intent(in) :: cell_tags
445 
446  integer :: ii, tt, j1, j2
447 
448  write(10,'(A11)') "$MeshFormat"
449  write(10,'(A7)') "2.2 0 8"
450  write(10,'(A14)') "$EndMeshFormat"
451  write(10,'(A6)') "$Nodes"
452  write(10,*) m%nbNd
453  do ii=1, m%nbNd
454  write(10, *) ii, m%nd(1:3,ii)
455  end do
456  write(10,'(A9)') "$EndNodes"
457  write(10,'(A9)') "$Elements"
458  write(10,*) m%nbCl
459  j1 = 1
460  do ii=1, m%nbCl
461 
462  j2 = m%clType(ii)
463  tt = cell_to_gmsh(j2)
464 
465  j2 = m%clToNd%row(ii+1) - 1
466 
467  write(10, *) ii, tt, 2, m%clTag(ii), 1, m%clToNd%col(j1:j2)
468 
469  j1 = j2 + 1
470  end do
471  write(10,'(A12)') "$EndElements"
472 
473  if (present(cell_tags)) then
474  if (cell_tags) then
475 
476  write(10,fmt="(A)") '$ElementData'
477  write(10,fmt="(A)") '1'
478  write(10,fmt="(A)") "Cell tags"
479  write(10,fmt="(A)") '1'
480  write(10,*) 0.0_rp
481  write(10,fmt="(A)") '3'
482  write(10,*) 1
483  write(10,*) 1
484  write(10,*) m%nbCl
485  do ii=1, m%nbCl
486  write(10,*) ii, m%clTag(ii)
487  end do
488  write(10,fmt="(A)") '$EndElementData'
489 
490  end if
491  end if
492  end subroutine gmesh_writemesh
493 
512  function mesh_create_1d(a, b, n) result(m)
513  type(mesh) :: m
514  real(RP), intent(in) :: a, b
515  integer , intent(in) :: n
516 
517  real(RP) :: h, xi
518  integer :: ii, j1
519  integer, dimension(:), allocatable :: p
520 
521  if (choral_verb>0) write(*,*)"mesh_mod : create_1D"
522  call clear(m)
523 
524  h = (b-a)/real(n, RP)
525  call allocmem(m%nd, 3, n+1)
526 
527  m%nbCl = n + 2 ! n interval cells + 2 vertex cells = the boundary
528  m%nbNd = n + 1
529 
530  do ii=0, n
531  xi = a + real(ii, rp)*h
532  m%nd(:,ii+1) = (/ xi, 0._rp, 0._rp/)
533  end do
534 
535  call allocmem(m%clType, n+2)
536  m%clType(1:2) = cell_vtx
537  m%clType(3: ) = cell_edg
538 
539  call allocmem(m%clTag , n+2)
540  m%clTag = 0
541 
542  !! cell to nodes graph
543  !!
544  call allocmem(p, n+2)
545  p(1:2) = 1
546  p(3: ) = 2
547  m%clToNd = graph(p, m%nbCl, m%nbNd)
548  m%clToNd%col(1) = 1
549  m%clToNd%col(2) = n
550  j1 = 3
551  do ii=1, n
552  m%clToNd%col(j1:j1+1) = (/ii, ii+1/)
553  j1 = j1 + 2
554  end do
555 
556  call mesh_create_end(m)
557 
558  if (.NOT.valid(m)) call quit('mesh_mod: &
559  & mesh_create_1D: construction not valid')
560 
561  end function mesh_create_1d
562 
563 
566  subroutine mesh_create_end(m)
567  type(mesh), intent(inout) :: m
568 
569  integer :: cl, ct, dim
570 
571  if (choral_verb>0) write(*,*) "mesh_mod : create_end =", &
572  & size(m%clType,1)," cells "
573 
574  m%nbCl = size(m%clType,1)
575  m%nbNd = size(m%nd,2)
576  call transpose(m%ndToCl, m%clToNd)
577 
578  !! Set m%cell_count and m%dim
579  !!
580  m%cell_count = 0
581  m%dim = 0
582  do cl=1, m%nbCl
583 
584  ct = m%clType(cl)
585  m%cell_count(ct) = m%cell_count(ct) + 1
586 
587  dim = cell_dim(ct)
588  if (dim>m%dim) m%dim = dim
589 
590  end do
591 
592  end subroutine mesh_create_end
593 
598  subroutine getndcoord(ndCoord, s, ndInd, n, m)
599  integer , intent(in) :: n, s
600  real(RP), dimension(3,s), intent(out) :: ndCoord
601  integer , dimension(n) , intent(in) :: ndInd
602  type(mesh) , intent(in) :: m
603 
604  integer :: jj
605 
606  do jj = 1, n
607  ndcoord(:,jj) = m%nd( :, ndind(jj) )
608  end do
609 
610  end subroutine getndcoord
611 
612 
621  subroutine flag_mesh_cells(flag, m, dim, f)
622  logical, dimension(:), allocatable :: flag
623  type(mesh) , intent(in) :: m
624  integer , intent(in) :: dim
625  procedure(r3tor) , optional :: f
626 
627  integer , dimension( CELL_MAX_NBNODES) :: p
628  real(RP), dimension(3, CELL_MAX_NBNODES) :: X
629  integer :: cl, nbNd, ii, cpt, ct
630  real(RP) :: f_x
631  logical :: bool
632 
633  if (choral_verb>1) write(*,*) &
634  & "mesh_mod : flag_mesh_cells"
635  if (.NOT.valid(m)) call quit(&
636  &'mesh_mod: flag_mesh_cells: mesh not valid')
637 
638  call allocmem(flag, m%nbCl)
639  flag = .false.
640  cpt = 0
641 
642  do cl=1, m%nbCl
643  ct = m%clType(cl)
644  if (cell_dim(ct) == dim) then
645  flag(cl) = .true.
646  cpt = cpt + 1
647  end if
648  end do
649 
650  if (present(f)) then
651  do cl=1, m%nbCl
652  if (.NOT.flag(cl)) cycle
653 
654  call getrow(nbnd, p, cell_max_nbnodes, m%clToNd, cl)
655 
656  call getndcoord(x, cell_max_nbnodes, p(1:nbnd), nbnd, m)
657 
658  bool = .true.
659  loop_nodes: do ii=1, nbnd
660 
661  f_x = f( x(:,ii) )
662 
663  bool = ( f_x >= -real_tol )
664  if (.NOT.bool) exit loop_nodes
665 
666  end do loop_nodes
667  flag(cl) = bool
668 
669  if (.NOT.bool) cpt = cpt - 1
670 
671  end do
672  end if
673 
674  !! Display
675  !!
676  if (choral_verb>1) write(*,*) &
677  & " Number of flaged cells =", cpt
678 
679  end subroutine flag_mesh_cells
680 
681 
697  subroutine closest_node(V, dist, pt, m, nDToNd, start)
698  integer , dimension(:) , allocatable :: V
699  real(RP) , intent(out) :: dist
700  real(RP), dimension(:,:), intent(in) :: pt
701  type(mesh) , intent(in) :: m
702  type(graph) , intent(in) :: ndToNd
703  integer , optional , intent(in) :: start
704 
705  integer , dimension( ndToNd%width) :: p
706  real(RP), dimension( ndToNd%width) :: d
707  real(RP), dimension(3,ndToNd%width) :: Y
708  real(RP), dimension(3) :: x
709  integer , dimension(1) :: ind
710  real(RP) :: a, b
711  integer :: ii, jj, nd, cpt, wdt, sz
712  logical :: bool
713 
714  if (size(pt,1)/=3) call quit( "mesh_mod:&
715  & closest_node: wrong argument 'pt'" )
716 
717  call allocmem(v, size(pt,2))
718  cpt = 0
719  dist = 0._rp
720  wdt = ndtond%width
721 
722  ! starting node
723  nd = m%nbNd
724  if (present(start)) nd = start
725 
726  do ii=1, size(pt,2)
727  x = pt(:,ii)
728 
729  ! starting distance
730  a = sum( (m%nd(:,nd) - x)**2)
731 
732  bool = .true.
733  do while(bool)
734  cpt = cpt + 1
735 
736  ! p(1:sz) = neighbour nodes of nd
737  call getrow(sz, p, wdt, ndtond, nd)
738 
739  ! Y = corresponding coordinates
740  ! b = minimal distance**2
741  call getndcoord(y, wdt, p(1:sz), sz, m)
742  do jj=1, sz
743  y(:,jj) = y(:,jj)-x(:)
744  end do
745  y(:,1:sz) = y(:,1:sz)**2
746  do jj=1, sz
747  d(jj) = sum( y(:,jj) )
748  end do
749  ind = minloc( d(1:sz) )
750  b = d(ind(1))
751 
752  ! one closer node found ?
753  if (b < a - real_tol) then
754  ! YES = restart search after "do while(bool)"
755  nd = p(ind(1))
756  a = b
757 
758  else
759  ! NO = end the research
760  v(ii) = nd
761  bool=.false.
762  if (a> dist) dist=a
763  end if
764  end do
765  end do
766 
767  a = re(cpt, size(pt,2))
768  if (choral_verb>2) write(*,*)&
769  &"mesh_mod : closest_node = &
770  &averagge neighbour nodes used =", real(a,4)
771 
772  end subroutine closest_node
773 
776  function cell_orientation(m, cl) result(bool)
777  logical :: bool
778  type(mesh), intent(in) :: m
779  integer , intent(in) :: cl
780 
781  integer, dimension(:), allocatable :: p
782  integer :: wdt, sz
783  real(RP), dimension(3) :: AB, AC, v
784 
785  wdt = m%clToNd%width
786  call allocmem(p, wdt)
787 
788  select case(m%clType(cl))
789  case(cell_edg, cell_edg_2)
790  !!
791  !! orientation of an edge in R
792 
793  call getrow(sz, p, wdt, m%clToNd, cl)
794  ab = m%nd(:,p(2)) - m%nd(:,p(1))
795  bool = (ab(1)>0._rp)
796 
797  case(cell_trg, cell_trg_2)
798  !!
799  !! orientation of a triangle in R^2
800 
801  call getrow(sz, p, wdt, m%clToNd, cl)
802  ab = m%nd(:,p(2)) - m%nd(:,p(1))
803  ac = m%nd(:,p(3)) - m%nd(:,p(1))
804 
805  v = crossprod_3d(ab, ac)
806  bool = (v(3)>0._rp)
807 
808  case default
809  bool = .false.
810  call quit( 'mesh_mod: cell_orientation:&
811  & cell type not supported' )
812 
813  end select
814 
815  end function cell_orientation
816 
817 
823  subroutine interface_orientation(nb_itf, eps, n, m, cl)
824  integer , intent(out) :: nb_itf
825  integer , dimension(n), intent(out) :: eps
826  type(mesh), intent(in) :: m
827  integer , intent(in) :: cl, n
828 
829  integer, dimension(2) :: p2
830  integer, dimension(CELL_MAX_NBITF) :: p1
831 
832  integer :: ii, coBound
833 
834 #if DBG>0
835  if (m%nbItf<=0) call quit( &
836  & "mesh_mod: interface_orientation:&
837  & try 'call define_interfaces(m)'" )
838 #endif
839 
840  ! interfaces of cell cl
841  call getrow(nb_itf, p1, cell_max_nbitf, m%clToItf, cl)
842  eps(1:nb_itf) = -1
843 
844  ! loop on the interfaces of cell cl
845  do ii=1, nb_itf
846 
847  ! coboundary of the interface p1(ii)
848  call getrow(cobound, p2, 2, m%itfToCl, p1(ii))
849 
850  ! tests if the edge p1(ii) of cell cl has
851  ! the local orientation associated with cell cl
852  if (p2(1)==cl) eps(ii) = 1
853 
854  end do
855 
856  end subroutine interface_orientation
857 
858 end module mesh_mod
Derived type mesh.
Definition: mesh_mod.F90:92
type(mesh) function readmesh(fileName, fileFormat)
Constructor for the type mesh
Definition: mesh_mod.F90:285
DEFINITION OF ABSTRACT_INTERFACES FOR THE LIBRARY CHORAL
subroutine mesh_clear(m)
Destructor for mesh type.
Definition: mesh_mod.F90:162
integer, dimension(:), allocatable, public gmsh_to_cell
Dictionnary GMSH cell desc. –> CHORAL cell desc.
Definition: cell_mod.f90:152
DERIVED TYPE graph: sparse matrices of boolean in CSR format
Definition: graph_mod.F90:33
integer, parameter cell_edg_2
Quadratic edge.
LINEAR ALGEBRA TOOLS
Definition: algebra_lin.F90:9
subroutine mesh_print(m)
display cell types in the mesh
Definition: mesh_mod.F90:202
integer, parameter cell_tot_nb
Number of CELL types.
BASIC TOOLS
Definition: basic_tools.F90:8
deallocate memory for real(RP) arrays
Definition: real_type.F90:163
subroutine, public mesh_clear_2(m)
Destructor for mesh type clears the data tn the mesh built after &#39;call create(...)&#39;.
Definition: mesh_mod.F90:184
subroutine gmesh_writemesh(m, cell_tags)
write mesh to gmsh ASCII file
Definition: mesh_mod.F90:443
subroutine mesh_write(m, fileName, fileFormat, cell_tags)
Write mesh &#39;m&#39; to file &#39;fileName&#39; with format &#39;fileFormat&#39;.
Definition: mesh_mod.F90:420
integer, parameter, public rp
real(kind=RP) = real precision in the code REAL_TOL = epsilon to test real equality ...
Definition: real_type.F90:90
subroutine, public quit(message)
Stop program execution, display an error messahe.
subroutine, public flag_mesh_cells(flag, m, dim, f)
OUTPUT: flag(:) array of logical with size mnbCl.
Definition: mesh_mod.F90:622
integer, parameter cell_edg
Edge (line segment)
integer, dimension(cell_tot_nb), public cell_dim
Dimension for each cell type.
Definition: cell_mod.f90:130
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...
Definition: mesh_mod.F90:824
conversion integers or rational to real
Definition: real_type.F90:153
REAL NUMBERS PRECISION IN CHORAL: selects simple/double/quad
Definition: real_type.F90:33
logical function mesh_valid(m)
Verify allocation.
Definition: mesh_mod.F90:239
integer, dimension(cell_tot_nb), public cell_nbnodes
Number of nodes for each cell type.
Definition: cell_mod.f90:115
integer, parameter cell_trg
Triangle.
subroutine gmesh_readmesh(m)
read mesh from gmsh ASCII file
Definition: mesh_mod.F90:316
CHORAL CONSTANTS
integer, parameter cell_trg_2
Quadratic triangle.
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
Definition: mesh_mod.F90:599
DERIVED TYPE mesh
Definition: mesh_mod.F90:57
allocate memory for real(RP) arrays
Definition: real_type.F90:158
character(len=4), dimension(cell_tot_nb), public cell_name
CELL_ARRAY Arrays describing cells.
Definition: cell_mod.f90:112
integer choral_verb
Verbosity level.
integer, dimension(cell_tot_nb), public cell_to_gmsh
Dictionnary cell desc. –> GMSH cell desc.
Definition: cell_mod.f90:149
subroutine, public mesh_create_end(m)
mesh constructor : final step
Definition: mesh_mod.F90:567
real(rp), parameter, public real_tol
Definition: real_type.F90:91
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: mesh_mod.F90:698
subroutine, public mesh_create_cltab(m, clTab)
mesh constructor, second step, cell types and cell nodes are known cell types are in mclType cell nod...
Definition: mesh_mod.F90:380
DEFINITION OF GLOBAL VARIABLES FOR THE LIBRARY CHORAL
integer, parameter cell_vtx
Vertex.
real(rp) function, dimension(3), public crossprod_3d(u, v)
Cross product in R**3.
type(mesh) function mesh_create_1d(a, b, n)
Constructor for the type mesh
Definition: mesh_mod.F90:513
logical function, public cell_orientation(m, cl)
has cell &#39;cl&#39; the direct orientation ?
Definition: mesh_mod.F90:777
The type graph stores sparse matrices of boolean in CSR format.
Definition: graph_mod.F90:78
DEFINITION OF GEOMETRICAL CELLS (for meshes)
Definition: cell_mod.f90:82
integer, parameter, public cell_max_nbnodes
Cell maximal number of nodes.