DislocationSDVPN

Calculation class

class DislocationSDVPN(model=None, name=None, params=None, **kwargs)

Bases: iprPy.calculation.Calculation.Calculation

Class for managing semi-discrete variational Peierls-Nabarro calcuations

property alpha

Non-local correction term parameters

Type

list

property beta

Surface correction term parameter tensor

Type

numpy.NDArray

build_model()

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

calc_inputs()

Builds calculation inputs from the class’s attributes

cdcsquery(**kwargs)

Builds a CDCS-style query based on kwargs values for the record style.

Parameters

**kwargs (any) – Any extra query terms that are universal for all calculations or associated with one of the calculation’s subsets.

Returns

The CDCS-style query.

Return type

dict

property cdiffelastic

Flag if central difference is used for the elastic term

Type

bool

property cdiffstress

Flag if central difference is used for the stress term

Type

bool

property cdiffsurface

Flag if central difference is used for the surface term

Type

bool

property compare_fterms

The terms to compare metadata values using a tolerance.

Type

dict

property compare_terms

The terms to compare metadata values absolutely.

Type

list

property cutofflongrange

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

Type

float

property defect

Dislocation subset

property disregistries

The disregistry profiles for the solution after each minimization cycle

Type

list

property elastic

AtommanElasticConstants subset

property energies

The total energies for the solution after each minimization cycle

Type

list

property filenames

the names of each file used by the calculation.

Type

list

property fullstress

Flag for switching which stress term equation is used

Type

bool

property gamma

AtommanGammaSurface subset

isvalid()

Looks at the set atttributes 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, name=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, key=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='main', **kwargs)

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()

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

The number of minimization cycles to run

Type

int

property minimize_options

kwarg options to pass to scipy.minimize

Type

dict

property minimize_style

The scipy.minimize style to use

Type

str

property modelroot

The root element of the content

Type

str

mongoquery(**kwargs)

Builds a Mongo-style query based on kwargs values for the record style.

Parameters

**kwargs (any) – Any extra query terms that are universal for all calculations or associated with one of the calculation’s subsets.

Returns

The Mongo-style query.

Return type

dict

property multikeys

Calculation key sets that can have multiple values during prepare.

Type

list

property normalizedisreg

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

Type

bool

pandasfilter(dataframe, **kwargs)

Parses a pandas dataframe containing the subset’s metadata to find entries matching the terms and values given. Ideally, this should find the same matches as the mongoquery and cdcsquery methods for the same search parameters.

Parameters
  • dataframe (pandas.DataFrame) – The metadata dataframe to filter.

  • kwargs (any) – Any extra query terms that are universal for all calculations or associated with one of the calculation’s subsets.

Returns

True for each entry where all filter terms+values match, False for all other entries.

Return type

pandas.Series of bool

process_results(results_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

The dislocation solution object

Type

atomman.defect.SDVPN

set_values(name=None, **kwargs)

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

Calculation keys that can have single values during prepare.

Type

list

property system

AtommanSystemLoad subset

property tau

External stress tensor to apply to the system

Type

numpy.NDArray

property templatekeys

The calculation-specific input keys and their descriptions.

Type

dict

property units

Units subset

property xmax

The maximum x coordinate value

Type

float

property xnum

The number of x coordinate values

Type

int

property xscale

Flag if xstep/xmax values are absolute or scaled

Type

bool

property xstep

The step size between the x coordinate values

Type

float