# [gmx-developers] Question about MM point charges in QM/MM calculation

Gerrit Groenhof ggroenh at gwdg.de
Tue Feb 3 14:33:56 CET 2009

```So instead of looking into the QMMMnblists, you could simply scan over
all particles. If (!bQMMM[i]), add it to the MM array. This way you get
the whole box, but there could be problems with particles being in a
different periodic image that cannot be not shifted back correctly prior
to the QM call.

update_QMMMrec routine(3.3.x only):

if(QMMMlist_sr.nri){
qm_i_particles[0].shift = XYZ2IS(0,0,0);
for(i=0;i<QMMMlist_sr.nri;i++){
qm_i_particles[i].j     = QMMMlist_sr.iinr[i];
if(i){
qm_i_particles[i].shift = pbc_dx_aiuc(&pbc,x[QMMMlist_sr.iinr[0]],
x[QMMMlist_sr.iinr[i]],dx);

}

crd[0] = IS2X(QMMMlist_sr.shift[i]) + IS2X(qm_i_particles[i].shift);
crd[1] = IS2Y(QMMMlist_sr.shift[i]) + IS2Y(qm_i_particles[i].shift);
crd[2] = IS2Z(QMMMlist_sr.shift[i]) + IS2Z(qm_i_particles[i].shift);
is = XYZ2IS(crd[0],crd[1],crd[2]);
for(j=0;j<md->nr;j++){
if(!bQMMM[j]){
if(mm_nr >= mm_max){
mm_max += 1000;
srenew(mm_j_particles,mm_max);
}
mm_j_particles[mm_nr].j = QMMMlist_sr.jjnr[j];
mm_j_particles[mm_nr].shift = is;
mm_nr++;
}
}

Gerrit

Pia Toelle wrote:
> Thanks for the comment and your interest.
>
>
> I still would like to get informations about the MM-atom list
> (mm->xMM[i][..],mm->MMcharges[i]) and how I could change it, so that all
> MM atoms are included not considering the cut-off, because we would like
> to print out all (!) MM atoms (and their charges).
> Please tell me if a change of the (t_MMrec)-variable mm could cause
> problems for the MM-part of the routine or is  the (t_MMrec)-variable mm
> only used in the QM part.
> Or would it be possible to print out all MM atoms + charges at an other
> point in the program? Where?
>
>
> Pia Toelle
>
> BCCMS
> Uni Bremen
> Am Fallturm 1
> 28359 Bremen
> Germany
>
>
>
> Gerrit Groenhof wrote:
>
>> Hi,
>>
>> We did a gmx-dftb interface that used function calls from the linked
>> dftb librarysome time ago. That was in 3.3.3, but I never found the time
>> to pt it in 4. ALso I remember some compilation issues with the dftb
>> code on 64 bit machines. I can send you the code if you're interested.
>>
>> For QM/MM the MM atoms are indeed set with the cut-off options. Although
>> for dftb it is not very difficult, I have never found the time or need
>> to complete the ewald implementation.  To avoid duplications, I suggest
>> we finish the PME implementation for the DFTB code together. Contacting
>> me off-list  is probably more convenient if you are interested.
>>
>> BEst,
>>
>> Gerrit
>>
>>
>>
>>
>> On 30 Jan 2009, at 18:09, Pia Toelle wrote:
>>
>>
>>> Hello.
>>>
>>> I have got some questions concerning the MM-atom-list in a QM/MM
>>> calculation.
>>>
>>> We do QM-MM calculations using the Gaussian interface (gromacs-3.3.3),
>>> but modified the code to be able to use DFTB instead of Gaussian
>>> (www.dftb.org).
>>> Our (MM-)system is a SiO2-surface (with periodic boundary condition;
>>> full).
>>> We use PME and DO NOT (!) define proper charge groups for the surface
>>> structure, every atom forms its own charge group. Number of MM atoms
>>> ~1900.
>>> (The proper definition of charge groups in our system is not obvious or
>>> even impossible, as it is a solid and a periodic system)
>>>
>>> We noticed, that the MM system considered in the QM calculation does not
>>> consist of the entire MM system. The point charges
>>> (mm->xMM[i][..],mm->MMcharges[i]) that are written to input.com (by
>>> qm_gaussian.c) are only those of the MM atoms in the vicinity of the QM
>>> atoms. The list of MM atoms in the vicinity of the QM-zone is set (as
>>> far as we can see) using the neighbor-search algorithm depending also on
>>> the charge groups (in ns5_core.c). Please correct me if I am wrong at
>>> some point.
>>> Is it right, that the cut-off for the QM/MM - neighbor search is set by
>>> 'rcoulomb' in the mdp-file? Or 'rlist'?
>>>
>>> Anyhow, we would like to print out all (!) MM atoms (and their charges).
>>> How to solve this problem?
>>> Is there a simple way to put all MM atoms in the mm list? And please
>>> tell me if a change of the (t_MMrec)-variable mm could cause problems
>>> for the MM-part of the routine or is  the (t_MMrec)-variable mm only
>>> used in the QM part.
>>> Or would it be possible to print out all MM atoms + charges at an other
>>> point in the program? Where?
>>> I am grateful for any helpful information or idea.
>>>
>>>
>>>
>>> Pia Toelle
>>>
>>> BCCMS
>>> Uni Bremen
>>> Am Fallturm 1
>>> 28359 Bremen
>>> Germany
>>>
>>> _______________________________________________
>>> gmx-developers mailing list
>>> gmx-developers at gromacs.org
>>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>>> Please don't post (un)subscribe requests to the list. Use the
>>> www interface or send it to gmx-developers-request at gromacs.org.
>>>
>> --
>> Gerrit Groenhof
>> MPI biophysical chemistry
>> Goettingen
>> Germany
>> http://wwwuser.gwdg.de/~ggroenh/
>>
>> _______________________________________________
>> gmx-developers mailing list
>> gmx-developers at gromacs.org
>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>> Please don't post (un)subscribe requests to the list. Use thewww
>> interface or send it to gmx-developers-request at gromacs.org.
>>
>
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
>

```