Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
map_1d::map_1d_t Type Reference

Map every GLL point in the mesh to a level in one physical direction. Can be used to average across the two remaining directions. More...

Collaboration diagram for map_1d::map_1d_t:

Public Member Functions

procedure, pass(this) init_int (this, coef, dir, tol)
 Constructor.
 
procedure, pass(this) init_char (this, coef, dir, tol)
 
generic init (this, coef, dir, tol)
 Constructor.
 
generic init (this, coef, dir, tol)
 
procedure, pass(this) free (this)
 Destructor.
 
procedure, pass(this) average_planes_fld_lst (this, avg_planes, field_list)
 Average field list along planes.
 
procedure, pass(this) average_planes_vec_ptr (this, avg_planes, vector_ptr)
 Computes average of vector_pt in two directions and outputs matrix with averaged values avg_planes contains coordinates in first row, avg. of fields in the rest.
 
generic average_planes (this, avg_planes, field_list)
 Average field list along planes.
 
generic average_planes (this, avg_planes, vector_ptr)
 Computes average of vector_pt in two directions and outputs matrix with averaged values avg_planes contains coordinates in first row, avg. of fields in the rest.
 

Public Attributes

integer, dimension(:), allocatable dir_el
 Local tensor-product direction aligned with the requested physical direction for each element. Values 1, 2, and 3 correspond to r, s, and t, respectively.
 
integer, dimension(:), allocatable el_lvl
 One-dimensional element level assigned by propagating the global minimum coordinate through the mesh connectivity.
 
integer, dimension(:, :, :, :), allocatable pt_lvl
 One-dimensional GLL level for each local point in each element. Levels run from 1 to n_gll_lvls and are used as row indices in the averaged output matrix.
 
integer n_el_lvls
 Number of element levels in the requested physical direction.
 
integer n_gll_lvls
 Number of total GLL levels in the requested physical direction. For a polynomial space with lx points per element direction, this is n_el_lvls * lx.
 
type(dofmap_t), pointer dof => null()
 Dofmap that owns the physical coordinates used to build the map.
 
type(coef_t), pointer coef => null()
 SEM coefficients that provide quadrature weights and connectivity.
 
type(mesh_t), pointer msh => null()
 Mesh associated with dof and coef.
 
integer dir
 Requested physical direction of the 1D mapping. Values 1, 2, and 3 correspond to x, y, and z, respectively.
 
real(kind=rp) tol = 1e-7
 Tolerance used when identifying propagated levels, relative to the coordinate extent in the requested direction. The absolute tolerance never falls below a few roundoff units of the coordinate magnitude.
 
real(kind=rp), dimension(:), allocatable volume_per_gll_lvl
 Integrated quadrature weight volume associated with each GLL level. Used as the denominator when computing plane averages.
 

Detailed Description

This type is used to average fields over planes normal to one physical direction. The constructor first determines which local tensor-product direction (r, s, or t) is most closely aligned with the requested physical direction (x, y, or z) for each element. It then assigns a one-dimensional element level to each element and expands that element level into GLL-point levels along the aligned local direction.

The element-level assignment is based on propagation of the global minimum coordinate through the gather-scatter connectivity. Elements whose minimum coordinate matches the global minimum are assigned to the first level. On each following pass, the current lower face of every element is masked to the global maximum, a gather-scatter add exchanges boundary values, and the result is converted into an effective boundary minimum. Elements that have newly received the global minimum are assigned to the next level. This repeats until the propagated minimum reaches the global maximum level. The comparison with the global minimum uses an absolute tolerance, the user tolerance tol times the coordinate extent in the requested direction, with a floor of a few roundoff units of the coordinate magnitude, because the propagation is done with floating point sums scaled by the inverse multiplicity coefmult, which is not exact in general. Elements matched to the global minimum are reset to exactly that value so the roundoff does not accumulate over levels.

Once element levels are known, every GLL point receives a global 1D level (pt_lvl) ordered consistently with the local element orientation. The constructor also accumulates volume_per_gll_lvl, the quadrature weight volume associated with each 1D level. Averaging then sums each field into these levels and divides by the corresponding level volume.

The propagation algorithm assumes that the connectivity and coordinate layout allow a unique stack of element levels in the requested direction. If an element level remains unassigned the constructor stops with an error, since the resulting point levels would index the level arrays out of bounds.

Remarks
Could also be rather easily extended to say polar coordinates as well (I think). Martin Karp

Definition at line 96 of file map_1d.f90.

Member Function/Subroutine Documentation

◆ average_planes() [1/2]

generic map_1d::map_1d_t::average_planes ( class(map_1d_t), intent(inout)  this,
type(matrix_t), intent(inout)  avg_planes,
type(field_list_t), intent(inout)  field_list 
)
Parameters
avg_planesoutput averages
field_listlist of fields to be averaged

Definition at line 142 of file map_1d.f90.

◆ average_planes() [2/2]

generic map_1d::map_1d_t::average_planes ( class(map_1d_t), intent(inout)  this,
type(matrix_t), intent(inout)  avg_planes,
type(vector_ptr_t), dimension(:), intent(inout)  vector_ptr 
)
Parameters
avg_planesoutput averages
vector_ptsto vectors to be averaged

Definition at line 142 of file map_1d.f90.

◆ average_planes_fld_lst()

procedure, pass(this) map_1d::map_1d_t::average_planes_fld_lst ( class(map_1d_t), intent(inout)  this,
type(matrix_t), intent(inout)  avg_planes,
type(field_list_t), intent(inout)  field_list 
)
Parameters
avg_planesoutput averages
field_listlist of fields to be averaged

Definition at line 138 of file map_1d.f90.

◆ average_planes_vec_ptr()

procedure, pass(this) map_1d::map_1d_t::average_planes_vec_ptr ( class(map_1d_t), intent(inout)  this,
type(matrix_t), intent(inout)  avg_planes,
type(vector_ptr_t), dimension(:), intent(inout)  vector_ptr 
)
Parameters
avg_planesoutput averages
vector_ptsto vectors to be averaged

Definition at line 140 of file map_1d.f90.

◆ free()

procedure, pass(this) map_1d::map_1d_t::free ( class(map_1d_t)  this)

Definition at line 136 of file map_1d.f90.

◆ init() [1/2]

generic map_1d::map_1d_t::init ( class(map_1d_t)  this,
type(coef_t), intent(inout), target  coef,
integer, intent(in)  dir,
real(kind=rp), intent(in)  tol 
)

Definition at line 134 of file map_1d.f90.

◆ init() [2/2]

generic map_1d::map_1d_t::init ( class(map_1d_t)  this,
type(coef_t), intent(inout), target  coef,
character(len=*), intent(in)  dir,
real(kind=rp), intent(in)  tol 
)

Definition at line 134 of file map_1d.f90.

◆ init_char()

procedure, pass(this) map_1d::map_1d_t::init_char ( class(map_1d_t)  this,
type(coef_t), intent(inout), target  coef,
character(len=*), intent(in)  dir,
real(kind=rp), intent(in)  tol 
)

Definition at line 133 of file map_1d.f90.

◆ init_int()

procedure, pass(this) map_1d::map_1d_t::init_int ( class(map_1d_t)  this,
type(coef_t), intent(inout), target  coef,
integer, intent(in)  dir,
real(kind=rp), intent(in)  tol 
)

Definition at line 132 of file map_1d.f90.

Member Data Documentation

◆ coef

type(coef_t), pointer map_1d::map_1d_t::coef => null()

Definition at line 117 of file map_1d.f90.

◆ dir

integer map_1d::map_1d_t::dir

Definition at line 122 of file map_1d.f90.

◆ dir_el

integer, dimension(:), allocatable map_1d::map_1d_t::dir_el

Definition at line 100 of file map_1d.f90.

◆ dof

type(dofmap_t), pointer map_1d::map_1d_t::dof => null()

Definition at line 115 of file map_1d.f90.

◆ el_lvl

integer, dimension(:), allocatable map_1d::map_1d_t::el_lvl

Definition at line 103 of file map_1d.f90.

◆ msh

type(mesh_t), pointer map_1d::map_1d_t::msh => null()

Definition at line 119 of file map_1d.f90.

◆ n_el_lvls

integer map_1d::map_1d_t::n_el_lvls

Definition at line 109 of file map_1d.f90.

◆ n_gll_lvls

integer map_1d::map_1d_t::n_gll_lvls

Definition at line 113 of file map_1d.f90.

◆ pt_lvl

integer, dimension(:, :, :, :), allocatable map_1d::map_1d_t::pt_lvl

Definition at line 107 of file map_1d.f90.

◆ tol

real(kind=rp) map_1d::map_1d_t::tol = 1e-7

Definition at line 126 of file map_1d.f90.

◆ volume_per_gll_lvl

real(kind=rp), dimension(:), allocatable map_1d::map_1d_t::volume_per_gll_lvl

Definition at line 129 of file map_1d.f90.


The documentation for this type was generated from the following file: