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 "ObjectArena.h"
#include "Parameters.h"
#include "PDB.h"
#include "SimParameters.h"
#include "Hydrogen.h"
#include "UniqueSetIter.h"
#include "parm.h"
#include "ReadAmberParm.h"
#include "ConfigList.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>
#include "NamdEventsProfiling.h"

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)
 
int sizeColumn (const vector< int > &v1, const vector< int > &v2)
 

Macro Definition Documentation

◆ GROMACS_EXCLUSIONS

#define GROMACS_EXCLUSIONS   1

Definition at line 69 of file Molecule.C.

◆ GROMACS_PAIR

#define GROMACS_PAIR   1

Definition at line 65 of file Molecule.C.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 61 of file Molecule.C.

◆ MIN_DEBUG_LEVEL

#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 49 of file Molecule.C.

Function Documentation

◆ getLCPOTypeAmber()

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

Definition at line 2674 of file Molecule.C.

2674  {
2675 
2676  //Hydrogen
2677  if (atomType[0] == 'H' || atomType[0] == 'h') {
2678  return 0;
2679 
2680  //Carbon
2681  } else if (atomType[0] == 'C' || atomType[0] == 'c') {
2682  if (//Sp3 Carbon
2683  //atomType[1] == 'T')// ||
2684  strcmp(atomType, "CT" )==0 )
2685  //strcmp(atomType, "CP1" )==0 ||
2686  //strcmp(atomType, "CP2" )==0 ||
2687  //strcmp(atomType, "CP3" )==0 ||
2688  //strcmp(atomType, "CS" )==0 )
2689  {
2690  if (numBonds == 1)
2691  return 1;
2692  else if (numBonds == 2)
2693  return 2;
2694  else if (numBonds == 3)
2695  return 3;
2696  else if (numBonds == 4)
2697  return 4;
2698  else
2699  return 1;
2700 
2701  } else {//Sp2 or other
2702  if (numBonds == 2)
2703  return 5;
2704  else if (numBonds == 3)
2705  return 6;
2706  else
2707  return 1;
2708  }
2709 
2710  //Nitrogen
2711  } else if (atomType[0] == 'N' || atomType[0] == 'n') {
2712  if ( strcmp(atomType, "N3" ) == 0 ) { //Sp3 Nitrogen
2713  if (numBonds == 1)
2714  return 11;
2715  else if (numBonds == 2)
2716  return 12;
2717  else if (numBonds == 3)
2718  return 13;
2719  else
2720  return 11;
2721 
2722  } else {//SP2 Nitrogen
2723  if (numBonds == 1)
2724  return 14;
2725  else if (numBonds == 2)
2726  return 15;
2727  else if (numBonds == 3)
2728  return 16;
2729  else
2730  return 11;
2731  }
2732 
2733  //Oxygen
2734  } else if (atomType[0] == 'O' || atomType[0] == 'o') {
2735 
2736  if ( strcmp(atomType, "O" )==0) {//Sp2 Oxygen
2737  return 9;
2738  } else if (strcmp(atomType, "O2" )==0) {//Carboxylate Oxygen
2739  return 10;
2740  } else { // Sp3 Oxygen
2741  if (numBonds == 1)
2742  return 7;
2743  else if (numBonds == 2)
2744  return 8;
2745  else
2746  return 7;
2747  }
2748 
2749  //Sulfur
2750  } else if (atomType[0] == 'S' || atomType[0] == 's') {
2751  if ( strcmp(atomType, "SH" )==0) { //Sulfur 1 neighbor
2752  return 17;
2753  } else {
2754  return 18;
2755  }
2756 
2757  //Phosphorus
2758  } else if (atomType[0] == 'P' || atomType[0] == 'p') {
2759  if (numBonds == 3)
2760  return 19;
2761  else if (numBonds == 4)
2762  return 20;
2763  else
2764  return 19;
2765  } else if (atomType[0] == 'Z') { // ? just to agree with Amber mdread.f
2766  return 0;
2767  } else if ( strcmp(atomType, "MG" )==0) { //Mg
2768  return 22;
2769  } else { // unknown atom type
2770  return 5;
2771  }
2772  return 5;
2773 } // getLCPOTypeAmber

◆ getLCPOTypeCharmm()

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

Definition at line 2775 of file Molecule.C.

2775  {
2776 
2777  //Hydrogen
2778  if (atomType[0] == 'H') {
2779  return 0;
2780 
2781  //Carbon
2782  } else if (atomType[0] == 'C') {
2783  if (//Sp3 Carbon
2784  atomType[1] == 'T' ||
2785  strcmp(atomType, "CP1" )==0 ||
2786  strcmp(atomType, "CP2" )==0 ||
2787  strcmp(atomType, "CP3" )==0 ||
2788  strcmp(atomType, "CS" )==0 ) {
2789  if (numBonds == 1)
2790  return 1;
2791  else if (numBonds == 2)
2792  return 2;
2793  else if (numBonds == 3)
2794  return 3;
2795  else if (numBonds == 4)
2796  return 4;
2797  else
2798  return 1;
2799 
2800  } else if (//Sp2
2801  strcmp(atomType, "C" )==0 ||
2802  strcmp(atomType, "CA" )==0 ||
2803  strcmp(atomType, "CC" )==0 ||
2804  strcmp(atomType, "CD" )==0 ||
2805  strcmp(atomType, "CN" )==0 ||
2806  strcmp(atomType, "CY" )==0 ||
2807  strcmp(atomType, "C3" )==0 ||
2808  strcmp(atomType, "CE1" )==0 ||
2809  strcmp(atomType, "CE2" )==0 ||
2810  strcmp(atomType, "CST" )==0 ||
2811  strcmp(atomType, "CAP" )==0 ||
2812  strcmp(atomType, "COA" )==0 ||
2813  strcmp(atomType, "CPT" )==0 ||
2814  strcmp(atomType, "CPH1")==0 ||
2815  strcmp(atomType, "CPH2")==0
2816  ) {
2817  if (numBonds == 2)
2818  return 5;
2819  else if (numBonds == 3)
2820  return 6;
2821  else
2822  return 1;
2823  } else { // other Carbon
2824  return 1;
2825  }
2826 
2827  //Nitrogen
2828  } else if (atomType[0] == 'N') {
2829  if (//Sp3 Nitrogen
2830  //strcmp(atomType, "N" )==0 ||
2831  //strcmp(atomType, "NH1" )==0 ||
2832  //strcmp(atomType, "NH2" )==0 ||
2833  strcmp(atomType, "NH3" )==0 ||
2834  //strcmp(atomType, "NC2" )==0 ||
2835  //strcmp(atomType, "NY" )==0 ||
2836  strcmp(atomType, "NP" )==0
2837  ) {
2838  if (numBonds == 1)
2839  return 11;
2840  else if (numBonds == 2)
2841  return 12;
2842  else if (numBonds == 3)
2843  return 13;
2844  else
2845  return 11;
2846 
2847  } else if (//SP2 Nitrogen
2848  strcmp(atomType, "NY" )==0 || //
2849  strcmp(atomType, "NC2" )==0 || //
2850  strcmp(atomType, "N" )==0 || //
2851  strcmp(atomType, "NH1" )==0 || //
2852  strcmp(atomType, "NH2" )==0 || //
2853  strcmp(atomType, "NR1" )==0 ||
2854  strcmp(atomType, "NR2" )==0 ||
2855  strcmp(atomType, "NR3" )==0 ||
2856  strcmp(atomType, "NPH" )==0 ||
2857  strcmp(atomType, "NC" )==0
2858  ) {
2859  if (numBonds == 1)
2860  return 14;
2861  else if (numBonds == 2)
2862  return 15;
2863  else if (numBonds == 3)
2864  return 16;
2865  else
2866  return 11;
2867  } else { // other Nitrogen
2868  return 11;
2869  }
2870 
2871  //Oxygen
2872  } else if (atomType[0] == 'O') {
2873  if (//Sp3 Oxygen
2874  strcmp(atomType, "OH1" )==0 ||
2875  strcmp(atomType, "OS" )==0 ||
2876  strcmp(atomType, "OC" )==0 || //
2877  strcmp(atomType, "OT" )==0
2878  ) {
2879  if (numBonds == 1)
2880  return 7;
2881  else if (numBonds == 2)
2882  return 8;
2883  else
2884  return 7;
2885  } else if ( // Sp2 Oxygen
2886  strcmp(atomType, "O" )==0 ||
2887  strcmp(atomType, "OB" )==0 ||
2888  strcmp(atomType, "OST" )==0 ||
2889  strcmp(atomType, "OCA" )==0 ||
2890  strcmp(atomType, "OM" )==0
2891  ) {
2892  return 9;
2893  } else if ( // SP1 Oxygen
2894  strcmp(atomType, "OC" )==0
2895  ) {
2896  return 10;
2897  } else { // other Oxygen
2898  return 7;
2899  }
2900 
2901  //Sulfur
2902  } else if (atomType[0] == 'S') {
2903  if (numBonds == 1)
2904  return 17;
2905  else
2906  return 18;
2907 
2908  //Phosphorus
2909  } else if (atomType[0] == 'P') {
2910  if (numBonds == 3)
2911  return 19;
2912  else if (numBonds == 4)
2913  return 20;
2914  else
2915  return 19;
2916  } else { // unknown atom type
2917  return 5;
2918  }
2919  return 5;
2920 } // getLCPOTypeCharmm

◆ sizeColumn()

int sizeColumn ( const vector< int > &  v1,
const vector< int > &  v2 
)

Definition at line 3286 of file Molecule.C.

Referenced by Molecule::build_molecule().

3287 {
3288  return v1.size() > v2.size();
3289 }