Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
mesh Module Reference

Defines a mesh.

Data Types

interface  mesh_deform
 
type  mesh_element_t
 
type  mesh_t
 

Functions/Subroutines

subroutine mesh_init_nelv (this, gdim, nelv)
 Initialise a mesh this with nelv elements.
 
subroutine mesh_init_dist (this, gdim, dist)
 Initialise a mesh this based on a distribution dist.
 
subroutine mesh_init_common (this)
 
subroutine mesh_free (this)
 Deallocate a mesh this.
 
subroutine mesh_finalize (this)
 
subroutine mesh_generate_flags (this)
 
subroutine mesh_all_deformed (this)
 Set all elements as if they are deformed.
 
subroutine mesh_generate_conn (this)
 Generate element-to-element connectivity.
 
subroutine mesh_generate_edge_lid (this)
 Enumerate the unique edges of the local mesh.
 
subroutine mesh_generate_face_lid (this)
 Enumerate the unique faces of the local mesh.
 
subroutine mesh_generate_external_facet_conn (this)
 Generate element-element connectivity via facets between PEs.
 
subroutine mesh_generate_external_point_conn (this)
 Generate element-element connectivity via points between PEs.
 
subroutine mesh_generate_edge_conn (this)
 Generate element-element connectivity via edges both between internal and between PEs.
 
subroutine mesh_generate_facet_numbering (this)
 Generate a unique facet numbering.
 
subroutine mesh_add_quad (this, el, el_glb, p1, p2, p3, p4)
 Add a quadrilateral element to the mesh this.
 
subroutine mesh_add_hex (this, el, el_glb, p1, p2, p3, p4, p5, p6, p7, p8)
 Add a hexahedral element to the mesh this.
 
subroutine mesh_add_point (this, p, idx)
 Add a unique point to the mesh.
 
subroutine mesh_add_face (this, f, head, chain, idx)
 Add a unique face represented as a 4-tuple to the mesh.
 
subroutine mesh_add_edge (this, e, head, chain, idx)
 Add a unique edge represented as a 2-tuple to the mesh.
 
subroutine mesh_mark_curve_element (this, e, curve_data, curve_type)
 Mark element e as a curve element.
 
subroutine mesh_mark_labeled_facet (this, f, e, label)
 Mark facet f in element e with label.
 
subroutine mesh_mark_periodic_facet (this, f, e, pf, pe, pids)
 Mark facet f in element e as periodic with (pf, pe)
 
subroutine mesh_get_facet_ids (this, f, e, pids)
 Get original ids of periodic points.
 
subroutine mesh_reset_periodic_ids (this)
 Reset ids of periodic points to their original ids.
 
subroutine mesh_create_periodic_ids (this, f, e, pf, pe)
 Creates common ids for matching periodic points.
 
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.
 
integer function mesh_get_global_edge (this, el, e)
 Return the global id of edge e in element el.
 
integer function mesh_get_global_facet (this, el, f)
 Return the global id of facet f in element el.
 
integer function mesh_have_point_glb_idx (this, index)
 Check if the mesh has a point given its global index.
 
logical function mesh_is_shared_point (this, el, p)
 Check if point p in element el is shared.
 
logical function mesh_is_shared_edge (this, el, e)
 Check if edge e in element el is shared.
 
logical function mesh_is_shared_facet (this, el, f)
 Check if facet f in element el is shared.
 
subroutine mesh_check_right_handedness (this)
 Check the correct orientation of the rst coordindates.
 
real(kind=dp) function, public parallelepiped_signed_volume (p1, p2, p3, origin)
 Compute a signed volume of a parallelepiped formed by three vectors, in turn defined via three points, p1, p2, and p3 and an origin.
 
subroutine mesh_subset_by_mask (this, other, mask, lx, ly, lz)
 Create a subset of the mesh this in other based on the provided mask.
 

Variables

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

Function/Subroutine Documentation

◆ mesh_add_edge()

subroutine mesh::mesh_add_edge ( type(mesh_t), intent(inout this,
type(tuple_i4_t), intent(inout e,
integer, dimension(:), intent(inout head,
integer, dimension(:), intent(inout chain,
integer, intent(out idx 
)
private

Returns the local id of e in idx, adding it to the set of unique edges if it has not been seen before. head and chain hold the lookup chains described in mesh_generate_edge_lid

Definition at line 1774 of file mesh.f90.

Here is the caller graph for this function:

◆ mesh_add_face()

subroutine mesh::mesh_add_face ( type(mesh_t), intent(inout this,
type(tuple4_i4_t), intent(inout f,
integer, dimension(:), intent(inout head,
integer, dimension(:), intent(inout chain,
integer, intent(out idx 
)
private

Returns the local id of f in idx, adding it to the set of unique faces if it has not been seen before. head and chain hold the lookup chains described in mesh_generate_face_lid

Definition at line 1736 of file mesh.f90.

Here is the caller graph for this function:

◆ mesh_add_hex()

subroutine mesh::mesh_add_hex ( class(mesh_t), intent(inout), target  this,
integer, value  el,
integer, value  el_glb,
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

Definition at line 1669 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

Definition at line 1709 of file mesh.f90.

◆ mesh_add_quad()

subroutine mesh::mesh_add_quad ( class(mesh_t), intent(inout), target  this,
integer, value  el,
integer, value  el_glb,
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

Definition at line 1637 of file mesh.f90.

◆ mesh_all_deformed()

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

Definition at line 499 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

Definition at line 2024 of file mesh.f90.

◆ mesh_check_right_handedness()

subroutine mesh::mesh_check_right_handedness ( class(mesh_t), intent(inout this)
private
Note
Similar algorithm as in Nek5000 verify routine.

Definition at line 2168 of file mesh.f90.

Here is the call graph for this function:

◆ 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

Definition at line 1932 of file mesh.f90.

◆ mesh_finalize()

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

Definition at line 448 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

Definition at line 352 of file mesh.f90.

◆ mesh_generate_conn()

subroutine mesh::mesh_generate_conn ( class(mesh_t), intent(inout), target  this)
private
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 505 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
Attention
only for elements where facet .ne. edges
Todo:
move this into distdata

Definition at line 1129 of file mesh.f90.

Here is the caller graph for this function:

◆ mesh_generate_edge_lid()

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

Assigns a local id to each distinct edge, stored per element and local edge number in edge_lid, and collects the endpoints of every unique edge in edge_pts. Edges are deduplicated by chaining them on the local id of their lowest numbered endpoint; the chains hold only the edges meeting at a point, so a lookup scans a handful of entries. Ids are handed out in first seen order, matching the numbering the previously used hash table produced.

Attention
Requires all points to have been added to the mesh

Definition at line 737 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

Definition at line 822 of file mesh.f90.

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

Uses a canonical-owner rendezvous routed through the crystal router instead of a dense O(P) all-to-all. Each local point is hashed to an owner rank, mod(glb_idx, P); the owner gathers every rank holding that point and reflects, back to each holder, the other holders' element lists. Shared points (held by more than one rank) are thus discovered in O(log P) communication stages, the neigh array becomes symmetric by construction, and no O(P) buffers are ever allocated.

Definition at line 993 of file mesh.f90.

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

◆ mesh_generate_face_lid()

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

Assigns a local id to each distinct face, stored per element and local facet number in face_lid, and collects the points of every unique face in face_pts. Faces are deduplicated with the same point chaining as mesh_generate_edge_lid, and ids are handed out in first seen order, matching the numbering the previously used hash table produced.

Attention
Requires all points to have been added to the mesh

Definition at line 789 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
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 1400 of file mesh.f90.

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 466 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

Definition at line 1856 of file mesh.f90.

◆ mesh_get_global_edge()

integer function mesh::mesh_get_global_edge ( class(mesh_t), intent(in this,
integer, intent(in el,
integer, intent(in e 
)
private
Parameters
[in]elLocal element id
[in]eLocal edge number of the element

Definition at line 2060 of file mesh.f90.

◆ mesh_get_global_facet()

integer function mesh::mesh_get_global_facet ( class(mesh_t), intent(in this,
integer, intent(in el,
integer, intent(in f 
)
private
Attention
only defined for gdim .eq. 3, in two dimensions the facets of an element are its edges, see mesh_get_global_edge
Parameters
[in]elLocal element id
[in]fLocal facet number of the element

Definition at line 2083 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

The one way to turn a global point id into a local one; a point carries its global id, so pid() is the key for a caller holding a point_t. For an element's own corner read pt_lid instead.

Returns
The local id of the point (if present) otherwise -1
Attention
Only valid until generate_conn releases the global->local point table
Todo:
Consider moving this to distdata
Parameters
[in,out]indexGlobal index

Definition at line 2106 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

Definition at line 268 of file mesh.f90.

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
Parameters
[in,out]thisMesh
[in]gdimGeometric dimension
[in]distData distribution

Definition at line 242 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
Parameters
[in,out]thisMesh
[in]gdimGeometric dimension
[in]nelvLocal number of elements

Definition at line 206 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,
integer, intent(in el,
integer, intent(in e 
)
private
Parameters
[in]elLocal element id
[in]eLocal edge number of the element

Definition at line 2137 of file mesh.f90.

◆ mesh_is_shared_facet()

logical function mesh::mesh_is_shared_facet ( class(mesh_t), intent(inout this,
integer, intent(in el,
integer, intent(in f 
)
private
Attention
only defined for gdim .eq. 3, in two dimensions the facets of an element are its edges, see mesh_is_shared_edge
Parameters
[in]elLocal element id
[in]fLocal facet number of the element

Definition at line 2154 of file mesh.f90.

◆ mesh_is_shared_point()

logical function mesh::mesh_is_shared_point ( class(mesh_t), intent(inout this,
integer, intent(in el,
integer, intent(in p 
)
private
Parameters
[in]elLocal element id
[in]pLocal point number of the element

Definition at line 2123 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

Definition at line 1805 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

Definition at line 1822 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

Definition at line 1842 of file mesh.f90.

◆ mesh_reset_periodic_ids()

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

Definition at line 1879 of file mesh.f90.

◆ mesh_subset_by_mask()

subroutine mesh::mesh_subset_by_mask ( class(mesh_t), intent(in this,
class(mesh_t), intent(inout other,
type(mask_t), intent(in mask,
integer, intent(in lx,
integer, intent(in ly,
integer, intent(in lz 
)
private
Parameters
thisThe original mesh.
otherThe subset mesh to be created.
maskThe mask defining the subset.
lxthe quadrature degree in x direction.
lythe quadrature degree in y direction.
lzthe quadrature degree in z direction.
Note
Partially lifted from nmsh_file.f90.

Definition at line 2294 of file mesh.f90.

Here is the call graph for this function:

◆ parallelepiped_signed_volume()

real(kind=dp) function, public mesh::parallelepiped_signed_volume ( real(kind=dp), dimension(3), intent(in p1,
real(kind=dp), dimension(3), intent(in p2,
real(kind=dp), dimension(3), intent(in p3,
real(kind=dp), dimension(3), intent(in origin 
)
Parameters
p1The first point.
p2The second point.
p3The third point.
originThe point defining the origin.
Note
Used to check right-handness of the elements: the volumes should be positive.

Definition at line 2268 of file mesh.f90.

Here is the caller graph for this function:

Variable Documentation

◆ neko_msh_max_zlbl_len

integer, parameter, public mesh::neko_msh_max_zlbl_len = 40

Definition at line 67 of file mesh.f90.

◆ neko_msh_max_zlbls

integer, parameter, public mesh::neko_msh_max_zlbls = 20

Definition at line 65 of file mesh.f90.