56 type(symmetries_t),
pointer :: symm
57 integer(int64),
allocatable :: map(:,:)
58 integer(int64),
allocatable :: map_inv(:,:)
60 procedure symmetrize_lattice_vectors
67 type(symmetrizer_t),
intent(out) :: this
68 class(mesh_t),
intent(in) :: mesh
69 type(symmetries_t),
target,
intent(in) :: symm
71 integer :: nops, ip, iop, idir, idx(3)
72 real(real64) :: destpoint(3), srcpoint(3), srcpoint_inv(3), lsize(3), offset(3)
76 assert(mesh%box%dim <= 3)
83 safe_allocate(this%map(1:mesh%np, 1:nops))
84 safe_allocate(this%map_inv(1:mesh%np, 1:nops))
88 lsize = real(mesh%idx%ll, real64)
89 offset = real(mesh%idx%nr(1, :) + mesh%idx%enlarge, real64)
93 destpoint = real(idx, real64) - offset
96 assert(all(nint(destpoint) >= 0))
97 assert(all(nint(destpoint) < lsize))
100 destpoint = destpoint + offset
103 destpoint = destpoint/lsize
112 srcpoint = srcpoint*lsize
113 srcpoint_inv = srcpoint_inv*lsize
116 srcpoint = srcpoint - offset
117 srcpoint_inv = srcpoint_inv - offset
119 do idir = 1, symm%periodic_dim
120 if (nint(srcpoint(idir)) < 0 .or. nint(srcpoint(idir)) >= mesh%idx%ll(idir))
then
121 srcpoint(idir) = real(modulo(nint(srcpoint(idir)), mesh%idx%ll(idir)), real64)
123 if (nint(srcpoint_inv(idir)) < 0 .or. nint(srcpoint_inv(idir)) >= mesh%idx%ll(idir))
then
124 srcpoint_inv(idir) = real(modulo(nint(srcpoint_inv(idir)), mesh%idx%ll(idir)), real64)
127 assert(all(nint(srcpoint) >= 0))
128 assert(all(nint(srcpoint) < mesh%idx%ll))
129 srcpoint = srcpoint + offset
131 assert(all(nint(srcpoint_inv) >= 0))
132 assert(all(nint(srcpoint_inv) < mesh%idx%ll))
133 srcpoint_inv = srcpoint_inv + offset
136 assert(this%map(ip, iop) <= mesh%np_global)
138 assert(this%map_inv(ip, iop) <= mesh%np_global)
155 safe_deallocate_a(this%map)
156 safe_deallocate_a(this%map_inv)
171 integer,
intent(in) :: size
172 real(real64),
intent(in) :: initial_rlattice(size,size)
173 real(real64),
intent(inout) :: rlattice(size,size)
174 logical,
intent(in) :: symmetrize
176 real(real64) :: strain(size,size), inv_initial_rlattice(size,size)
177 real(real64),
parameter :: tol_small = 1.0e-14_real64
184 inv_initial_rlattice = initial_rlattice
188 strain = matmul(rlattice, inv_initial_rlattice)
194 strain =
m_half * (strain + transpose(strain))
201 rlattice = matmul(strain, initial_rlattice)
212#include "symmetrizer_inc.F90"
215#include "complex.F90"
216#include "symmetrizer_inc.F90"
real(real64), parameter, public m_half
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(nn, 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 dsymmetrize_magneto_optics_cart(symm, tensor)
subroutine, public symmetrizer_end(this)
subroutine, public zsymmetrizer_apply_single(this, mesh, iop, field, symmfield)
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)
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 zsymmetrize_magneto_optics_cart(symm, tensor)
subroutine, public symmetrizer_init(this, mesh, symm)