Octopus
|
Data Types | |
type | mix_t |
God class for mixing. More... | |
interface | mixfield_get_vnew |
type | mixfield_ptr_t |
interface | mixfield_set_vin |
interface | mixfield_set_vout |
type | mixfield_t |
Quantities used in mixing: Input, output and new potentials, and the residuals. More... | |
Functions/Subroutines | |
subroutine, public | mix_init (smix, namespace, space, der, d1, d2, def_, func_type_, prefix_) |
Initialise mix_t instance. More... | |
subroutine, public | mix_clear (smix) |
subroutine, public | mix_end (smix) |
subroutine, public | mix_dump (namespace, restart, smix, space, mesh, ierr) |
subroutine, public | mix_load (namespace, restart, smix, space, mesh, ierr) |
real(real64) pure function, public | mix_coefficient (this) |
integer pure function, public | mix_scheme (this) |
integer pure function, public | mix_d3 (this) |
subroutine, public | mix_get_field (this, mixfield) |
subroutine, public | mixing (namespace, smix) |
Main entry-point to SCF mixer. More... | |
subroutine, public | mix_add_auxmixfield (namespace, smix, mixfield) |
subroutine, public | mixfield_init (smix, mixfield, d1, d2, d3, func_type) |
Initialise all attributes of a mixfield instance. More... | |
subroutine, public | mixfield_end (smix, mixfield) |
Deallocate all arrays of a mixfield instance. More... | |
subroutine, public | mixfield_clear (scheme, mixfield) |
Zero all potential and field attributes of a mixfield instance. More... | |
subroutine | ddmixfield_set_vin (mixfield, vin_re, vin_im) |
subroutine | ddmixfield_set_vout (mixfield, vout_re, vout_im) |
subroutine | ddmixfield_get_vnew (mixfield, re, im) |
subroutine | compute_residuals_aux_field (this) |
Compute the residuals of the auxilliary fields. More... | |
subroutine | linear_mixing_aux_field (smix) |
Linear mixing of the auxilliary fields. More... | |
subroutine, public | dmixing (namespace, smix, vin, vout, vnew) |
Mix the input and output potentials (or densities) according to some scheme. More... | |
subroutine | dmixing_linear (d1, d2, coeff, vin, residual, vnew) |
Linear mixing of the input and output potentials. More... | |
subroutine | dcompute_residual (smix, dims, vin, vout, residual) |
Compute the residual of the potential (or density) for SCF mixing. More... | |
subroutine | dmixing_broyden (namespace, smix, f, vin, vnew, iter) |
Top-level routine for Broyden mixing. More... | |
subroutine | dbroyden_extrapolation (this, namespace, coeff, d1, d2, vin, vnew, iter_used, f, df, dv) |
Broyden mixing implementation. More... | |
subroutine | dbroyden_extrapolation_aux (this, namespace, ii, coeff, iter_used, dbeta, dwork, zbeta, zwork) |
Broyden mixing for auxilliary fields. More... | |
subroutine | dmixing_diis (this, vin, residual, vnew, iter) |
Direct inversion in the iterative subspace. More... | |
subroutine | dmixing_build_matrix (this, df, size, d2, ww, beta) |
real(real64) function | dmix_dotp (this, xx, yy, reduce) |
subroutine | dmixfield_set_vin (mixfield, vin) |
subroutine | dmixfield_set_vout (mixfield, vout) |
subroutine | dmixfield_get_vnew (mixfield, vnew) |
subroutine, public | zmixing (namespace, smix, vin, vout, vnew) |
Mix the input and output potentials (or densities) according to some scheme. More... | |
subroutine | zmixing_linear (d1, d2, coeff, vin, residual, vnew) |
Linear mixing of the input and output potentials. More... | |
subroutine | zcompute_residual (smix, dims, vin, vout, residual) |
Compute the residual of the potential (or density) for SCF mixing. More... | |
subroutine | zmixing_broyden (namespace, smix, f, vin, vnew, iter) |
Top-level routine for Broyden mixing. More... | |
subroutine | zbroyden_extrapolation (this, namespace, coeff, d1, d2, vin, vnew, iter_used, f, df, dv) |
Broyden mixing implementation. More... | |
subroutine | zbroyden_extrapolation_aux (this, namespace, ii, coeff, iter_used, dbeta, dwork, zbeta, zwork) |
Broyden mixing for auxilliary fields. More... | |
subroutine | zmixing_diis (this, vin, residual, vnew, iter) |
Direct inversion in the iterative subspace. More... | |
subroutine | zmixing_build_matrix (this, df, size, d2, ww, beta) |
complex(real64) function | zmix_dotp (this, xx, yy, reduce) |
subroutine | zmixfield_set_vin (mixfield, vin) |
subroutine | zmixfield_set_vout (mixfield, vout) |
subroutine | zmixfield_get_vnew (mixfield, vnew) |
Variables | |
integer, parameter | max_auxmixfield = 5 |
subroutine, public mix_oct_m::mix_init | ( | type(mix_t), intent(out) | smix, |
type(namespace_t), intent(in) | namespace, | ||
class(space_t), intent(in) | space, | ||
type(derivatives_t), intent(in), target | der, | ||
integer, intent(in) | d1, | ||
integer, intent(in) | d2, | ||
integer, intent(in), optional | def_, | ||
type(type_t), intent(in), optional | func_type_, | ||
character(len=*), intent(in), optional | prefix_ | ||
) |
subroutine, public mix_oct_m::mix_clear | ( | type(mix_t), intent(inout) | smix | ) |
subroutine, public mix_oct_m::mix_end | ( | type(mix_t), intent(inout) | smix | ) |
subroutine, public mix_oct_m::mix_dump | ( | type(namespace_t), intent(in) | namespace, |
type(restart_t), intent(in) | restart, | ||
type(mix_t), intent(in) | smix, | ||
class(space_t), intent(in) | space, | ||
class(mesh_t), intent(in) | mesh, | ||
integer, intent(out) | ierr | ||
) |
subroutine, public mix_oct_m::mix_load | ( | type(namespace_t), intent(in) | namespace, |
type(restart_t), intent(in) | restart, | ||
type(mix_t), intent(inout) | smix, | ||
class(space_t), intent(in) | space, | ||
class(mesh_t), intent(in) | mesh, | ||
integer, intent(out) | ierr | ||
) |
real(real64) pure function, public mix_oct_m::mix_coefficient | ( | type(mix_t), intent(in) | this | ) |
integer pure function, public mix_oct_m::mix_scheme | ( | type(mix_t), intent(in) | this | ) |
integer pure function, public mix_oct_m::mix_d3 | ( | type(mix_t), intent(in) | this | ) |
subroutine, public mix_oct_m::mix_get_field | ( | type(mix_t), intent(in), target | this, |
type(mixfield_t), intent(out), pointer | mixfield | ||
) |
subroutine, public mix_oct_m::mixing | ( | type(namespace_t), intent(in) | namespace, |
type(mix_t), intent(inout) | smix | ||
) |
subroutine, public mix_oct_m::mix_add_auxmixfield | ( | type(namespace_t), intent(in) | namespace, |
type(mix_t), intent(inout) | smix, | ||
type(mixfield_t), intent(in), target | mixfield | ||
) |
subroutine, public mix_oct_m::mixfield_init | ( | type(mix_t), intent(in) | smix, |
type(mixfield_t), intent(inout) | mixfield, | ||
integer, intent(in) | d1, | ||
integer, intent(in) | d2, | ||
integer, intent(in) | d3, | ||
type(type_t), intent(in) | func_type | ||
) |
subroutine, public mix_oct_m::mixfield_end | ( | type(mix_t), intent(inout) | smix, |
type(mixfield_t), intent(inout) | mixfield | ||
) |
subroutine, public mix_oct_m::mixfield_clear | ( | integer, intent(in) | scheme, |
type(mixfield_t), intent(inout) | mixfield | ||
) |
|
private |
|
private |
|
private |
|
private |
Compute the residuals of the auxilliary fields.
Given potential (or density) attributes of an smixauxmixfield(i)
instance, compute the residuals.
The if-statement is required because array attributes of an auxmixfield instance can be contain either real or complex. Whether the real or complex arrays should be used is indicated by the attribute smixauxmixfield(i)pfunc_type
.
[in,out] | this | Mixing instance and derivatives |
|
private |
Linear mixing of the auxilliary fields.
Given potential (or density) attributes of an smixauxmixfield(i)
instance, compute the residuals, then linearly mix the potential (or density).
The if-statement is required because array attributes of an auxmixfield instance can be contain either real or complex. Whether the real or complex arrays should be used is indicated by the attribute smixauxmixfield(i)pfunc_type
.
[in,out] | smix | Mixing instance and derivatives |
subroutine, public mix_oct_m::dmixing | ( | type(namespace_t), intent(in) | namespace, |
type(mix_t), intent(inout), target | smix, | ||
real(real64), dimension(:, :), intent(in), contiguous | vin, | ||
real(real64), dimension(:, :), intent(in), contiguous | vout, | ||
real(real64), dimension(:, :), intent(out), contiguous | vnew | ||
) |
Mix the input and output potentials (or densities) according to some scheme.
Whether \(v\) is the potential or the density is determined at run time.
[in,out] | smix | Mixing settings and derivatives |
[in] | vin | Input potential |
[in] | vout | Output potential |
[out] | vnew | Updated potential |
|
private |
Linear mixing of the input and output potentials.
Linear mixing is defined as:
\[ V_{\text{new}} = (1 - a) V_{\text{in}} + a V_{\text{out}}. \]
Using the definition of the residual, f$ V_{\text{out}} = V_{\text{in}} + R
[in] | d2 | Limits for each dimension of the potential |
[in] | coeff | Mixing coefficient |
[in] | vin | Input potential |
[out] | vnew | Updated potential |
|
private |
Compute the residual of the potential (or density) for SCF mixing.
In the absence of any preconditioning, the residual is defined as \( V_\text{out} - V_\text{in}\). If preconditioning is used, please refer to the specific scheme for the definition.
Note, d1, d2 are passed in because this routine should be compatible with both the potential and and the auxiliary fields (which have differing sizes).
[in] | smix | Mixing settings and derivatives |
[in] | dims | Dimensions of the terms to mix |
[in] | vin | Input potential |
[in] | vout | Output potential |
|
private |
Top-level routine for Broyden mixing.
Performs updating of smixmixfield
attributes. Whether \(v\) is the potential or the density is determined at run time.
[in,out] | smix | Mixing settings and derivatives |
[in] | f | Residual |
[in] | vin | Input potential |
[out] | vnew | Updated potential |
[in] | iter | Current SCF iteration |
|
private |
Broyden mixing implementation.
[in,out] | this | Mixing settings and derivatives |
[in] | coeff | Mixing coefficient |
[in] | d2 | Dimensions of the potential and residual |
[in] | iter_used | Number of iterations to use in the mixing |
[in] | vin | Residual and potential for current iteration |
[in] | dv | Residual and potential from size(df, 4) iterations |
[out] | vnew | Updated potential |
|
private |
Broyden mixing for auxilliary fields.
Auxilliary fields "follow" the direction of the mixing, but do not influence the direction. Auxilliary fields are passed as an attribute of a mix_t instance
mf
(better-named aux_field
) was passed in, then a wrapper method performs the iteration over the N aux fields, like:
|
private |
Direct inversion in the iterative subspace.
For implementation details, please refer to:
|
private |
|
private |
|
private |
|
private |
|
private |
subroutine, public mix_oct_m::zmixing | ( | type(namespace_t), intent(in) | namespace, |
type(mix_t), intent(inout), target | smix, | ||
complex(real64), dimension(:, :), intent(in), contiguous | vin, | ||
complex(real64), dimension(:, :), intent(in), contiguous | vout, | ||
complex(real64), dimension(:, :), intent(out), contiguous | vnew | ||
) |
Mix the input and output potentials (or densities) according to some scheme.
Whether \(v\) is the potential or the density is determined at run time.
[in,out] | smix | Mixing settings and derivatives |
[in] | vin | Input potential |
[in] | vout | Output potential |
[out] | vnew | Updated potential |
|
private |
Linear mixing of the input and output potentials.
Linear mixing is defined as:
\[ V_{\text{new}} = (1 - a) V_{\text{in}} + a V_{\text{out}}. \]
Using the definition of the residual, f$ V_{\text{out}} = V_{\text{in}} + R
[in] | d2 | Limits for each dimension of the potential |
[in] | coeff | Mixing coefficient |
[in] | vin | Input potential |
[out] | vnew | Updated potential |
|
private |
Compute the residual of the potential (or density) for SCF mixing.
In the absence of any preconditioning, the residual is defined as \( V_\text{out} - V_\text{in}\). If preconditioning is used, please refer to the specific scheme for the definition.
Note, d1, d2 are passed in because this routine should be compatible with both the potential and and the auxiliary fields (which have differing sizes).
[in] | smix | Mixing settings and derivatives |
[in] | dims | Dimensions of the terms to mix |
[in] | vin | Input potential |
[in] | vout | Output potential |
|
private |
Top-level routine for Broyden mixing.
Performs updating of smixmixfield
attributes. Whether \(v\) is the potential or the density is determined at run time.
[in,out] | smix | Mixing settings and derivatives |
[in] | f | Residual |
[in] | vin | Input potential |
[out] | vnew | Updated potential |
[in] | iter | Current SCF iteration |
|
private |
Broyden mixing implementation.
[in,out] | this | Mixing settings and derivatives |
[in] | coeff | Mixing coefficient |
[in] | d2 | Dimensions of the potential and residual |
[in] | iter_used | Number of iterations to use in the mixing |
[in] | vin | Residual and potential for current iteration |
[in] | dv | Residual and potential from size(df, 4) iterations |
[out] | vnew | Updated potential |
|
private |
Broyden mixing for auxilliary fields.
Auxilliary fields "follow" the direction of the mixing, but do not influence the direction. Auxilliary fields are passed as an attribute of a mix_t instance
mf
(better-named aux_field
) was passed in, then a wrapper method performs the iteration over the N aux fields, like:
|
private |
Direct inversion in the iterative subspace.
For implementation details, please refer to:
|
private |
|
private |
|
private |
|
private |
|
private |