NAMD
Macros | Functions
Molecule.C File Reference
#include "largefiles.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <filesystem>
#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 2686 of file Molecule.C.

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

◆ getLCPOTypeCharmm()

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

Definition at line 2787 of file Molecule.C.

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

◆ sizeColumn()

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

Definition at line 3298 of file Molecule.C.

Referenced by Molecule::build_molecule().

3299 {
3300  return v1.size() > v2.size();
3301 }