43 integer,
allocatable :: map(:, :)
44 type(accel_mem_t) :: map_buffer
45 logical :: is_trivial = .false.
52 integer,
public,
parameter :: MCM_POINT = 4,
mcm_count = 5
59 type(mesh_cube_map_t),
intent(out) :: this
60 class(mesh_t),
intent(in) :: mesh
61 integer,
intent(in) :: np
63 integer :: i1(1:3), i2(1:3)
66 integer :: im, n1, n2, n3, expected_y, expected_z
70 if (mesh%idx%dim <= 3)
then
73 safe_allocate(this%map(1:5, 1:this%nmap))
83 if (any(i1(2:3) /= i2(2:3)) .or. i1(1) /= i2(1) + 1 .or. ip == 1)
then
84 this%nmap = this%nmap + 1
86 this%map(1:3, this%nmap) = i1(1:3)
87 this%map(mesh%idx%dim + 1:3, this%nmap) = 0
88 this%map(mcm_point, this%nmap) = ip
101 this%is_trivial = .false.
102 if (mesh%idx%dim == 3 .and. np == product(mesh%idx%ll(1:mesh%idx%dim)) &
103 .and. this%nmap > 0)
then
107 if (this%nmap == n2 * n3)
then
110 this%is_trivial = .
true.
112 expected_y = this%map(2, 1) + mod(im - 1, n2)
113 expected_z = this%map(3, 1) + (im - 1) / n2
115 this%map(mcm_point, im) /= (im - 1) * n1 + 1 .or. &
116 this%map(1, im) /= this%map(1, 1) .or. &
117 this%map(2, im) /= expected_y .or. &
118 this%map(3, im) /= expected_z)
then
119 this%is_trivial = .false.
143 if (
allocated(this%map))
then
145 safe_deallocate_a(this%map)
subroutine, public accel_free_buffer(this, async)
pure logical function, public accel_is_enabled()
integer, parameter, public accel_mem_read_only
This module implements the index, used for the mesh points.
subroutine, public mesh_cube_map_end(this)
integer, parameter, public mcm_count
subroutine, public mesh_cube_map_init(this, mesh, np)
This module defines the meshes, which are used in Octopus.
subroutine, public mesh_local_index_to_coords(mesh, ip, ix)
Given a local point index, this function returns the set of integer coordinates of the point.
type(type_t), public type_integer