Welcome To Support Community

Materials Studio

Advanced Search
Ask Search:
aysagaysag 

Can I use an edited forcefield in a perl script?

Hi,

I need to write a script to apply constant force on a set of molecules for Forcite Dynamics. I would like to use a previously edited forcefield which I saved as "Dreiding2". But I keep getting an error saying this: "Forcefield Library Manager: Can't find forcefield (Dreiding2) in Forcite.Dynamics".

Here is my script:

#!perl

use strict;
use Getopt::Long;
use MaterialsScript qw(:all);


my $doc = $Documents {"CNT_pristine_sys.xsd"};
my $forcite = Modules->Forcite;
my $dynamics = $forcite->Dynamics;

Modules->Forcite->ChangeSettings([Ensemble3D => "NVT",
                                  NumberOfSteps => 200000,
                                  TimeStep => 0.5,
                                  WriteForces => "Yes",
                                  EnergyDeviation => 5000000,
                                  CurrentForcefield => "Dreiding2",
                                  Thermostat =>"Berendsen",
                                  ChargeAssignment=>"Use current",
                                  ExternalForceSet => "ForceSet",
                                  ExternalForceStrength => 5,
                                  ExternalForceX => 0,
                                  ExternalForceY => 0,
                                  ExternalForceZ => 1,
                                  CounterExternalForce => "No",
                                  ]);
                                  
Modules->Forcite->Dynamics->Run($doc);


I also tried to write like this since CNT_pristine_sys.xsd file and Dreiding2.off are in the same folder:

CurrentForcefield => $Documents {"Dreiding2.off"},

This time error says: Value is invalid for property CurrentForcefield.

I would be really grateful if you could help me.
Thanks,
Aysa


 
Best Answer chosen by aysag
reinierreinier
Hi Aysa,

Just put a (forward) slash in front of it, like so:

CurrentForcefield => "/Dreiding2"

Best,
Reinier

All Answers

reinierreinier
Hi Aysa,

Just put a (forward) slash in front of it, like so:

CurrentForcefield => "/Dreiding2"

Best,
Reinier
This was selected as the best answer
aysagaysag

Hi reinier,

Thank you so much for your answer. I hope I won't take up too much of your time but I have two more questions: The value given as "external force strength" is the total force applied on the set or it is the force per molecule? The other one, my set contains water molecules and Na and Cl ions. Do I need to use a different function for ions?

Thanks in advance for your kind interest,
Aysa

reinierreinier
Hi Aysa,

ExternalForceStrength is the force, in kcal/mol/Å, acting on all atoms in the set. Typically the set contains a single molecule so I am not sure what you are trying to achieve. There is only support for one set.

Best,
Reinier
aysagaysag

My set contains 900 water molecules, 97 Na and 97 Cl ions. Is this script appropriate for this large set of molecules?

Thank you so much for your help,
Aysa

reinierreinier
Hi Aysa,

A typical application of the external force is to determine the diffusion coefficient of a given molecule. In this application a set containing a single molecule is created and an external force is applied to the set.

The system is then simulated using molecular dynamics. Once in equilibrium the tagged molecule will exhibit a systematic velocity in the direction of the force. The ratio of this drift velocity and the applied force strength (times kB T) is the diffusion coefficient.

I don’t think it makes sense (at least for the above application) to apply the force to more than one molecule, let alone all 1082 molecules.

Regards,
Reinier