Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
tensor4::tensor4_t Type Reference
Collaboration diagram for tensor4::tensor4_t:

Public Member Functions

generic init (t, n1, n2, n3, n4, name)
 Initialise a tensor of size n1*n2*n3*n4.
 
procedure, pass(t) free (t)
 Deallocate a tensor.
 
procedure, pass(t) size (t)
 Returns the number of entries in the tensor.
 
procedure, pass(t) copy_from (t, memdir, sync)
 Copy between host and device.
 
procedure, pass(t) get_n1 (t)
 Returns the size of the first dimension.
 
procedure, pass(t) get_n2 (t)
 Returns the size of the second dimension.
 
procedure, pass(t) get_n3 (t)
 Returns the size of the third dimension.
 
procedure, pass(t) get_n4 (t)
 Returns the size of the fourth dimension.
 
procedure, pass(t) tensor4_assign_tensor4 (t, w)
 Assignment \( t = w \).
 
procedure, pass(t) tensor4_assign_scalar (t, s)
 Assignment \( t = s \).
 
generic assignment (t, w)
 Assignment \( t = w \).
 
generic assignment (t, s)
 Assignment \( t = s \).
 

Public Attributes

real(kind=rp), dimension(:,:,:,:), allocatable x
 Tensor entries.
 
character(len=neko_varname_len) name = ""
 Name of the tensor.
 
type(c_ptr) x_d = C_NULL_PTR
 Device pointer.
 

Private Member Functions

procedure, pass, private init_dims (t, n1, n2, n3, n4, name)
 Initialise a tensor of size n1*n2*n3*n4.
 
procedure, pass, private alloc (t, n1, n2, n3, n4)
 Allocate a tensor of size n1*n2*n3*n4.
 

Private Attributes

integer, private n1 = 0
 Size of the first dimension.
 
integer, private n2 = 0
 Size of the second dimension.
 
integer, private n3 = 0
 Size of the third dimension.
 
integer, private n4 = 0
 Size of the fourth dimension.
 
integer, private n = 0
 Total size n1*n2*n3*n4.
 

Detailed Description

Definition at line 45 of file tensor4.f90.

Member Function/Subroutine Documentation

◆ alloc()

procedure, pass, private tensor4::tensor4_t::alloc ( class(tensor4_t), intent(inout t,
integer, intent(in n1,
integer, intent(in n2,
integer, intent(in n3,
integer, intent(in n4 
)
private
Parameters
tTensor to allocate.
n1Size of the first dimension.
n2Size of the second dimension.
n3Size of the third dimension.
n4Size of the fourth dimension.

Definition at line 86 of file tensor4.f90.

◆ assignment() [1/2]

generic tensor4::tensor4_t::assignment ( class(tensor4_t), intent(inout t,
real(kind=rp), intent(in s 
)
Parameters
tTensor to assign to.
sScalar to fill the tensor with.

Definition at line 82 of file tensor4.f90.

◆ assignment() [2/2]

generic tensor4::tensor4_t::assignment ( class(tensor4_t), intent(inout t,
type(tensor4_t), intent(in w 
)
Parameters
tTensor to assign to.
wTensor to assign from.

Definition at line 82 of file tensor4.f90.

Here is the call graph for this function:

◆ copy_from()

procedure, pass(t) tensor4::tensor4_t::copy_from ( class(tensor4_t), intent(inout t,
integer, intent(in memdir,
logical, intent(in sync 
)
Parameters
tTensor to copy to/from device/host.
memdirDirection to copy (HOST_TO_DEVICE or DEVICE_TO_HOST).
syncWhether the memcopy is to be blocking or not.

Definition at line 68 of file tensor4.f90.

◆ free()

procedure, pass(t) tensor4::tensor4_t::free ( class(tensor4_t), intent(inout t)
Parameters
tTensor to deallocate.

Definition at line 64 of file tensor4.f90.

◆ get_n1()

procedure, pass(t) tensor4::tensor4_t::get_n1 ( class(tensor4_t), intent(in t)
Parameters
tTensor to query.

Definition at line 70 of file tensor4.f90.

◆ get_n2()

procedure, pass(t) tensor4::tensor4_t::get_n2 ( class(tensor4_t), intent(in t)
Parameters
tTensor to query.

Definition at line 72 of file tensor4.f90.

◆ get_n3()

procedure, pass(t) tensor4::tensor4_t::get_n3 ( class(tensor4_t), intent(in t)
Parameters
tTensor to query.

Definition at line 74 of file tensor4.f90.

◆ get_n4()

procedure, pass(t) tensor4::tensor4_t::get_n4 ( class(tensor4_t), intent(in t)
Parameters
tTensor to query.

Definition at line 76 of file tensor4.f90.

◆ init()

generic tensor4::tensor4_t::init ( class(tensor4_t), intent(inout t,
integer, intent(in n1,
integer, intent(in n2,
integer, intent(in n3,
integer, intent(in n4,
character(len=*), intent(in), optional  name 
)
Note
Declared as a generic (rather than a plain binding) so that types extending tensor4_t can override init_dims and have that override correctly replace this specific within the inherited init generic, instead of ambiguously merging with it.

Definition at line 62 of file tensor4.f90.

◆ init_dims()

procedure, pass, private tensor4::tensor4_t::init_dims ( class(tensor4_t), intent(inout t,
integer, intent(in n1,
integer, intent(in n2,
integer, intent(in n3,
integer, intent(in n4,
character(len=*), intent(in), optional  name 
)
private
Parameters
tTensor to initialise.
n1Size of the first dimension.
n2Size of the second dimension.
n3Size of the third dimension.
n4Size of the fourth dimension.
nameOptional name of the tensor.

Definition at line 56 of file tensor4.f90.

◆ size()

procedure, pass(t) tensor4::tensor4_t::size ( class(tensor4_t), intent(in t)
Parameters
tTensor to query.

Definition at line 66 of file tensor4.f90.

◆ tensor4_assign_scalar()

procedure, pass(t) tensor4::tensor4_t::tensor4_assign_scalar ( class(tensor4_t), intent(inout t,
real(kind=rp), intent(in s 
)
Parameters
tTensor to assign to.
sScalar to fill the tensor with.

Definition at line 80 of file tensor4.f90.

◆ tensor4_assign_tensor4()

procedure, pass(t) tensor4::tensor4_t::tensor4_assign_tensor4 ( class(tensor4_t), intent(inout t,
type(tensor4_t), intent(in w 
)
Parameters
tTensor to assign to.
wTensor to assign from.

Definition at line 78 of file tensor4.f90.

Member Data Documentation

◆ n

integer, private tensor4::tensor4_t::n = 0
private

Definition at line 53 of file tensor4.f90.

◆ n1

integer, private tensor4::tensor4_t::n1 = 0
private

Definition at line 49 of file tensor4.f90.

◆ n2

integer, private tensor4::tensor4_t::n2 = 0
private

Definition at line 50 of file tensor4.f90.

◆ n3

integer, private tensor4::tensor4_t::n3 = 0
private

Definition at line 51 of file tensor4.f90.

◆ n4

integer, private tensor4::tensor4_t::n4 = 0
private

Definition at line 52 of file tensor4.f90.

◆ name

character(len=neko_varname_len) tensor4::tensor4_t::name = ""

Definition at line 47 of file tensor4.f90.

◆ x

real(kind=rp), dimension(:,:,:,:), allocatable tensor4::tensor4_t::x

Definition at line 46 of file tensor4.f90.

◆ x_d

type(c_ptr) tensor4::tensor4_t::x_d = C_NULL_PTR

Definition at line 48 of file tensor4.f90.


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