Neko  0.8.1
A portable framework for high-order spectral element flow simulations
mesh Module Reference

Defines a mesh. More...

Data Types

type  mesh_element_t
 
type  mesh_t
 
interface  mesh_deform
 

Functions/Subroutines

subroutine mesh_init_nelv (this, gdim, nelv)
 Initialise a mesh this with nelv elements. More...
 
subroutine mesh_init_dist (this, gdim, dist)
 Initialise a mesh this based on a distribution dist. More...
 
subroutine mesh_init_common (this)
 
subroutine mesh_free (this)
 Deallocate a mesh this. More...
 
subroutine mesh_finalize (this)
 
subroutine mesh_generate_flags (this)
 
subroutine mesh_all_deformed (this)
 Set all elements as if they are deformed. More...
 
subroutine mesh_generate_conn (this)
 Generate element-to-element connectivity. More...
 
subroutine mesh_generate_external_facet_conn (this)
 Generate element-element connectivity via facets between PEs. More...
 
subroutine mesh_generate_external_point_conn (this)
 Generate element-element connectivity via points between PEs. More...
 
subroutine mesh_generate_edge_conn (this)
 Generate element-element connectivity via edges both between internal and between PEs. More...
 
subroutine mesh_generate_facet_numbering (this)
 Generate a unique facet numbering. More...
 
subroutine mesh_add_quad (this, el, p1, p2, p3, p4)
 Add a quadrilateral element to the mesh this. More...
 
subroutine mesh_add_hex (this, el, p1, p2, p3, p4, p5, p6, p7, p8)
 Add a hexahedral element to the mesh this. More...
 
subroutine mesh_add_point (this, p, idx)
 Add a unique point to the mesh. More...
 
subroutine mesh_add_face (this, f)
 Add a unique face represented as a 4-tuple to the mesh. More...
 
subroutine mesh_add_edge (this, e)
 Add a unique edge represented as a 2-tuple to the mesh. More...
 
subroutine mesh_mark_wall_facet (this, f, e)
 Mark facet f in element e as a wall. More...
 
subroutine mesh_mark_curve_element (this, e, curve_data, curve_type)
 Mark element e as a curve element. More...
 
subroutine mesh_mark_inlet_facet (this, f, e)
 Mark facet f in element e as an inlet. More...
 
subroutine mesh_mark_labeled_facet (this, f, e, label)
 Mark facet f in element e with label. More...
 
subroutine mesh_mark_outlet_normal_facet (this, f, e)
 Mark facet f in element e as an outlet normal. More...
 
subroutine mesh_mark_outlet_facet (this, f, e)
 Mark facet f in element e as an outlet. More...
 
subroutine mesh_mark_sympln_facet (this, f, e)
 Mark facet f in element e as a symmetry plane. More...
 
subroutine mesh_mark_periodic_facet (this, f, e, pf, pe, pids)
 Mark facet f in element e as periodic with (pf, pe) More...
 
subroutine mesh_get_facet_ids (this, f, e, pids)
 Get original ids of periodic points. More...
 
subroutine mesh_reset_periodic_ids (this)
 Reset ids of periodic points to their original ids. More...
 
subroutine mesh_create_periodic_ids (this, f, e, pf, pe)
 Creates common ids for matching periodic points. More...
 
subroutine mesh_apply_periodic_facet (this, f, e, pf, pe, pids)
 Replaces the periodic point's id with a common id for matching periodic points. More...
 
integer function mesh_get_local_point (this, p)
 Return the local id of a point p. More...
 
integer function mesh_get_local_edge (this, e)
 Return the local id of an edge e. More...
 
integer function mesh_get_local_facet (this, f)
 Return the local id of a face f. More...
 
integer function mesh_get_global_edge (this, e)
 Return the global id of an edge e. More...
 
integer function mesh_get_global_facet (this, f)
 Return the local id of a face f. More...
 
integer function mesh_have_point_glb_idx (this, index)
 Check if the mesh has a point given its global index. More...
 
logical function mesh_is_shared_point (this, p)
 Check if a point is shared. More...
 
logical function mesh_is_shared_edge (this, e)
 Check if an edge is shared. More...
 
logical function mesh_is_shared_facet (this, f)
 Check if a facet is shared. More...
 

Variables

integer, parameter, public neko_msh_max_zlbls = 20
 Max num. zone labels. More...
 
integer, parameter, public neko_msh_max_zlbl_len = 40
 Max length of a zone label. More...
 

Detailed Description

Defines a mesh.

Function/Subroutine Documentation

◆ mesh_add_edge()

subroutine mesh::mesh_add_edge ( class(mesh_t), intent(inout)  this,
type(tuple_i4_t), intent(inout)  e 
)
private

Add a unique edge represented as a 2-tuple to the mesh.

Definition at line 1499 of file mesh.f90.

◆ mesh_add_face()

subroutine mesh::mesh_add_face ( class(mesh_t), intent(inout)  this,
type(tuple4_i4_t), intent(inout)  f 
)
private

Add a unique face represented as a 4-tuple to the mesh.

Definition at line 1486 of file mesh.f90.

◆ mesh_add_hex()

subroutine mesh::mesh_add_hex ( class(mesh_t), intent(inout), target  this,
integer, value  el,
type(point_t), intent(inout), target  p1,
type(point_t), intent(inout), target  p2,
type(point_t), intent(inout), target  p3,
type(point_t), intent(inout), target  p4,
type(point_t), intent(inout), target  p5,
type(point_t), intent(inout), target  p6,
type(point_t), intent(inout), target  p7,
type(point_t), intent(inout), target  p8 
)
private

Add a hexahedral element to the mesh this.

Definition at line 1422 of file mesh.f90.

◆ mesh_add_point()

subroutine mesh::mesh_add_point ( class(mesh_t), intent(inout)  this,
type(point_t), intent(inout)  p,
integer, intent(inout)  idx 
)
private

Add a unique point to the mesh.

Definition at line 1462 of file mesh.f90.

◆ mesh_add_quad()

subroutine mesh::mesh_add_quad ( class(mesh_t), intent(inout), target  this,
integer, value  el,
type(point_t), intent(inout), target  p1,
type(point_t), intent(inout), target  p2,
type(point_t), intent(inout), target  p3,
type(point_t), intent(inout), target  p4 
)
private

Add a quadrilateral element to the mesh this.

Definition at line 1386 of file mesh.f90.

◆ mesh_all_deformed()

subroutine mesh::mesh_all_deformed ( class(mesh_t), intent(inout)  this)
private

Set all elements as if they are deformed.

Definition at line 443 of file mesh.f90.

◆ mesh_apply_periodic_facet()

subroutine mesh::mesh_apply_periodic_facet ( class(mesh_t), intent(inout)  this,
integer, intent(in)  f,
integer, intent(in)  e,
integer, intent(in)  pf,
integer, intent(in)  pe,
integer, dimension(4), intent(inout)  pids 
)
private

Replaces the periodic point's id with a common id for matching periodic points.

Definition at line 1818 of file mesh.f90.

◆ mesh_create_periodic_ids()

subroutine mesh::mesh_create_periodic_ids ( class(mesh_t), intent(inout)  this,
integer, intent(in)  f,
integer, intent(in)  e,
integer, intent(in)  pf,
integer, intent(in)  pe 
)
private

Creates common ids for matching periodic points.

Definition at line 1736 of file mesh.f90.

◆ mesh_finalize()

subroutine mesh::mesh_finalize ( class(mesh_t), intent(inout), target  this)
private

Definition at line 390 of file mesh.f90.

Here is the call graph for this function:

◆ mesh_free()

subroutine mesh::mesh_free ( class(mesh_t), intent(inout)  this)
private

Deallocate a mesh this.

Definition at line 312 of file mesh.f90.

Here is the call graph for this function:

◆ mesh_generate_conn()

subroutine mesh::mesh_generate_conn ( class(mesh_t), intent(inout), target  this)
private

Generate element-to-element connectivity.

Note
We have to sweep through the facet map twice to make sure that both odd and even sides are marked
Todo:
These loop nests needs a lot of love...

Definition at line 449 of file mesh.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_generate_edge_conn()

subroutine mesh::mesh_generate_edge_conn ( type(mesh_t), intent(inout), target  this)
private

Generate element-element connectivity via edges both between internal and between PEs.

Attention
only for elements where facet .ne. edges
Todo:
move this into distdata

Definition at line 898 of file mesh.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_generate_external_facet_conn()

subroutine mesh::mesh_generate_external_facet_conn ( type(mesh_t), intent(inout)  this)
private

Generate element-element connectivity via facets between PEs.

Definition at line 663 of file mesh.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_generate_external_point_conn()

subroutine mesh::mesh_generate_external_point_conn ( type(mesh_t), intent(inout)  this)
private

Generate element-element connectivity via points between PEs.

Definition at line 830 of file mesh.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_generate_facet_numbering()

subroutine mesh::mesh_generate_facet_numbering ( type(mesh_t), intent(inout), target  this)
private

Generate a unique facet numbering.

Todo:
move this into distdata
Todo:
Move this into distdata as a method...
Todo:
Since we now the neigh. we can actually do p2p here...

Definition at line 1142 of file mesh.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_generate_flags()

subroutine mesh::mesh_generate_flags ( type(mesh_t), intent(inout)  this)
private

Definition at line 410 of file mesh.f90.

Here is the caller graph for this function:

◆ mesh_get_facet_ids()

subroutine mesh::mesh_get_facet_ids ( class(mesh_t), intent(inout)  this,
integer, intent(in)  f,
integer, intent(in)  e,
integer, dimension(4), intent(inout)  pids 
)
private

Get original ids of periodic points.

Definition at line 1661 of file mesh.f90.

◆ mesh_get_global_edge()

integer function mesh::mesh_get_global_edge ( class(mesh_t), intent(inout)  this,
type(tuple_i4_t), intent(inout)  e 
)
private

Return the global id of an edge e.

Definition at line 1890 of file mesh.f90.

◆ mesh_get_global_facet()

integer function mesh::mesh_get_global_facet ( class(mesh_t), intent(inout)  this,
type(tuple4_i4_t), intent(inout)  f 
)
private

Return the local id of a face f.

Definition at line 1910 of file mesh.f90.

◆ mesh_get_local_edge()

integer function mesh::mesh_get_local_edge ( class(mesh_t), intent(inout)  this,
type(tuple_i4_t), intent(inout)  e 
)
private

Return the local id of an edge e.

Attention
only defined for gdim .ne. 2

Definition at line 1866 of file mesh.f90.

◆ mesh_get_local_facet()

integer function mesh::mesh_get_local_facet ( class(mesh_t), intent(inout)  this,
type(tuple4_i4_t), intent(inout)  f 
)
private

Return the local id of a face f.

Definition at line 1878 of file mesh.f90.

◆ mesh_get_local_point()

integer function mesh::mesh_get_local_point ( class(mesh_t), intent(inout)  this,
type(point_t), intent(inout)  p 
)
private

Return the local id of a point p.

Todo:
why do we still need to do this?

Definition at line 1849 of file mesh.f90.

◆ mesh_have_point_glb_idx()

integer function mesh::mesh_have_point_glb_idx ( class(mesh_t), intent(inout)  this,
integer, intent(inout)  index 
)
private

Check if the mesh has a point given its global index.

Returns
The local id of the point (if present) otherwise -1
Todo:
Consider moving this to distdata
Parameters
[in,out]indexGlobal index

Definition at line 1927 of file mesh.f90.

◆ mesh_init_common()

subroutine mesh::mesh_init_common ( type(mesh_t), intent(inout)  this)
private

Only intialize if we generate connectivity

Todo:
resize onces final size is known
Todo:
resize onces final size is known Only init if we generate connectivity

Definition at line 222 of file mesh.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_init_dist()

subroutine mesh::mesh_init_dist ( class(mesh_t), intent(inout)  this,
integer, intent(in)  gdim,
type(linear_dist_t), intent(in)  dist 
)
private

Initialise a mesh this based on a distribution dist.

Parameters
[in,out]thisMesh
[in]gdimGeometric dimension
[in]distData distribution

Definition at line 206 of file mesh.f90.

Here is the call graph for this function:

◆ mesh_init_nelv()

subroutine mesh::mesh_init_nelv ( class(mesh_t), intent(inout)  this,
integer, intent(in)  gdim,
integer, intent(in)  nelv 
)
private

Initialise a mesh this with nelv elements.

Parameters
[in,out]thisMesh
[in]gdimGeometric dimension
[in]nelvLocal number of elements

Definition at line 183 of file mesh.f90.

Here is the call graph for this function:

◆ mesh_is_shared_edge()

logical function mesh::mesh_is_shared_edge ( class(mesh_t), intent(inout)  this,
type(tuple_i4_t), intent(inout)  e 
)
private

Check if an edge is shared.

Attention
only defined for gdim .ne. 2

Definition at line 1954 of file mesh.f90.

◆ mesh_is_shared_facet()

logical function mesh::mesh_is_shared_facet ( class(mesh_t), intent(inout)  this,
type(tuple4_i4_t), intent(inout)  f 
)
private

Check if a facet is shared.

Definition at line 1968 of file mesh.f90.

◆ mesh_is_shared_point()

logical function mesh::mesh_is_shared_point ( class(mesh_t), intent(inout)  this,
type(point_t), intent(inout)  p 
)
private

Check if a point is shared.

Definition at line 1940 of file mesh.f90.

◆ mesh_mark_curve_element()

subroutine mesh::mesh_mark_curve_element ( class(mesh_t), intent(inout)  this,
integer, intent(in)  e,
real(kind=dp), dimension(5,12), intent(in)  curve_data,
integer, dimension(12), intent(in)  curve_type 
)
private

Mark element e as a curve element.

Definition at line 1531 of file mesh.f90.

◆ mesh_mark_inlet_facet()

subroutine mesh::mesh_mark_inlet_facet ( class(mesh_t), intent(inout)  this,
integer, intent(in)  f,
integer, intent(in)  e 
)
private

Mark facet f in element e as an inlet.

Definition at line 1549 of file mesh.f90.

◆ mesh_mark_labeled_facet()

subroutine mesh::mesh_mark_labeled_facet ( class(mesh_t), intent(inout)  this,
integer, intent(in)  f,
integer, intent(in)  e,
integer, intent(in)  label 
)
private

Mark facet f in element e with label.

Definition at line 1568 of file mesh.f90.

◆ mesh_mark_outlet_facet()

subroutine mesh::mesh_mark_outlet_facet ( class(mesh_t), intent(inout)  this,
integer, intent(inout)  f,
integer, intent(inout)  e 
)
private

Mark facet f in element e as an outlet.

Definition at line 1609 of file mesh.f90.

◆ mesh_mark_outlet_normal_facet()

subroutine mesh::mesh_mark_outlet_normal_facet ( class(mesh_t), intent(inout)  this,
integer, intent(inout)  f,
integer, intent(inout)  e 
)
private

Mark facet f in element e as an outlet normal.

Definition at line 1589 of file mesh.f90.

◆ mesh_mark_periodic_facet()

subroutine mesh::mesh_mark_periodic_facet ( class(mesh_t), intent(inout)  this,
integer, intent(in)  f,
integer, intent(in)  e,
integer, intent(in)  pf,
integer, intent(in)  pe,
integer, dimension(4), intent(inout)  pids 
)
private

Mark facet f in element e as periodic with (pf, pe)

Definition at line 1647 of file mesh.f90.

◆ mesh_mark_sympln_facet()

subroutine mesh::mesh_mark_sympln_facet ( class(mesh_t), intent(inout)  this,
integer, intent(inout)  f,
integer, intent(inout)  e 
)
private

Mark facet f in element e as a symmetry plane.

Definition at line 1628 of file mesh.f90.

◆ mesh_mark_wall_facet()

subroutine mesh::mesh_mark_wall_facet ( class(mesh_t), intent(inout)  this,
integer, intent(inout)  f,
integer, intent(inout)  e 
)
private

Mark facet f in element e as a wall.

Definition at line 1512 of file mesh.f90.

◆ mesh_reset_periodic_ids()

subroutine mesh::mesh_reset_periodic_ids ( class(mesh_t), intent(inout)  this)
private

Reset ids of periodic points to their original ids.

Definition at line 1685 of file mesh.f90.

Variable Documentation

◆ neko_msh_max_zlbl_len

integer, parameter, public mesh::neko_msh_max_zlbl_len = 40

Max length of a zone label.

Definition at line 57 of file mesh.f90.

◆ neko_msh_max_zlbls

integer, parameter, public mesh::neko_msh_max_zlbls = 20

Max num. zone labels.

Definition at line 55 of file mesh.f90.