Choral
Data Types | Functions/Subroutines
mesh_mod Module Reference

DERIVED TYPE mesh More...

Data Types

interface  clear
 
interface  mesh
 Derived type mesh. More...
 
interface  print
 
interface  valid
 
interface  write
 

Functions/Subroutines

subroutine mesh_clear (m)
 Destructor for mesh type. More...
 
subroutine, public mesh_clear_2 (m)
 Destructor for mesh type clears the data tn the mesh built after 'call create(...)'. More...
 
subroutine mesh_print (m)
 display cell types in the mesh More...
 
logical function mesh_valid (m)
 Verify allocation. More...
 
type(mesh) function readmesh (fileName, fileFormat)
  Constructor for the type mesh More...
 
subroutine gmesh_readmesh (m)
 read mesh from gmsh ASCII file More...
 
subroutine, public mesh_create_cltab (m, clTab)
 mesh constructor, second step, cell types and cell nodes are known cell types are in mclType cell node index are in clTab More...
 
subroutine mesh_write (m, fileName, fileFormat, cell_tags)
 Write mesh 'm' to file 'fileName' with format 'fileFormat'. More...
 
subroutine gmesh_writemesh (m, cell_tags)
 write mesh to gmsh ASCII file More...
 
type(mesh) function mesh_create_1d (a, b, n)
  Constructor for the type mesh More...
 
subroutine, public mesh_create_end (m)
 mesh constructor : final step More...
 
subroutine, public getndcoord (ndCoord, s, ndInd, n, m)
 returns node coordinates of node indexes in ndInd More...
 
subroutine, public flag_mesh_cells (flag, m, dim, f)
 OUTPUT: flag(:) array of logical with size mnbCl. More...
 
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|. More...
 
logical function, public cell_orientation (m, cl)
 has cell 'cl' the direct orientation ? More...
 
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 otherwise More...
 

Detailed Description

DERIVED TYPE mesh

A mesh 'm' is a collection of cells (see cell_mod)

A mesh 'm' is constructed from a mesh file

m = mesh(file, format)

A mesh can be saved to a file with 'gmsh' format and then visualised.

Definitions:

Tutorial examples:

Author
Charles Pierre

Function/Subroutine Documentation

◆ cell_orientation()

logical function, public mesh_mod::cell_orientation ( type(mesh), intent(in)  m,
integer, intent(in)  cl 
)

has cell 'cl' the direct orientation ?

Definition at line 777 of file mesh_mod.F90.

Here is the call graph for this function:

◆ closest_node()

subroutine, public mesh_mod::closest_node ( integer, dimension(:), allocatable  V,
real(rp), intent(out)  dist,
real(rp), dimension(:,:), intent(in)  pt,
type(mesh), intent(in)  m,
type(graph), intent(in)  nDToNd,
integer, intent(in), optional  start 
)

For each point X=pt(:,ii), determines a node V in the mesh m that minimises |X-V|.

The research is done following the successive neighbour nodes of a starting node (optional argument)

This starting node ideally has the largest connexion to other points. The default value is mndNd= the final mesh node.

The minimum might be local !

Input = ndToNd = node to node connectivity of mesh m

Definition at line 698 of file mesh_mod.F90.

Here is the call graph for this function:

◆ flag_mesh_cells()

subroutine, public mesh_mod::flag_mesh_cells ( logical, dimension(:), allocatable  flag,
type(mesh), intent(in)  m,
integer, intent(in)  dim,
procedure(r3tor), optional  f 
)

OUTPUT: flag(:) array of logical with size mnbCl.

for the cell 'cl' in the mesh 'm':
flag(cl) = .TRUE. iif:

  • the cell 'cl' has dimension 'dim'
  • f(x) >=0 at all node 'x' of the cell (if the argument 'f' is provided)

Definition at line 622 of file mesh_mod.F90.

Here is the call graph for this function:

◆ getndcoord()

subroutine, public mesh_mod::getndcoord ( real(rp), dimension(3,s), intent(out)  ndCoord,
integer, intent(in)  s,
integer, dimension(n), intent(in)  ndInd,
integer, intent(in)  n,
type(mesh), intent(in)  m 
)

returns node coordinates of node indexes in ndInd

Assumption : s >= n !

Definition at line 599 of file mesh_mod.F90.

◆ gmesh_readmesh()

subroutine mesh_mod::gmesh_readmesh ( type(mesh), intent(out)  m)
private

read mesh from gmsh ASCII file

Definition at line 316 of file mesh_mod.F90.

Here is the call graph for this function:

◆ gmesh_writemesh()

subroutine mesh_mod::gmesh_writemesh ( type(mesh), intent(in)  m,
logical, intent(in), optional  cell_tags 
)
private

write mesh to gmsh ASCII file

Definition at line 443 of file mesh_mod.F90.

◆ interface_orientation()

subroutine, public mesh_mod::interface_orientation ( integer, intent(out)  nb_itf,
integer, dimension(n), intent(out)  eps,
integer, intent(in)  n,
type(mesh), intent(in)  m,
integer, intent(in)  cl 
)

eps(ii) = +1 if the interface ii of the cell cl in mesh m is oriented outwards the cell cl = -1 otherwise

Definition at line 824 of file mesh_mod.F90.

Here is the call graph for this function:

◆ mesh_clear()

subroutine mesh_mod::mesh_clear ( type(mesh), intent(inout)  m)
private

Destructor for mesh type.

Definition at line 162 of file mesh_mod.F90.

Here is the call graph for this function:

◆ mesh_clear_2()

subroutine, public mesh_mod::mesh_clear_2 ( type(mesh), intent(inout)  m)

Destructor for mesh type clears the data tn the mesh built after 'call create(...)'.

Definition at line 184 of file mesh_mod.F90.

◆ mesh_create_1d()

type(mesh) function mesh_mod::mesh_create_1d ( real(rp), intent(in)  a,
real(rp), intent(in)  b,
integer, intent(in)  n 
)
private

Constructor for the type mesh

Build the one dimensional regualr mesh of the interval \( (a,b) \) with size \( h = (b-a)/n \)

The mesh is composed of :

  • the \( n \) edge-cells \( [a + (i-1)h, a+ih]\), \( i=1\dots n \),
  • the 2 vertex-cells \( \{a\} \) and \( \{b\} \)
  • INPUT:
    • a, b = define the interval \( (a ,b)\)
    • n = number of 1D cells

Definition at line 513 of file mesh_mod.F90.

Here is the call graph for this function:

◆ mesh_create_cltab()

subroutine, public mesh_mod::mesh_create_cltab ( type(mesh), intent(inout)  m,
integer, dimension(:,:)  clTab 
)

mesh constructor, second step, cell types and cell nodes are known cell types are in mclType cell node index are in clTab

builds mclToNd connectivity graph

Definition at line 380 of file mesh_mod.F90.

◆ mesh_create_end()

subroutine, public mesh_mod::mesh_create_end ( type(mesh), intent(inout)  m)

mesh constructor : final step

Definition at line 567 of file mesh_mod.F90.

◆ mesh_print()

subroutine mesh_mod::mesh_print ( type(mesh), intent(in)  m)
private

display cell types in the mesh

Definition at line 202 of file mesh_mod.F90.

◆ mesh_valid()

logical function mesh_mod::mesh_valid ( type (mesh), intent(in)  m)
private

Verify allocation.

Definition at line 239 of file mesh_mod.F90.

◆ mesh_write()

subroutine mesh_mod::mesh_write ( type(mesh), intent(in)  m,
character(len=*), intent(in)  fileName,
character(len=*), intent(in)  fileFormat,
logical, intent(in), optional  cell_tags 
)
private

Write mesh 'm' to file 'fileName' with format 'fileFormat'.

If optional argument 'cell_tags=.TRUE', write the cell tags as element values in the output file

Definition at line 420 of file mesh_mod.F90.

Here is the call graph for this function:

◆ readmesh()

type(mesh) function mesh_mod::readmesh ( character(len=*), intent(in)  fileName,
character(len=*), intent(in)  fileFormat 
)
private

Constructor for the type mesh

Read a mesh from a file.

  • INPUT:
    • fileName
    • fileFormat that can be
      • 'gmsh' for gmsh files

Definition at line 285 of file mesh_mod.F90.

Here is the call graph for this function: