[MMTK] implementing new force field

Guido Wagner wagner at chemie.uni-frankfurt.de
Thu Nov 8 08:59:36 UTC 2007


Hi Oliver !

I implemented a force-field for MMTK (only 1. derivates until now).
I started defining a class called MyForcefield with the method 
"evaluatorTerms", that returns a list with the forcefield-terms. Here an 
example for a nonbonded term:

# NBL-Aufbau_Term   
           
        from MMTK_forcefield import NonbondedList,NonbondedListTerm
        nbl = NonbondedList(array([],Int),array([],Int), array([],Int), 
universe._spec,2.8) # 2.8 =cutoff
        nblUpdater = NonbondedListTerm(nbl)

        eval_list.append(nblUpdater)

      # Coulomb-Term
        from MOMO_Coulomb import CoulombTerm
        
eval_list.append(CoulombTerm(universe._spec,nbl,ICONMatrix,QSIG,QPI))

For the implementation of the individual term just look at the examples 
in the distribution. I took some code from nonbonded.c for the iteration 
over the nonbondet list. Your "evaluatorTerms" method has to enumerate 
all terms for your problem. MMTKs has handy functions to enumerate bonds 
etc.
Haveing done this you may use your force-field via the setForcefield 
Method of the universe class.


Regards,

Guido

Olivier Delaire schrieb:
> Dear MMTK users,
>
> I am trying to extend the force-fields implemented in MMTK to treat the 
> case of a crystal vibrating around its equilibrium configuration. The 
> type of force-field I want to implement would be an expansion of the 
> energy in terms of small displacements of nuclei from their equilibrium 
> sites (Taylor-type expansion).
> If I expand the energy up to 2nd order in the nuclear coordinates, then 
> I should get quadratic on-site terms corresponding to 'Einstein 
> ocsillators', and already implemented as one of the harmonicFF examples 
> in the distribution. Besides the on-site terms, one should also get the 
> cross-terms u_i x u_j , where u_i is the displacement amplitude for atom 
> i (here in 1D).
> Now, I would want to implement such a force-field up to higher orders 
> (say 3 or 4), and of course I would have to restrict the range of each 
> type of interaction in order not have so many free parameters.
>
> I have been looking in to the Python and C force-field classes, but 
> these are rather intimidating. Presently, it seems to me that the 
> nonbonded.c file could be extended to treat that kind of force-field, 
> but I am unsure wether assumptions in other places in the package will 
> break if I try to modify it... Also, I am not entirely sure wether I 
> should start with the 'bonded' or 'nonbonded' types of force fields.
>
> Does anyone have any experience in implementing new force-fields for 
> MMTK? Where should I start?
> Your help is greatly appreciated.
>
> Thanks,
> Olivier
>
>   




More information about the mmtk mailing list