DislocationSDVPN

Calculation class

class DislocationSDVPN(model: str | Path | IOBase | DataModelDict | None = None, name: str | None = None, database=None, params: str | Path | IOBase | dict = None, **kwargs: any)

Bases: Calculation

Class for managing semi-discrete variational Peierls-Nabarro calcuations

property alpha: list

Non-local correction term parameters

Type:

list

property beta: ndarray

Surface correction term parameter tensor

Type:

numpy.NDArray

build_model() DataModelDict

Generates and returns model content based on the values set to object.

calc_inputs() dict

Builds calculation inputs from the class’s attributes

property cdiffelastic: bool | None

Flag if central difference is used for the elastic term

Type:

bool

property cdiffstress: bool | None

Flag if central difference is used for the stress term

Type:

bool

property cdiffsurface: bool | None

Flag if central difference is used for the surface term

Type:

bool

property compare_fterms: dict

The terms to compare metadata values using a tolerance.

Type:

dict

property compare_terms: list

The terms to compare metadata values absolutely.

Type:

list

property cutofflongrange: float

The cutoff to use for the long-range elastic energy term

Type:

float

property defect: Dislocation

Dislocation subset

property disregistries: list

The disregistry profiles for the solution after each minimization cycle

Type:

list

property elastic: AtommanElasticConstants

AtommanElasticConstants subset

property energies: list

The total energies for the solution after each minimization cycle

Type:

list

property filenames: list

the names of each file used by the calculation.

Type:

list

property fullstress: bool | None

Flag for switching which stress term equation is used

Type:

bool

property gamma: AtommanGammaSurface

AtommanGammaSurface subset

isvalid() bool

Looks at the set attributes to determine if the associated calculation would be a valid one to run.

Returns:

True if element combinations are valid, False if not.

Return type:

bool

load_model(model: str | DataModelDict, name: str | None = None)

Loads record contents from a given model.

Parameters:
  • model (str or DataModelDict) – The model contents of the record to load.

  • name (str, optional) – The name to assign to the record. Often inferred from other attributes if not given.

load_parameters(params: dict | str | IOBase, key: str | None = None)

Reads in and sets calculation parameters.

Parameters:
  • params (dict, str or file-like object) – The parameters or parameter file to read in.

  • key (str, optional) – A new key value to assign to the object. If not given, will use calc_key field in params if it exists, or leave the key value unchanged.

master_prepare_inputs(branch: str = 'main', **kwargs: any) dict

Utility method that build input parameters for prepare according to the workflows used by the NIST Interatomic Potentials Repository. In other words, transforms inputs from master_prepare into inputs for prepare.

Parameters:
  • branch (str, optional) – Indicates the workflow branch to prepare calculations for. Default value is ‘main’.

  • **kwargs (any) – Any parameter modifications to make to the standard workflow prepare scripts.

Returns:

params – The full set of prepare parameters based on the workflow branch

Return type:

dict

metadata() dict

Generates a dict of simple metadata values associated with the record. Useful for quickly comparing records and for building pandas.DataFrames for multiple records of the same style.

property minimize_cycles: int

The number of minimization cycles to run

Type:

int

property minimize_options: dict

kwarg options to pass to scipy.minimize

Type:

dict

property minimize_style: str

The scipy.minimize style to use

Type:

str

property modelroot: str

The root element of the content

Type:

str

property multikeys: list

Calculation key sets that can have multiple values during prepare.

Type:

list

property normalizedisreg: bool | None

Flag indicating if the total cumulative disregistry is normalized to the Burgers vector

Type:

bool

process_results(results_dict: dict)

Processes calculation results and saves them to the object’s results attributes.

Parameters:

results_dict (dict) – The dictionary returned by the calc() method.

property sdvpn_solution: SDVPN

The dislocation solution object

Type:

atomman.defect.SDVPN

set_values(name: str | None = None, **kwargs: any)

Set calculation values directly. Any terms not given will be set or reset to the calculation’s default values.

Parameters:
  • name (str, optional) – The name to assign to the calculation. By default, this is set as the calculation’s key.

  • xnum (int, optional) – The number of x coordinates to use.

  • xmax (flaot, optional) – The maximum x coordinate to use.

  • xstep (float, optional) – The step size to use between the x coordinates.

  • xscale (bool, optional) – Flag indicating if xmax and/or xstep values are to be taken as absolute or relative to ucell’s a lattice parameter.

  • minimize_style (str, optional) – The scipy.minimize style to use.

  • minimize_options (dict, optional) – kwarg options to pass to scipy.minimize.

  • minimize_cycles (int, optional) – The number of mimimization cycles to perform.

  • cutofflongrange (float, optional) – The cutoff to use for the longrange energy term.

  • tau (array-like object, optional) – The applied stress values to use.

  • alpha (list, optional) – The non-local correction parameters to use.

  • beta (array-like object, optional) – The surface correction parameters to use.

  • cdiffelastic (bool, optional) – Flag if central difference is used for the elastic term.

  • cdiffsurface (bool, optional) – Flag if central difference is used for the surface term.

  • cdiffstress (bool, optional) – Flag if central difference is used for the stress term.

  • halfwidth (float, optional) – An initial arctan halfwidth guess.

  • normalizedisreg (bool, optional) – Flag indicating if the disregistry is normalized to the Burgers vector.

  • fullstress (bool, optional) – Flag that determines which stress term expression is used.

  • **kwargs (any, optional) – Any keyword parameters supported by the set_values() methods of the parent Calculation class and the subset classes.

property singularkeys: list

Calculation keys that can have single values during prepare.

Type:

list

property system: AtommanSystemLoad

AtommanSystemLoad subset

property tau: ndarray

External stress tensor to apply to the system

Type:

numpy.NDArray

property templatekeys: dict

The calculation-specific input keys and their descriptions.

Type:

dict

property units: Units

Units subset

property xmax: float

The maximum x coordinate value

Type:

float

property xnum: int

The number of x coordinate values

Type:

int

property xscale: bool | None

Flag if xstep/xmax values are absolute or scaled

Type:

bool

property xstep: float

The step size between the x coordinate values

Type:

float