disable default TranslationGenerator

37 views
Skip to first unread message

Robert Koch

unread,
Feb 24, 2020, 4:07:18 PM2/24/20
to fullrmc
Hi everyone,

If I wanted to just run fullrmc (at least at some point in the process) with only swapping of certain species, no translations, is there a way to disable the default TranslationGenerator assigned to each atom? using "set_refine(False) doesn't seem to work. I guess if I set the amplitude to close to zero, this could have the desired effect, but would create a lot of unnecessary small moves?

cheers,
Rob

Bachir Aoun

unread,
Feb 24, 2020, 4:13:07 PM2/24/20
to fullrmc
Robert,

you must set SwapPositionsGenerator for the groups that you want to swap. you need to check fullrmc provided examples and in particular atomicNiTi.

This is an exact copy from the example

def run_swap(nsteps, saveFrequency, engineFilePath):
    # activate coordination number. Play with definition and set_used to True
    ACN_CONSTRAINT.set_coordination_number_definition( [ ('ti','ti',2.5, 3.5, 4, 8),
                                                         ('ti','ni',2.2, 3.1, 6, 10),
                                                         ('ni','ni',2.5, 3.5, 4, 8),
                                                         ('ni','ti',2.2, 3.1, 6, 10) ] )
    ACN_CONSTRAINT.set_used(False)
    # reset groups
    ENGINE.set_groups_as_atoms()
    #### set swap generators Ni-->Ti and Ti-->Ni ###
    allElements = ENGINE.allElements
    niSwapList = [[idx] for idx in range(len(allElements)) if allElements[idx]=='ni']
    tiSwapList = [[idx] for idx in range(len(allElements)) if allElements[idx]=='ti']
    # create swap generator
    toNiSG = SwapPositionsGenerator(swapList=niSwapList)
    toTiSG = SwapPositionsGenerator(swapList=tiSwapList)
    # set swap generator to groups
    for g in ENGINE.groups:
        if allElements[g.indexes[0]]=='ni':
            g.set_move_generator(toTiSG)
        elif allElements[g.indexes[0]]=='ti':
            g.set_move_generator(toNiSG)
    # run
    ENGINE.run(numberOfSteps=nsteps, saveFrequency=saveFrequency)


Robert Koch

unread,
Feb 24, 2020, 4:38:54 PM2/24/20
to fullrmc
Hi Bachir,

Thanks! This mirrors what I've implemented, but consider the case where we only want to swap a subet of the elements, like this case:

The last line in that example states "# the rest are oxygen atoms. Default RandomTranslation generator are kept."

Is there any way to turn off these "Default RandomTranslations" for, say oxygen or any other elements not involved in swapping?

thanks!
Rob

Bachir Aoun

unread,
Feb 24, 2020, 6:06:22 PM2/24/20
to fullrmc
Robert,

Moves are performed upon groups. You must define the groups you need and set the move generator upon those. By default, when you set your engine pdb file, fullrmc automatically creates atomic groups for you using all atoms. All what you need todo now is to reset the groups to the atoms you need and set the moves generators accordingly


Robert Koch

unread,
Feb 24, 2020, 9:59:51 PM2/24/20
to fullrmc
Hi Bachir,

Thanks, this was helpful! 

The issue is that "ENGINE.set_groups_as_atoms()" adds all the atoms as groups, and gives them a translation generator. If we omit this line, then add atoms as groups manually, specifically based on chemical symbol matching, everything runs fine, no atoms translate and we only swap the atoms we intended to.

Thanks!
Rob
Reply all
Reply to author
Forward
0 new messages