55 type(symmetries_t),
pointer :: symm
56 integer(int64),
allocatable :: map(:,:)
57 integer(int64),
allocatable :: map_inv(:,:)
59 procedure symmetrize_lattice_vectors
66 type(symmetrizer_t),
intent(out) :: this
67 class(mesh_t),
intent(in) :: mesh
68 type(symmetries_t),
target,
intent(in) :: symm
70 integer :: nops, ip, iop, idir, idx(3)
71 real(real64) :: destpoint(3), srcpoint(3), srcpoint_inv(3), lsize(3), offset(3)
75 assert(mesh%box%dim <= 3)
82 safe_allocate(this%map(1:mesh%np, 1:nops))
83 safe_allocate(this%map_inv(1:mesh%np, 1:nops))
87 lsize = real(mesh%idx%ll, real64)
88 offset = real(mesh%idx%nr(1, :) + mesh%idx%enlarge, real64)
92 destpoint = real(idx, real64) - offset
95 assert(all(nint(destpoint) >= 0))
96 assert(all(nint(destpoint) < lsize))
99 destpoint = destpoint + offset
102 destpoint = destpoint/lsize
111 srcpoint = srcpoint*lsize
112 srcpoint_inv = srcpoint_inv*lsize
115 srcpoint = srcpoint - offset
116 srcpoint_inv = srcpoint_inv - offset
118 do idir = 1, symm%periodic_dim
119 if (nint(srcpoint(idir)) < 0 .or. nint(srcpoint(idir)) >= mesh%idx%ll(idir))
then
120 srcpoint(idir) = real(modulo(nint(srcpoint(idir)), mesh%idx%ll(idir)), real64)
122 if (nint(srcpoint_inv(idir)) < 0 .or. nint(srcpoint_inv(idir)) >= mesh%idx%ll(idir))
then
123 srcpoint_inv(idir) = real(modulo(nint(srcpoint_inv(idir)), mesh%idx%ll(idir)), real64)
126 assert(all(nint(srcpoint) >= 0))
127 assert(all(nint(srcpoint) < mesh%idx%ll))
128 srcpoint = srcpoint + offset
130 assert(all(nint(srcpoint_inv) >= 0))
131 assert(all(nint(srcpoint_inv) < mesh%idx%ll))
132 srcpoint_inv = srcpoint_inv + offset
135 assert(this%map(ip, iop) <= mesh%np_global)
137 assert(this%map_inv(ip, iop) <= mesh%np_global)
149 type(symmetrizer_t),
intent(inout) :: this
154 safe_deallocate_a(this%map)
155 safe_deallocate_a(this%map_inv)
170 integer,
intent(in) :: size
171 real(real64),
intent(in) :: initial_rlattice(size,size)
172 real(real64),
intent(inout) :: rlattice(size,size)
173 logical,
intent(in) :: symmetrize
175 real(real64) :: strain(size,size), inv_initial_rlattice(size,size)
176 real(real64),
parameter :: tol_small = 1.0e-14_real64
183 inv_initial_rlattice = initial_rlattice
187 strain = matmul(rlattice, inv_initial_rlattice)
193 strain =
m_half * (strain + transpose(strain))
200 rlattice = matmul(strain, initial_rlattice)
211#include "symmetrizer_inc.F90"
214#include "complex.F90"
215#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(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)