[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ESPResSo-users] Applying an External Field

From: Kai Szuttor
Subject: Re: [ESPResSo-users] Applying an External Field
Date: Tue, 22 Dec 2015 23:55:34 +0100
User-agent: Mutt/1.5.23 (2014-03-12)


so maybe I misunderstood what you want to do.
If your force just depends on the x position you can just have to write
an tcl interface for the parameters and then you can add the respective
force in espresso/src/core/external_potential.cpp in the function "void
add_external_potential_forces(Particle* p)". 
So there are two possible ways:
  - construct an external potential an write it to a file in an Espresso
    compatible format
  - implement what you need as I suggested above.
Option 1 may be slower but more easy if you are not that familiar with the
Espresso core. 


On Mon, Dec 21, 2015 at 07:09:10PM -0600, Salvador H-V wrote:
>    Hi,
>    I took a look to your files but I don get it how to apply to my potential.
>    I just to want to modify the force in x-direction.A The potential is "not"
>    pairwise potential, but 1-body forceA which acts on each atom.
>    I still do not understand why is not possible to extract the force during
>    the run simulation, add the contribution of the external field and update
>    the forces.
>    I tried with something like this, but is not working:
>    set fx [lindex [part $k print f ] 0]
>    set xif [lindex [part $k print folded_position ] 0]
>    # Calculate the external force
>    set fext [expr {2.0*$mypi*$Vo*cos(2.0*$mypi*$xif/$al)/$al}]
>    # Update the force in x-direction
>    set fx_new [expr {$fx - $fext}]
>    part $k f $fx_new $fy $fz
>    Or do you think I should modify the forces.cpp file?
>    Thanks a lot
>    SalvadorA 

Attachment: pgpzxAFkZFdPo.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]