52 logical,
public :: has_phase
79 subroutine wfs_elec_clone_to(this, dest, pack, copy_data, new_np, special, dest_type)
80 class(wfs_elec_t),
intent(in) :: this
81 class(batch_t),
allocatable,
intent(out) :: dest
82 logical,
optional,
intent(in) :: pack
83 logical,
optional,
intent(in) :: copy_data
84 integer,
optional,
intent(in) :: new_np
85 logical,
optional,
intent(in) :: special
87 type(type_t),
optional,
intent(in) :: dest_type
91 if (.not.
allocated(dest))
then
94 message(1) =
"Internal error: destination batch in wfs_elec_clone_to has been previously allocated."
100 call this%copy_to(dest, pack, copy_data, new_np, special, dest_type)
102 message(1) =
"Internal error: imcompatible batches in wfs_elec_clone_to."
111 class(wfs_elec_t),
intent(in) :: this
112 class(batch_t),
allocatable,
intent(out) :: dest(:)
113 integer,
intent(in) :: n_batches
114 logical,
optional,
intent(in) :: pack
115 logical,
optional,
intent(in) :: copy_data
116 integer,
optional,
intent(in) :: new_np
117 logical,
optional,
intent(in) :: special
119 type(type_t),
optional,
intent(in) :: dest_type
125 if (.not.
allocated(dest))
then
126 safe_allocate_type_array(
wfs_elec_t, dest, (1:n_batches))
128 message(1) =
"Internal error: destination batch in wfs_elec_clone_to_array has been previously allocated."
135 call this%copy_to(dest(ib), pack, copy_data, new_np, special, dest_type)
138 message(1) =
"Internal error: incompatible batches in wfs_elec_clone_to_array."
149 class(
batch_t),
intent(out) :: dest
150 logical,
optional,
intent(in) :: pack
151 logical,
optional,
intent(in) :: copy_data
152 integer,
optional,
intent(in) :: new_np
153 logical,
optional,
intent(in) :: special
154 type(
type_t),
optional,
intent(in) :: dest_type
161 dest%has_phase = this%has_phase
162 call this%batch_t%copy_to(dest%batch_t, pack, copy_data, new_np, special=special, dest_type=dest_type)
164 message(1) =
"Internal error: incompatible batches in wfs_elec_copy_to."
173 class(wfs_elec_t),
intent(in) :: this
174 integer,
intent(in) :: np
175 class(
batch_t),
intent(inout) :: dest
176 logical,
optional,
intent(in) :: async
183 dest%has_phase = this%has_phase
184 call this%batch_t%copy_data_to(np, dest%batch_t, async)
186 message(1) =
"Internal error: incompatible batches in wfs_elec_copy_data_to."
200 class(
batch_t),
intent(in) :: target
201 logical,
optional,
intent(in) :: only_check_dim
202 logical,
optional,
intent(in) :: type_check
208 assert(this%ik ==
target%ik)
209 assert(this%has_phase .eqv.
target%has_phase)
211 message(1) =
"Internal error: imcompatible batches in wfs_elec_check_compatibility_with."
214 call this%batch_t%check_compatibility_with(
target, only_check_dim, type_check)
224 logical,
optional,
intent(in) :: copy
229 this%has_phase = .false.
230 call this%batch_t%end(copy)
237#include "wfs_elec_inc.F90"
240#include "complex.F90"
241#include "wfs_elec_inc.F90"
This module implements batches of mesh functions.
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public zwfs_elec_init(this, dim, st_start, st_end, np, ik, special, packed)
initialize an empty wfs_elec_t object
subroutine wfs_elec_clone_to(this, dest, pack, copy_data, new_np, special, dest_type)
clone to another wfs_elec_t object
subroutine dwfs_elec_init_with_memory_3(this, dim, st_start, st_end, psi, ik)
initialize a wfs_elec_t object with given memory
subroutine wfs_elec_clone_to_array(this, dest, n_batches, pack, copy_data, new_np, special, dest_type)
Clone the data to multiple wfs_elec_t objects.
subroutine zwfs_elec_init_with_memory_2(this, dim, st_start, st_end, psi, ik)
initialize a wfs_elec_t object with given memory
subroutine dwfs_elec_init_with_memory_2(this, dim, st_start, st_end, psi, ik)
initialize a wfs_elec_t object with given memory
subroutine wfs_elec_copy_to(this, dest, pack, copy_data, new_np, special, dest_type)
copy a contained batch to another (existing) wfs_elec_t object
subroutine wfs_elec_copy_data_to(this, np, dest, async)
copy the data of the contained batch to another (existing) wfs_elec_t object
subroutine, public dwfs_elec_init(this, dim, st_start, st_end, np, ik, special, packed)
initialize an empty wfs_elec_t object
subroutine wfs_elec_end(this, copy)
finalze the object and the contained batch
subroutine wfs_elec_check_compatibility_with(this, target, only_check_dim, type_check)
check whether the object is compatible with a target object
subroutine zwfs_elec_init_with_memory_3(this, dim, st_start, st_end, psi, ik)
initialize a wfs_elec_t object with given memory
Class defining batches of mesh functions.
batches of electronic states