Octopus
cube_function.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2011 M. Marques, A. Castro, A. Rubio, G. Bertsch, M. Oliveira
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
22 use accel_oct_m
23 use cube_oct_m
24 use debug_oct_m
25 use fft_oct_m
26 use global_oct_m
28 use math_oct_m
29 use mesh_oct_m
33 use mpi_oct_m
40 use types_oct_m
41
42 implicit none
43 private
44 public :: &
66
68 ! Components are public by default
69 integer :: batch_capacity = 1
70 integer :: batch_size = 1
74 integer :: batch_axis = 1
75 real(real64), pointer, contiguous :: dRS(:, :, :, :) => null()
76 complex(real64), pointer, contiguous :: zRS(:, :, :, :) => null()
77 complex(real64), pointer, contiguous :: FS(:, :, :, :) => null()
78 logical :: forced_alloc = .false.
79 logical :: in_device_memory = .false.
80 type(accel_mem_t) :: real_space_buffer
81 type(accel_mem_t) :: fourier_space_buffer
82 end type cube_function_t
83
84 interface dmesh_to_cube
85 module procedure dmesh_to_cube_1, dmesh_to_cube_2
86 end interface dmesh_to_cube
87
88 interface zmesh_to_cube
89 module procedure zmesh_to_cube_1, zmesh_to_cube_2
90 end interface zmesh_to_cube
91
92 interface dcube_to_mesh
93 module procedure dcube_to_mesh_1, dcube_to_mesh_2
94 end interface dcube_to_mesh
95
96 interface zcube_to_mesh
97 module procedure zcube_to_mesh_1, zcube_to_mesh_2
98 end interface zcube_to_mesh
99
100contains
101
102 ! ---------------------------------------------------------
108 pure logical function cube_map_is_trivial(cube) result(trivial)
109 type(cube_t), intent(in) :: cube
110 trivial = cube%cube_map_present .and. allocated(cube%cube_map%map)
111 if (.not. trivial) return
112 ! is_trivial captures the mesh-side property; the additional checks
113 ! verify the cube dimensions match the mesh and the cube origin aligns
114 ! so that mesh point 1 lands at cube cell (1, 1, 1).
115 trivial = cube%cube_map%is_trivial .and. &
116 cube%cube_map%nmap == cube%rs_n(2) * cube%rs_n(3) .and. &
117 cube%cube_map%map(mcm_count, 1) == cube%rs_n(1) .and. &
118 cube%cube_map%map(1, 1) + cube%center(1) == 1 .and. &
119 cube%cube_map%map(2, 1) + cube%center(2) == 1 .and. &
120 cube%cube_map%map(3, 1) + cube%center(3) == 1
121 end function cube_map_is_trivial
122
123#include "undef.F90"
124#include "real.F90"
125#include "cube_function_inc.F90"
126
127#include "undef.F90"
128#include "complex.F90"
129#include "cube_function_inc.F90"
130
131end module cube_function_oct_m
132
133
134!! Local Variables:
135!! mode: f90
136!! coding: utf-8
137!! End:
subroutine zcube_to_mesh_2(cube, cf, mesh, mf, view)
Convert a set of functions from the cube to the mesh.
real(real64) function, public dcube_function_surface_average(cube, cf)
This function calculates the surface average of any function.
complex(real64) function, public zcube_function_surface_average(cube, cf)
This function calculates the surface average of any function.
subroutine dcube_to_mesh_2(cube, cf, mesh, mf, view)
Convert a set of functions from the cube to the mesh.
subroutine dcube_to_mesh_1(cube, cf, mesh, mf)
Convert a single function from the cube to the mesh.
subroutine, public dcube_to_submesh(cube, cf, sm, mf)
subroutine dmesh_to_cube_2(mesh, mf, cube, cf, view)
Convert a set of functions from the mesh to the cube.
subroutine, public dcube_function_allgather(cube, cf, cf_local, order, gatherfs)
subroutine, public zcube_to_mesh_parallel(cube, cf, mesh, mf, map)
subroutine, public dcube_function_alloc_rs(cube, cf, in_device, force_alloc)
Allocates locally the real space grid, if PFFT library is not used. Otherwise, it assigns the PFFT re...
subroutine zmesh_to_cube_2(mesh, mf, cube, cf, view)
Convert a set of functions from the mesh to the cube.
subroutine zmesh_to_cube_1(mesh, mf, cube, cf)
Convert a single function from the mesh to the cube.
subroutine, public zcube_to_submesh(cube, cf, sm, mf)
subroutine, public zmesh_to_cube_parallel(mesh, mf, cube, cf, map)
The next two subroutines convert a function between the normal mesh and the cube in parallel.
subroutine, public dcube_function_free_rs(cube, cf)
Deallocates the real space grid.
subroutine dmesh_to_cube_1(mesh, mf, cube, cf)
Convert a single function from the mesh to the cube.
subroutine, public dsubmesh_to_cube(sm, mf, cube, cf)
The next two subroutines convert a function between a submesh and the cube.
subroutine, public zsubmesh_to_cube(sm, mf, cube, cf)
The next two subroutines convert a function between a submesh and the cube.
subroutine, public zcube_function_allgather(cube, cf, cf_local, order, gatherfs)
subroutine, public dmesh_to_cube_parallel(mesh, mf, cube, cf, map)
The next two subroutines convert a function between the normal mesh and the cube in parallel.
subroutine, public zcube_function_free_rs(cube, cf)
Deallocates the real space grid.
pure logical function cube_map_is_trivial(cube)
True when the cube_map describes a trivial mesh->cube identity: the mesh is X-fastest with one full-X...
subroutine, public dcube_to_mesh_parallel(cube, cf, mesh, mf, map)
subroutine, public zcube_function_alloc_rs(cube, cf, in_device, force_alloc)
Allocates locally the real space grid, if PFFT library is not used. Otherwise, it assigns the PFFT re...
subroutine zcube_to_mesh_1(cube, cf, mesh, mf)
Convert a single function from the cube to the mesh.
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
Definition: fft.F90:120
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:117
integer, parameter, public mcm_count
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
Some general things and nomenclature:
Definition: par_vec.F90:173
This module is an helper to perform ring-pattern communications among all states.