ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
elecstate::TDFieldManager Class Reference

Own and advance all time-dependent electric fields in RT-TDDFT. More...

#include <td_field_manager.h>

Collaboration diagram for elecstate::TDFieldManager:

Public Member Functions

void prepare_sample (const int step)
 Sample the length gauge, or initialize A(0) and E(0) without advancing time.
void prepare_interval (const int left_step, const int sample_step)
 Prepare consecutive endpoints, with sample_step=left_step+1. Repeating the same interval and sample is idempotent. Propagation A is the endpoint average, not an exact midpoint sample.
TDFieldState field_state () const
 Capture the current field without advancing the original sampling grid.
void bind_field (const TDFieldState &state)
 Bind trial fields without advancing or integrating the original interval again.
TDFieldState subinterval (const TDFieldState &full, int index, int parts) const
 Evaluate interval [index/parts,(index+1)/parts] inside the prepared original step.
double interval_dt_ha () const
 Duration of the currently bound trial interval in Hartree atomic units.
void set_A_samples (const std::vector< ModuleBase::Vector3< double > > &samples_ha)
 Supply endpoint samples starting at t=0 before preparing any steps.
bool file_source () const
 Whether endpoints and finite-difference electric fields come from a file.
const ModuleBase::Vector3< double > & A_left_ha () const
 Return interval endpoints in Hartree atomic units.
const ModuleBase::Vector3< double > & A_right_ha () const
const ModuleBase::Vector3< double > & A_prop_ha () const
 Return the endpoint average in Hartree units, or A(0) at initialization.
void read_restart (const std::string &file_dir)
 Restore the electronic step and vector-potential state.
void write_restart (const std::string &file_dir) const
 Save three annotated data rows describing the interval state in Hartree units.
int gauge () const
 Return the spatial-gauge selector supplied by td_stype.
int current_step () const
 Return the current zero-based electronic-step index.
double dt_ha () const
 Return the electronic time step in Hartree atomic time units.
double length_cut1 () const
 Return the first reduced-coordinate cut of the length gauge.
double length_cut2 () const
 Return the second reduced-coordinate cut of the length gauge.
bool active () const
 Return whether the configured field is active at this step.
const std::vector< TDField > & fields () const
 Return all configured fields in input-occurrence order.
const std::vector< double > & field_vals_ha () const
 Return per-occurrence field samples for the current step.
const ModuleBase::Vector3< double > & efield_ha () const
 Return the direction-summed sampled electric field in Hartree atomic units.

Private Member Functions

 TDFieldManager (bool enabled, int gauge, int start_step, int end_step, double dt, double length_cut1, double length_cut2, std::vector< TDField > fields)
void sample_field (const int step)
void select_A_prop ()
ModuleBase::Vector3< double > substep_a (const TDFieldState &full, int node, int parts) const

Private Attributes

bool enabled_
int gauge_
int start_step_
int end_step_
double dt_ha_
double interval_dt_ha_
double length_cut1_
double length_cut2_
std::vector< TDField > fields_
int current_step_
bool active_
std::vector< double > field_vals_ha_
int interval_left_ = -1
std::vector< ModuleBase::Vector3< double > > A_samples_ha_
ModuleBase::Vector3< double > A_left_ha_
ModuleBase::Vector3< double > A_right_ha_
ModuleBase::Vector3< double > A_prop_ha_
ModuleBase::Vector3< double > efield_ha_

Friends

std::shared_ptr< TDFieldManager > create_td_field_manager (const Input_para &input)
 Build all field profiles and convert user input to propagation units.

Detailed Description

Own and advance all time-dependent electric fields in RT-TDDFT.

The manager preserves per-occurrence values for output while also summing fields that share a Cartesian direction. It is the single source of step, electric-field, and vector-potential state for all spatial gauges.

Constructor & Destructor Documentation

◆ TDFieldManager()

elecstate::TDFieldManager::TDFieldManager ( bool enabled,
int gauge,
int start_step,
int end_step,
double dt,
double length_cut1,
double length_cut2,
std::vector< TDField > fields )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ A_left_ha()

const ModuleBase::Vector3< double > & elecstate::TDFieldManager::A_left_ha ( ) const

Return interval endpoints in Hartree atomic units.

Here is the caller graph for this function:

◆ A_prop_ha()

const ModuleBase::Vector3< double > & elecstate::TDFieldManager::A_prop_ha ( ) const

Return the endpoint average in Hartree units, or A(0) at initialization.

Here is the caller graph for this function:

◆ A_right_ha()

const ModuleBase::Vector3< double > & elecstate::TDFieldManager::A_right_ha ( ) const
Here is the caller graph for this function:

◆ active()

bool elecstate::TDFieldManager::active ( ) const

Return whether the configured field is active at this step.

◆ bind_field()

void elecstate::TDFieldManager::bind_field ( const TDFieldState & state)

Bind trial fields without advancing or integrating the original interval again.

◆ current_step()

int elecstate::TDFieldManager::current_step ( ) const

Return the current zero-based electronic-step index.

Here is the caller graph for this function:

◆ dt_ha()

double elecstate::TDFieldManager::dt_ha ( ) const

Return the electronic time step in Hartree atomic time units.

Here is the caller graph for this function:

◆ efield_ha()

const ModuleBase::Vector3< double > & elecstate::TDFieldManager::efield_ha ( ) const

Return the direction-summed sampled electric field in Hartree atomic units.

Here is the caller graph for this function:

◆ field_state()

TDFieldState elecstate::TDFieldManager::field_state ( ) const

Capture the current field without advancing the original sampling grid.

◆ field_vals_ha()

const std::vector< double > & elecstate::TDFieldManager::field_vals_ha ( ) const

Return per-occurrence field samples for the current step.

Here is the caller graph for this function:

◆ fields()

const std::vector< TDField > & elecstate::TDFieldManager::fields ( ) const

Return all configured fields in input-occurrence order.

Here is the caller graph for this function:

◆ file_source()

bool elecstate::TDFieldManager::file_source ( ) const

Whether endpoints and finite-difference electric fields come from a file.

Here is the caller graph for this function:

◆ gauge()

int elecstate::TDFieldManager::gauge ( ) const

Return the spatial-gauge selector supplied by td_stype.

Here is the caller graph for this function:

◆ interval_dt_ha()

double elecstate::TDFieldManager::interval_dt_ha ( ) const

Duration of the currently bound trial interval in Hartree atomic units.

Here is the caller graph for this function:

◆ length_cut1()

double elecstate::TDFieldManager::length_cut1 ( ) const

Return the first reduced-coordinate cut of the length gauge.

Here is the caller graph for this function:

◆ length_cut2()

double elecstate::TDFieldManager::length_cut2 ( ) const

Return the second reduced-coordinate cut of the length gauge.

Here is the caller graph for this function:

◆ prepare_interval()

void elecstate::TDFieldManager::prepare_interval ( const int left_step,
const int sample_step )

Prepare consecutive endpoints, with sample_step=left_step+1. Repeating the same interval and sample is idempotent. Propagation A is the endpoint average, not an exact midpoint sample.

Here is the call graph for this function:

◆ prepare_sample()

void elecstate::TDFieldManager::prepare_sample ( const int step)

Sample the length gauge, or initialize A(0) and E(0) without advancing time.

Here is the call graph for this function:

◆ read_restart()

void elecstate::TDFieldManager::read_restart ( const std::string & file_dir)

Restore the electronic step and vector-potential state.

Parameters
file_dirDirectory containing Restart_td.txt.
Here is the call graph for this function:

◆ sample_field()

void elecstate::TDFieldManager::sample_field ( const int step)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ select_A_prop()

void elecstate::TDFieldManager::select_A_prop ( )
private
Here is the caller graph for this function:

◆ set_A_samples()

void elecstate::TDFieldManager::set_A_samples ( const std::vector< ModuleBase::Vector3< double > > & samples_ha)

Supply endpoint samples starting at t=0 before preparing any steps.

Here is the call graph for this function:

◆ subinterval()

TDFieldState elecstate::TDFieldManager::subinterval ( const TDFieldState & full,
int index,
int parts ) const

Evaluate interval [index/parts,(index+1)/parts] inside the prepared original step.

Here is the call graph for this function:

◆ substep_a()

ModuleBase::Vector3< double > elecstate::TDFieldManager::substep_a ( const TDFieldState & full,
int node,
int parts ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_restart()

void elecstate::TDFieldManager::write_restart ( const std::string & file_dir) const

Save three annotated data rows describing the interval state in Hartree units.

Here is the call graph for this function:

◆ create_td_field_manager

std::shared_ptr< TDFieldManager > create_td_field_manager ( const Input_para & input)
friend

Build all field profiles and convert user input to propagation units.

Parameters specific to a waveform are paired with td_ttype by occurrence, while td_vext_dire is paired by the overall field index.

Parameters
inputValidated ABACUS input parameters.
Returns
Shared manager used by the ESolver and time-dependent potential.

Member Data Documentation

◆ A_left_ha_

ModuleBase::Vector3<double> elecstate::TDFieldManager::A_left_ha_
private

◆ A_prop_ha_

ModuleBase::Vector3<double> elecstate::TDFieldManager::A_prop_ha_
private

◆ A_right_ha_

ModuleBase::Vector3<double> elecstate::TDFieldManager::A_right_ha_
private

◆ A_samples_ha_

std::vector<ModuleBase::Vector3<double> > elecstate::TDFieldManager::A_samples_ha_
private

◆ active_

bool elecstate::TDFieldManager::active_
private

◆ current_step_

int elecstate::TDFieldManager::current_step_
private

◆ dt_ha_

double elecstate::TDFieldManager::dt_ha_
private

◆ efield_ha_

ModuleBase::Vector3<double> elecstate::TDFieldManager::efield_ha_
private

◆ enabled_

bool elecstate::TDFieldManager::enabled_
private

◆ end_step_

int elecstate::TDFieldManager::end_step_
private

◆ field_vals_ha_

std::vector<double> elecstate::TDFieldManager::field_vals_ha_
private

◆ fields_

std::vector<TDField> elecstate::TDFieldManager::fields_
private

◆ gauge_

int elecstate::TDFieldManager::gauge_
private

◆ interval_dt_ha_

double elecstate::TDFieldManager::interval_dt_ha_
private

◆ interval_left_

int elecstate::TDFieldManager::interval_left_ = -1
private

◆ length_cut1_

double elecstate::TDFieldManager::length_cut1_
private

◆ length_cut2_

double elecstate::TDFieldManager::length_cut2_
private

◆ start_step_

int elecstate::TDFieldManager::start_step_
private

The documentation for this class was generated from the following files: