[DFTB-Plus-User] Lattice vectors initialization

Ben Hourahine benjamin.hourahine at strath.ac.uk
Wed Nov 12 19:03:06 CET 2014


Hello Riccardo,

I'll reply properly off list, but would be happy to help you resolve the
interface problems. Are you planning to make the modifications available
afterwards?

Regards

Ben

On 12/11/14 16:15, Riccardo Petraglia wrote:
> Hello everybody,
> 
> I am trying to implement an interface between I-Pi
> (http://arxiv.org/abs/1402.1045, https://github.com/i-pi/i-pi) and DFTB+
> in order to use DFTB+ with enhanced MD methods.
> 
> The interface needs to add a way to insert atom positions and lattice
> vectors directly inside the code (without the needing of writing an
> input on a file) and reading the forces and stress tensor .
> 
> I am inserting the positions and lattice vectors just after the
> "lpGeomOpt" loop and reading the forces just before the first check on
> the result of the geometry optimization.
> 
> Everithing works fine if the lattice vectors inserted by my modification
> are the same (or really close: <2A) to the lattice vectors specified in
> the gen file. When the lattice vectors I insert are different from the
> lattice vectors specified in the gen file the SCC iteration never converge.
> 
> I understand it is kind of impossible debbugging a code by mail... That
> is not my purpose. I would like to know if the lattice vectors are used
> to initiliaze something before the "injection point" I chosen (taking
> into account that I am trying to spread the new values with the lines
> following the injection). Another way to ask the question is: when using
> the barostat, the change in the lattice vectors how are spread to every
> subroutine? Is it normal that above a certain tolerance value, about 2A
> per side in a cubic box, the SCC is not able to converge anymore?
> 
> Here below the lines I inserted in the dftb+.F90 file with some lines
> that should be helpful in determining the point to determine the
> position in relation to the original code. I used the version of DFTB+
> 1.2.1.
> As attached the dftb_in.hsd and the geometry file.
> 
> 
>   ipi = .true.
> ### Injecting the coordinates and lattice vectors
> 
>   lpGeomOpt: do while ((iGeoStep <= nGeoSteps) .or. ipi)
> 
>      write(81,*) Coord0, latvec #debug
>      !ipi: Reading positions from ipi
>      if (ipi) then
>         call coordsFromSocket(natom, Coord0, latvec)         #sending
> the number of atom to the subroutine and asking for coordinate and
> latticevectors
>         recVec2p =
> latVec(:,:)                                             #copied from
> some other part of the DFTB+ code in order to spread the latVec to all
> the subroutines
>         call
> matinv(recVec2p)                                              #
>         recVec2p = reshape(recVec2p, (/3, 3/), order=(/2,
> 1/))             #
>         recVec = 2.0_dp * pi * recVec2p          #
>         volume = determinant33(latVec)          #
>         recVolume = determinant33(recVec)           #
>         if (tSCC) then          #
>            print*, 'updating lattice vectors in
> SCC'                       #
>            call updateLatVecs_SCC(latVec, recVec,
> volume)                  #
>            mCutoff = max(mCutoff,
> getSCCCutoff())                          #
>         end
> if                                                             #
>         if (tDispersion)
> then                                              #
>            print*, 'updating lattice vectors in dispersion
> modules'        #
>            call updateLatVecs(myDispersion, latVec, recVec, volume,
> &      #
> &specie0)                                                  #
>            mCutoff = max(mCutoff,
> getRCutoff(myDispersion))                #
>         end
> if                                                             #
>      end if           #
> 
> 
> 
> ### Reading forces and strees tensor
> 
>      if (ipi) then
>         print*, 'Sending Forces to the socket'
>         call forcesToSocket(natom, energy%ETotal, -1*totalDeriv,
> totalStress)
>         cycle lpGeomOpt
>      end if
> 
>       !! If geometry minimizer finished and the last calculated geometry
> is the
>       !! minimal one (not necessary the case, depends on the optimizer!)
>       !! -> we are finished.
>       !! Otherwise we have to recalc everything in the converged geometry.
> 
> 
> _______________________________________________
> DFTB-Plus-User mailing list
> DFTB-Plus-User at mailman.zfn.uni-bremen.de
> https://mailman.zfn.uni-bremen.de/cgi-bin/mailman/listinfo/dftb-plus-user
> 

-- 
      Dr. B. Hourahine, SUPA, Department of Physics,
    University of Strathclyde, John Anderson Building,
            107 Rottenrow, Glasgow G4 0NG, UK.
    +44 141 548 2325, benjamin.hourahine at strath.ac.uk

2013/4 THE Awards Entrepreneurial University of the Year
      2012/13 THE Awards UK University of the Year

   The University of Strathclyde is a charitable body,
        registered in Scotland, number SC015263


More information about the DFTB-Plus-User mailing list