65 integer,
parameter :: &
71 type(ions_t),
pointer :: ions
72 real(real64),
allocatable :: center(:), x1(:), x2(:), to(:)
73 integer :: axis_type, idir, default
78 if (ions%space%is_periodic())
then
79 message(1) =
"oct-center-geom utility does not work for periodic systems."
83 safe_allocate(center(1:ions%space%dim))
84 safe_allocate(x1(1:ions%space%dim))
85 safe_allocate(x2(1:ions%space%dim))
86 safe_allocate(to(1:ions%space%dim))
90 "at the origin and is not compatible with a shifted BoxCenter")
94 if (ions%natoms > 1)
then
108 if (
parse_block(ions%namespace,
'MainAxis', blk) == 0)
then
109 do idir = 1, ions%space%dim
119 write(
message(1),
'(a,6f15.6)')
'Using main axis ', to
139 if (ions%space%dim == 3)
then
144 call parse_variable(ions%namespace,
'AxisType', default, axis_type)
147 if (ions%space%dim /= 3 .and. axis_type /= none)
then
148 call messages_not_implemented(
"alignment to axes (AxisType /= none) in other than 3 dimensions", namespace=ions%namespace)
151 select case (axis_type)
152 case (none, inertia, pseudo)
153 center = ions%center_of_mass(pseudo = (axis_type == pseudo))
159 call ions%translate(center)
160 call ions%axis_inertia(x1, x2, pseudo = (axis_type == pseudo))
162 center = ions%center()
168 call ions%translate(center)
169 call ions%axis_large(x1, x2)
171 write(
message(1),
'(a,i2,a)')
'AxisType = ', axis_type,
' not known by Octopus.'
175 write(
message(1),
'(a,99f15.6)')
'Found primary axis ', x1
176 write(
message(2),
'(a,99f15.6)')
'Found secondary axis ', x2
179 if (axis_type /= none)
then
180 call ions%rotate(x1, x2, to)
186 center = ions%center()
187 call ions%translate(center)
190 call ions%write_xyz(
'./adjusted')
192 safe_deallocate_a(center)
193 safe_deallocate_a(x1)
194 safe_deallocate_a(x2)
195 safe_deallocate_a(to)
196 safe_deallocate_p(ions)
subroutine, public getopt_init(ierr)
Initializes the getopt machinery. Must be called before attempting to parse the options....
subroutine, public getopt_end
subroutine, public global_end()
Finalise parser varinfo file, and MPI.
real(real64), parameter, public m_zero
type(mpi_comm), parameter, public serial_dummy_comm
Alias MPI_COMM_UNDEFINED for the specific use case of initialising Octopus utilities with no MPI supp...
subroutine, public init_octopus_globals(comm)
Initialise Octopus-specific global constants and files. This routine performs no initialisation calls...
real(real64), parameter, public m_one
subroutine, public io_init(defaults)
If the argument defaults is present and set to true, then the routine will not try to read anything f...
subroutine, public io_end()
subroutine, public messages_end()
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_init(output_dir)
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
type(namespace_t), public global_namespace
logical function, public parse_is_defined(namespace, name)
subroutine, public parser_init()
Initialise the Octopus parser.
subroutine, public parser_end()
End the Octopus parser.
integer function, public parse_block(namespace, name, blk, check_varinfo_)
subroutine, public profiling_end(namespace)
subroutine, public profiling_init(namespace)
Create profiling subdirectory.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
character(len=20) pure function, public units_abbrev(this)
This module defines the unit system, used for input and output.
type(unit_system_t), public units_out
subroutine, public unit_system_init(namespace)