57 type(mesh_t),
pointer :: mesh => null()
58 type(space_t),
pointer :: space => null()
62 type(distributed_t),
pointer,
public :: atoms_dist => null()
63 type(atom_t),
pointer,
public :: atom(:) => null()
64 real(real64),
pointer,
public :: pos(:,:) => null()
65 type(lattice_vectors_t),
pointer :: latt => null()
69 type(double_grid_t) :: dgrid
70 type(distributed_t),
pointer :: atoms_dist_plane => null()
89 class(interaction_partner_t),
target,
intent(inout) :: partner
90 class(nlcc_t),
pointer :: this
98 this%partner => partner
104 subroutine nlcc_init(this, mesh, ions, dgrid, atoms_dist_plane)
105 class(nlcc_t),
intent(inout) :: this
106 class(mesh_t),
target,
intent(in) :: mesh
107 type(ions_t),
target,
intent(in) :: ions
108 type(double_grid_t),
optional,
intent(in) :: dgrid
109 type(distributed_t),
optional,
target,
intent(in) :: atoms_dist_plane
115 safe_allocate(this%density(1:mesh%np,1))
117 this%atoms_dist => ions%atoms_dist
118 this%atom => ions%atom
119 this%space => ions%space
121 this%latt => ions%latt
123 if (
present(dgrid)) this%dgrid = dgrid
124 if (
present(atoms_dist_plane)) this%atoms_dist_plane => atoms_dist_plane
133 class(
nlcc_t),
intent(inout) :: this
138 this%atoms_dist => ions%atoms_dist
139 this%atom => ions%atom
140 this%space => ions%space
142 this%latt => ions%latt
151 integer :: ia, ia_start, ia_end
157 this%density(:,:) =
m_zero
163 if (
associated(this%atoms_dist_plane))
then
164 ia_start = this%atoms_dist_plane%start
165 ia_end = this%atoms_dist_plane%end
167 ia_start = this%atoms_dist%start
168 ia_end = this%atoms_dist%end
171 do ia = ia_start, ia_end
172 if (this%atom(ia)%species%is_ps_with_nlcc())
then
173 call species_get_nlcc(this%atom(ia)%species, this%space, this%latt, this%pos(:, ia), this%mesh, &
174 this%density(:,1), accumulate=.
true., dgrid=this%dgrid)
179 if (
associated(this%atoms_dist_plane))
then
180 if (this%atoms_dist_plane%parallel)
then
181 call comm_allreduce(this%atoms_dist_plane%mpi_grp, this%density(:,1))
183 else if (this%atoms_dist%parallel)
then
194 class(
nlcc_t),
intent(inout) :: this
198 safe_deallocate_a(this%density)
210 type(
nlcc_t),
intent(inout) :: this
221 class(
nlcc_t),
intent(inout) :: this
The Ono-Hirose double-grid technique [T. Ono and K. Hirose, Phys. Rev. Lett. 82, 5016 (1999); Phys....
subroutine, public double_grid_end(this)
real(real64), parameter, public m_zero
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
subroutine, public interaction_end(this)
This module defines classes and functions for interaction partners.
This module defines the meshes, which are used in Octopus.
subroutine nlcc_end(this)
subroutine nlcc_calculate(this)
subroutine nlcc_finalize(this)
subroutine nlcc_init(this, mesh, ions, dgrid, atoms_dist_plane)
class(nlcc_t) function, pointer nlcc_constructor(partner)
subroutine nlcc_calculate_energy(this)
subroutine nlcc_bind(this, ions)
Rebind NLCC helper pointers after copying the ionic geometry. The movers in NLCC reference ionic arra...
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
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.
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
subroutine, public species_get_nlcc(species, space, latt, pos, mesh, rho_core, accumulate, dgrid)