From: Kenno Vanommeslaeghe (kvanomme_at_rx.umaryland.edu)
Date: Thu Aug 08 2013 - 11:16:59 CDT
Just for the less "technical" reader's reference, this patch fixes a
feature that is part of the CHARMM parameter format specification, but is
not used by any of the current CHARMM force fields as far as I know. So
users of the CHARMM force field are not affected. However, *other* force
fields may be affected when reading their parameters in CHARMM format.
On 08/08/2013 01:27 AM, Norman Geist wrote:
> Just a comment, to create an easy to use patch:
>
> diff -Naur standardcode newcode > patch.txt
>
> And to use the patch:
>
> patch –pl standardcode < patch.txt
>
> Regards
>
> Norman Geist.
>
> *Von:*owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] *Im
> Auftrag von *Sunhwan Jo
> *Gesendet:* Mittwoch, 7. August 2013 22:22
> *An:* namd-l_at_ks.uiuc.edu
> *Betreff:* namd-l: NBFIX 1-4 scaling term ignored for CHARMM format parameters
>
> Hi,
>
> I'd like to submit a patch in NAMD. I've sent a mail to namd_at_ks.uiuc.edu
> <mailto:namd_at_ks.uiuc.edu>, also sending this to here as well.
>
> I noticed NAMD ignores 1-4 scaling term in NBFIX when CHARMM format
> parameters is used. When CHARMM format parameters are used, NAMD expects
> only 2 terms (epsilon and r_min), whereas official CHARMM parameters can
> have extra 2 terms for 1-4 scaled vdW (epsilon1-4 and r_min1-4).
>
> I've confirmed this in the source code (src/Parameters.C), which just
> assign epsilon and r_min to epsilon1-4 and r_min1-4.
>
> I've attached necessary modification below.
>
> [quote]
>
> void Parameters::add_vdw_pair_param(char *buf)
> {
> char atom1name[11]; // Atom 1 name
> char atom2name[11]; // Atom 2 name
> Real A; // A value for pair
> Real B; // B value for pair
> Real A14; // A value for 1-4 ints
> Real B14; // B value for 1-4 ints
> Real sqrt26; // 2^(1/6)
> Real epsilon; // epsilon
> int read_count; // count from sscanf
> struct vdw_pair_params *new_node; // new node
>
> /* Parse up the input line using sscanf */
> if (paramType == paraXplor)
> {
> /* read XPLOR format */
> read_count=sscanf(buf, "%*s %s %s %f %f %f %f\n", atom1name,
> atom2name, &A, &B, &A14, &B14);
> }
> else if (paramType == paraCharmm)
> {
> // XXX CHARMM CAN HAVE 1-4 PARAMETERS TOO!!!
> /* read CHARMM format */
> read_count=sscanf(buf, "%s %s %f %f %f %f\n", atom1name,
> atom2name, &A, &B, &A14, &B14);
> }
>
> /* Check to make sure we got what we expected */
> if ((read_count != 6) && (paramType == paraXplor))
> {
> char err_msg[512];
>
> sprintf(err_msg, "BAD vdW PAIR FORMAT IN XPLOR PARAMETER
> FILE\nLINE=*%s*", buf);
> NAMD_die(err_msg);
> }
> if ( ((read_count != 6) && (read_count != 4)) && (paramType == paraCharmm))
> {
> char err_msg[512];
>
> sprintf(err_msg, "BAD vdW PAIR FORMAT IN CHARMM PARAMETER
> FILE\nLINE=*%s*", buf);
> NAMD_die(err_msg);
> }
>
> if (paramType == paraCharmm)
> {
> // convert CHARMM to XPLOR format
> epsilon=-A;
> sqrt26=pow(2.,(1./6.));
> B=B/sqrt26;
> A=4*epsilon*pow(B,12.);
> B=4*epsilon*pow(B,6.);
>
> if (read_count == 4)
> {
> A14=A;
> B14=B;
> }
> else
> {
> epsilon=-A14;
> sqrt26=pow(2.,(1./6.));
> B14=B14/sqrt26;
> A14=4*epsilon*pow(B14,12.);
> B14=4*epsilon*pow(B14,6.);
> }
> }
>
> /* Allocate a new node */
> new_node = new vdw_pair_params;
>
> if (new_node == NULL)
> {
> NAMD_die("memory allocation failed in Parameters::add_vdw_pair_param\n");
> }
>
> strcpy(new_node->atom1name, atom1name);
> strcpy(new_node->atom2name, atom2name);
>
> /* Assign values to this node */
> new_node->A = A;
> new_node->A14 = A14;
> new_node->B = B;
> new_node->B14 = B14;
>
> new_node->next = NULL;
>
> /* Add this node to the tree */
> add_to_vdw_pair_list(new_node);
>
> return;
> }
>
> [/quote]
>
>
> Best,
> Sunhwan
>
This archive was generated by hypermail 2.1.6 : Wed Dec 31 2014 - 23:21:30 CST