NAMD
Macros | Functions
Molecule.C File Reference
#include "largefiles.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "InfoStream.h"
#include "Molecule.h"
#include "strlib.h"
#include "MStream.h"
#include "Communicate.h"
#include "Node.h"
#include "ObjectArena.h"
#include "Parameters.h"
#include "PDB.h"
#include "SimParameters.h"
#include "Hydrogen.h"
#include "UniqueSetIter.h"
#include "charm++.h"
#include "ComputeGridForce.h"
#include "GridForceGrid.h"
#include "MGridforceParams.h"
#include "Debug.h"
#include "CompressPsf.h"
#include "ParallelIOMgr.h"
#include <deque>
#include <algorithm>

Go to the source code of this file.

Macros

#define MIN_DEBUG_LEVEL   3
 
#define M_PI   3.14159265358979323846
 
#define GROMACS_PAIR   1
 
#define GROMACS_EXCLUSIONS   1
 

Functions

int getLCPOTypeAmber (char atomType[11], int numBonds)
 
int getLCPOTypeCharmm (char atomType[11], int numBonds)
 

Macro Definition Documentation

#define GROMACS_EXCLUSIONS   1

Definition at line 64 of file Molecule.C.

#define GROMACS_PAIR   1

Definition at line 60 of file Molecule.C.

#define M_PI   3.14159265358979323846

Definition at line 56 of file Molecule.C.

#define MIN_DEBUG_LEVEL   3

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 46 of file Molecule.C.

Function Documentation

int getLCPOTypeAmber ( char  atomType[11],
int  numBonds 
)
inline

Definition at line 2640 of file Molecule.C.

2640  {
2641 
2642  //Hydrogen
2643  if (atomType[0] == 'H' || atomType[0] == 'h') {
2644  return 0;
2645 
2646  //Carbon
2647  } else if (atomType[0] == 'C' || atomType[0] == 'c') {
2648  if (//Sp3 Carbon
2649  //atomType[1] == 'T')// ||
2650  strcmp(atomType, "CT" )==0 )
2651  //strcmp(atomType, "CP1" )==0 ||
2652  //strcmp(atomType, "CP2" )==0 ||
2653  //strcmp(atomType, "CP3" )==0 ||
2654  //strcmp(atomType, "CS" )==0 )
2655  {
2656  if (numBonds == 1)
2657  return 1;
2658  else if (numBonds == 2)
2659  return 2;
2660  else if (numBonds == 3)
2661  return 3;
2662  else if (numBonds == 4)
2663  return 4;
2664  else
2665  return 1;
2666 
2667  } else {//Sp2 or other
2668  if (numBonds == 2)
2669  return 5;
2670  else if (numBonds == 3)
2671  return 6;
2672  else
2673  return 1;
2674  }
2675 
2676  //Nitrogen
2677  } else if (atomType[0] == 'N' || atomType[0] == 'n') {
2678  if ( strcmp(atomType, "N3" ) == 0 ) { //Sp3 Nitrogen
2679  if (numBonds == 1)
2680  return 11;
2681  else if (numBonds == 2)
2682  return 12;
2683  else if (numBonds == 3)
2684  return 13;
2685  else
2686  return 11;
2687 
2688  } else {//SP2 Nitrogen
2689  if (numBonds == 1)
2690  return 14;
2691  else if (numBonds == 2)
2692  return 15;
2693  else if (numBonds == 3)
2694  return 16;
2695  else
2696  return 11;
2697  }
2698 
2699  //Oxygen
2700  } else if (atomType[0] == 'O' || atomType[0] == 'o') {
2701 
2702  if ( strcmp(atomType, "O" )==0) {//Sp2 Oxygen
2703  return 9;
2704  } else if (strcmp(atomType, "O2" )==0) {//Carboxylate Oxygen
2705  return 10;
2706  } else { // Sp3 Oxygen
2707  if (numBonds == 1)
2708  return 7;
2709  else if (numBonds == 2)
2710  return 8;
2711  else
2712  return 7;
2713  }
2714 
2715  //Sulfur
2716  } else if (atomType[0] == 'S' || atomType[0] == 's') {
2717  if ( strcmp(atomType, "SH" )==0) { //Sulfur 1 neighbor
2718  return 17;
2719  } else {
2720  return 18;
2721  }
2722 
2723  //Phosphorus
2724  } else if (atomType[0] == 'P' || atomType[0] == 'p') {
2725  if (numBonds == 3)
2726  return 19;
2727  else if (numBonds == 4)
2728  return 20;
2729  else
2730  return 19;
2731  } else if (atomType[0] == 'Z') { // ? just to agree with Amber mdread.f
2732  return 0;
2733  } else if ( strcmp(atomType, "MG" )==0) { //Mg
2734  return 22;
2735  } else { // unknown atom type
2736  return 5;
2737  }
2738  return 5;
2739 } // getLCPOTypeAmber
int getLCPOTypeCharmm ( char  atomType[11],
int  numBonds 
)
inline

Definition at line 2741 of file Molecule.C.

2741  {
2742 
2743  //Hydrogen
2744  if (atomType[0] == 'H') {
2745  return 0;
2746 
2747  //Carbon
2748  } else if (atomType[0] == 'C') {
2749  if (//Sp3 Carbon
2750  atomType[1] == 'T' ||
2751  strcmp(atomType, "CP1" )==0 ||
2752  strcmp(atomType, "CP2" )==0 ||
2753  strcmp(atomType, "CP3" )==0 ||
2754  strcmp(atomType, "CS" )==0 ) {
2755  if (numBonds == 1)
2756  return 1;
2757  else if (numBonds == 2)
2758  return 2;
2759  else if (numBonds == 3)
2760  return 3;
2761  else if (numBonds == 4)
2762  return 4;
2763  else
2764  return 1;
2765 
2766  } else if (//Sp2
2767  strcmp(atomType, "C" )==0 ||
2768  strcmp(atomType, "CA" )==0 ||
2769  strcmp(atomType, "CC" )==0 ||
2770  strcmp(atomType, "CD" )==0 ||
2771  strcmp(atomType, "CN" )==0 ||
2772  strcmp(atomType, "CY" )==0 ||
2773  strcmp(atomType, "C3" )==0 ||
2774  strcmp(atomType, "CE1" )==0 ||
2775  strcmp(atomType, "CE2" )==0 ||
2776  strcmp(atomType, "CST" )==0 ||
2777  strcmp(atomType, "CAP" )==0 ||
2778  strcmp(atomType, "COA" )==0 ||
2779  strcmp(atomType, "CPT" )==0 ||
2780  strcmp(atomType, "CPH1")==0 ||
2781  strcmp(atomType, "CPH2")==0
2782  ) {
2783  if (numBonds == 2)
2784  return 5;
2785  else if (numBonds == 3)
2786  return 6;
2787  else
2788  return 1;
2789  } else { // other Carbon
2790  return 1;
2791  }
2792 
2793  //Nitrogen
2794  } else if (atomType[0] == 'N') {
2795  if (//Sp3 Nitrogen
2796  //strcmp(atomType, "N" )==0 ||
2797  //strcmp(atomType, "NH1" )==0 ||
2798  //strcmp(atomType, "NH2" )==0 ||
2799  strcmp(atomType, "NH3" )==0 ||
2800  //strcmp(atomType, "NC2" )==0 ||
2801  //strcmp(atomType, "NY" )==0 ||
2802  strcmp(atomType, "NP" )==0
2803  ) {
2804  if (numBonds == 1)
2805  return 11;
2806  else if (numBonds == 2)
2807  return 12;
2808  else if (numBonds == 3)
2809  return 13;
2810  else
2811  return 11;
2812 
2813  } else if (//SP2 Nitrogen
2814  strcmp(atomType, "NY" )==0 || //
2815  strcmp(atomType, "NC2" )==0 || //
2816  strcmp(atomType, "N" )==0 || //
2817  strcmp(atomType, "NH1" )==0 || //
2818  strcmp(atomType, "NH2" )==0 || //
2819  strcmp(atomType, "NR1" )==0 ||
2820  strcmp(atomType, "NR2" )==0 ||
2821  strcmp(atomType, "NR3" )==0 ||
2822  strcmp(atomType, "NPH" )==0 ||
2823  strcmp(atomType, "NC" )==0
2824  ) {
2825  if (numBonds == 1)
2826  return 14;
2827  else if (numBonds == 2)
2828  return 15;
2829  else if (numBonds == 3)
2830  return 16;
2831  else
2832  return 11;
2833  } else { // other Nitrogen
2834  return 11;
2835  }
2836 
2837  //Oxygen
2838  } else if (atomType[0] == 'O') {
2839  if (//Sp3 Oxygen
2840  strcmp(atomType, "OH1" )==0 ||
2841  strcmp(atomType, "OS" )==0 ||
2842  strcmp(atomType, "OC" )==0 || //
2843  strcmp(atomType, "OT" )==0
2844  ) {
2845  if (numBonds == 1)
2846  return 7;
2847  else if (numBonds == 2)
2848  return 8;
2849  else
2850  return 7;
2851  } else if ( // Sp2 Oxygen
2852  strcmp(atomType, "O" )==0 ||
2853  strcmp(atomType, "OB" )==0 ||
2854  strcmp(atomType, "OST" )==0 ||
2855  strcmp(atomType, "OCA" )==0 ||
2856  strcmp(atomType, "OM" )==0
2857  ) {
2858  return 9;
2859  } else if ( // SP1 Oxygen
2860  strcmp(atomType, "OC" )==0
2861  ) {
2862  return 10;
2863  } else { // other Oxygen
2864  return 7;
2865  }
2866 
2867  //Sulfur
2868  } else if (atomType[0] == 'S') {
2869  if (numBonds == 1)
2870  return 17;
2871  else
2872  return 18;
2873 
2874  //Phosphorus
2875  } else if (atomType[0] == 'P') {
2876  if (numBonds == 3)
2877  return 19;
2878  else if (numBonds == 4)
2879  return 20;
2880  else
2881  return 19;
2882  } else { // unknown atom type
2883  return 5;
2884  }
2885  return 5;
2886 } // getLCPOTypeCharmm