64 type(symmetries_t),
pointer :: symm
65 integer(int64),
allocatable :: map(:,:)
66 integer(int64),
allocatable :: map_inv(:,:)
67 type(accel_mem_t) :: map_buff
69 procedure symmetrize_lattice_vectors
76 type(symmetrizer_t),
intent(out) :: this
77 class(mesh_t),
intent(in) :: mesh
78 type(symmetries_t),
target,
intent(in) :: symm
80 integer :: nops, ip, iop, idir, idx(3)
81 real(real64) :: destpoint(3), srcpoint(3), srcpoint_inv(3), lsize(3), offset(3)
85 assert(mesh%box%dim <= 3)
92 safe_allocate(this%map(1:mesh%np, 1:nops))
93 safe_allocate(this%map_inv(1:mesh%np, 1:nops))
97 lsize = real(mesh%idx%ll, real64)
98 offset = real(mesh%idx%nr(1, :) + mesh%idx%enlarge, real64)
102 destpoint = real(idx, real64) - offset
105 assert(all(nint(destpoint) >= 0))
106 assert(all(nint(destpoint) < lsize))
109 destpoint = destpoint + offset
112 destpoint = destpoint/lsize
121 srcpoint = srcpoint*lsize
122 srcpoint_inv = srcpoint_inv*lsize
125 srcpoint = srcpoint - offset
126 srcpoint_inv = srcpoint_inv - offset
128 do idir = 1, symm%periodic_dim
129 if (nint(srcpoint(idir)) < 0 .or. nint(srcpoint(idir)) >= mesh%idx%ll(idir))
then
130 srcpoint(idir) = real(modulo(nint(srcpoint(idir)), mesh%idx%ll(idir)), real64)
132 if (nint(srcpoint_inv(idir)) < 0 .or. nint(srcpoint_inv(idir)) >= mesh%idx%ll(idir))
then
133 srcpoint_inv(idir) = real(modulo(nint(srcpoint_inv(idir)), mesh%idx%ll(idir)), real64)
136 assert(all(nint(srcpoint) >= 0))
137 assert(all(nint(srcpoint) < mesh%idx%ll))
138 srcpoint = srcpoint + offset
140 assert(all(nint(srcpoint_inv) >= 0))
141 assert(all(nint(srcpoint_inv) < mesh%idx%ll))
142 srcpoint_inv = srcpoint_inv + offset
145 assert(this%map(ip, iop) <= mesh%np_global)
147 assert(this%map_inv(ip, iop) <= mesh%np_global)
163 class(
mesh_t),
intent(in) :: mesh
165 integer :: nops, ip, iop
166 integer,
allocatable :: map_tmp(:,:)
170 if (
accel_is_enabled() .and. .not. mesh%parallel_in_domains .and. .not. this%map_buff%allocated)
then
171 assert(
allocated(this%map))
173 safe_allocate(map_tmp(1:mesh%np, 1:nops))
178 map_tmp(ip, iop) = int(this%map(ip, iop) - 1, int32)
183 safe_deallocate_a(map_tmp)
197 safe_deallocate_a(this%map)
198 safe_deallocate_a(this%map_inv)
215 integer,
intent(in) :: size
216 real(real64),
intent(in) :: initial_rlattice(size,size)
217 real(real64),
intent(inout) :: rlattice(size,size)
218 logical,
intent(in) :: symmetrize
220 real(real64) :: strain(3,3), inv_initial_rlattice(size,size)
222 real(real64),
parameter :: tol_small = 1.0e-14_real64
229 inv_initial_rlattice = initial_rlattice
237 strain(idir, idir) =
m_one
240 strain(1:
size,1:size) = matmul(rlattice, inv_initial_rlattice)
246 strain =
m_half * (strain + transpose(strain))
253 rlattice = matmul(strain(1:
size,1:size), initial_rlattice)
264#include "symmetrizer_inc.F90"
267#include "complex.F90"
268#include "symmetrizer_inc.F90"
274#include "symmetrizer_batch_inc.F90"
277#include "complex.F90"
278#include "symmetrizer_batch_inc.F90"
282#include "symmetrizer_batch_inc.F90"
285#include "complex32.F90"
286#include "symmetrizer_batch_inc.F90"
subroutine, public accel_free_buffer(this, async)
pure logical function, public accel_is_enabled()
integer, parameter, public accel_mem_read_only
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
real(real64), parameter, public m_zero
real(real64), parameter, public m_half
real(real64), parameter, public m_one
This module implements the index, used for the mesh points.
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public dzero_small_elements_matrix(aa, tol)
This module defines the meshes, which are used in Octopus.
integer(int64) function, public mesh_global_index_from_coords(mesh, ix)
This function returns the true global index of the point for a given vector of integer coordinates.
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.
Some general things and nomenclature:
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
integer pure function, public symmetries_number(this)
subroutine, public dsymmetrizer_apply(this, mesh, field, field_vector, symmfield, symmfield_vector, suppress_warning, reduced_quantity)
supply field and symmfield, and/or field_vector and symmfield_vector
subroutine, public dsymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public dsymmetrize_magneto_optics_cart(symm, tensor)
subroutine, public symmetrizer_end(this)
subroutine, public zsymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public zsymmetrizer_apply_single(this, mesh, iop, field, symmfield)
The same as for symmetrizer_apply, but a single symmetry operation.
subroutine, public ssymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public zsymmetrizer_apply(this, mesh, field, field_vector, symmfield, symmfield_vector, suppress_warning, reduced_quantity)
supply field and symmfield, and/or field_vector and symmfield_vector
subroutine, public dsymmetrizer_apply_single(this, mesh, iop, field, symmfield)
The same as for symmetrizer_apply, but a single symmetry operation.
subroutine, public symmetrize_lattice_vectors(this, size, initial_rlattice, rlattice, symmetrize)
Given a symmetric lattice vector, symmetrize another one.
subroutine, public dsymmetrize_tensor_cart(symm, tensor, use_non_symmorphic)
Symmetric a rank-2 tensor defined in Cartesian space.
subroutine, public zsymmetrize_tensor_cart(symm, tensor, use_non_symmorphic)
Symmetric a rank-2 tensor defined in Cartesian space.
subroutine, public csymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public zsymmetrize_magneto_optics_cart(symm, tensor)
subroutine, public symmetrizer_init(this, mesh, symm)
subroutine, public symmetrizer_build_map_buffer(this, mesh)
Build the symmetrization map on GPU.
type(type_t), parameter, public type_integer
Describes mesh distribution to nodes.