Relative path

../fullrmc/Examples/frames/

Description

Refer to atomicNiTi example.

Files

  1. system.pdb: The initial configuration input file.
  2. experimental.gr: The x-rays experimental pair distribution function data.
  3. experimental.fq: The x-rays experimental reduced structure factor data.
  4. run.py: The script file used to run the simulation.
  5. plot.py: The script file to plot the last saved engine state of PairDistributionConstraint and ReducedStructureFactorConstraint constraints data.

run.py explained

IMPORTING USEFUL DEFINITIONS:

All useful packages, modules and definitions are imported.

CREATE ENGINE:

Check if engine already saved on disk. In the affirmative load it to continue fitting from last saved configuration. Otherwise, build the engine and the needed constraints. In this particular example, ‘experimental.fq’ has no regular bins. Therefore, rebinning it needs to be rebinned using ‘fullrmc.Core.Collection.rebin’ function. Even though engine contains AtomicCoordinationNumberConstraint we decided to discard this constraint upon fitting by using set_used method and assigned ‘used’ flag to False.

DIFFERENT RUNS:

Define functions to run the fitting engine. All of the following functions finish running the engine using Engine.run method.

  1. run_normal: Set groups as atoms using set_groups_as_atoms. Here the engine runs traditional RMC with random selection of groups using RandomSelector and random atomic translations using TranslationGenerator move generator.
  2. run_swap: Set groups as atoms using set_groups_as_atoms. Create two swapping lists. The first one containing only all Nickel atoms indexes and the second only Titanium atoms indexes. Create two SwapPositionsGenerator for swapping Nickel atoms with Titanium and the other the opposite. Loop over all engine’s groups, check whether group’s atom is Nickel or Titanium and assign it respectively SwapPositionsGenerator to Titanium atoms and another SwapPositionsGenerator to Nickel atoms. Advanced users can change AtomicCoordinationNumberConstraint used flag to True and try playing with the given coordination number definition and improve the fit quality and the physical meaning of the final structure.

RUN no_constraints:

Rename default frame ‘0’ to ‘no_constraints’ then set atomic both coordination number and intermolecular distance constraints used flag to False. Then call run_normal and run_swap fitting routines.

RUN with_vdw:

Create new frame ‘with_vdw’ and set it as used. then set atomic coordination number used flag to False and intermolecular distance constraints used flag to True. Then call run_normal and run_swap fitting routines.

RUN all_constraints:

Create new frame ‘all_constraints’ and set it as used. then set both atomic coordination number and intermolecular distance constraints used flag to True. Then call run_normal and run_swap fitting routines.

PLOT PDF CONSTRAINT:

Plotting simultaneously all frames PairDistributionConstraint and ReducedStructureFactorConstraint data after fitting.

Table of Contents