⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 atominfo.cc

📁 大型并行量子化学软件;支持密度泛函(DFT)。可以进行各种量子化学计算。支持CHARMM并行计算。非常具有应用价值。
💻 CC
📖 第 1 页 / 共 2 页
字号:
//// molinfo.cc//// Copyright (C) 1996 Limit Point Systems, Inc.//// Author: Curtis Janssen <cljanss@limitpt.com>// Maintainer: LPS//// This file is part of the SC Toolkit.//// The SC Toolkit is free software; you can redistribute it and/or modify// it under the terms of the GNU Library General Public License as published by// the Free Software Foundation; either version 2, or (at your option)// any later version.//// The SC Toolkit is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU Library General Public License for more details.//// You should have received a copy of the GNU Library General Public License// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.//// The U.S. Government is granted a limited license as per AL 91-7.//#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <sys/stat.h>#include <util/misc/units.h>#include <util/misc/formio.h>#include <util/state/stateio.h>#include <util/group/message.h>#include <chemistry/molecule/atominfo.h>using namespace std;using namespace sc;////////////////////////////////////////////////////////////////////////// AtomInfostruct AtomInfo::atomnameAtomInfo::names_[MaxZ] =   {{"",           ""}, // 0   {"hydrogen",   "H"}, // 1   {"helium",     "He"}, // 2   {"lithium",    "Li"}, // 3   {"beryllium",  "Be"}, // 4   {"boron",      "B"}, // 5   {"carbon",     "C"}, // 6   {"nitrogen",   "N"}, // 7   {"oxygen",     "O"}, // 8   {"fluorine",   "F"}, // 9   {"neon",       "Ne"}, // 10   {"sodium",     "Na"}, // 11   {"magnesium",  "Mg"}, // 12   {"aluminum",   "Al"}, // 13   {"silicon",    "Si"}, // 14   {"phosphorus" ,"P"}, // 15   {"sulfur",     "S"}, // 16   {"chlorine",   "Cl"}, // 17   {"argon",      "Ar"}, // 18   {"potassium",  "K"}, // 19   {"calcium",    "Ca"}, // 20   {"scandium",   "Sc"}, // 21   {"titanium",   "Ti"}, // 22   {"vanadium",   "V"}, // 23   {"chromium",   "Cr"}, // 24   {"manganese",  "Mn"}, // 25   {"iron",       "Fe"}, // 26   {"cobalt",     "Co"}, // 27   {"nickel",     "Ni"}, // 28   {"copper",     "Cu"}, // 29   {"zinc",       "Zn"}, // 30   {"gallium",    "Ga"}, // 31   {"germanium",  "Ge"}, // 32   {"arsenic",    "As"}, // 33   {"selenium",   "Se"}, // 34   {"bromine",    "Br"}, // 35   {"krypton",    "Kr"}, // 36   {"rubidium",     "Rb"}, // 37   {"strontium",    "Sr"}, // 38   {"yttrium",      "Y"}, // 39   {"zirconium",    "Zr"}, // 40   {"niobium",      "Nb"}, // 41   {"molybdenum",   "Mo"}, // 42   {"technetium",   "Tc"}, // 43   {"ruthenium",    "Ru"}, // 44   {"rhodium",      "Rh"}, // 45   {"palladium",    "Pd"}, // 46   {"silver",       "Ag"}, // 47   {"cadminium",    "Cd"}, // 48   {"indium",       "In"}, // 49   {"tin",          "Sn"}, // 50   {"antimony",     "Sb"}, // 51   {"tellurium",    "Te"}, // 52   {"iodine",       "I"}, // 53   {"xenon",        "Xe"}, // 54   {"cesium",       "Cs"}, // 55   {"barium",       "Ba"}, // 56   {"lanthanium",   "La"}, // 57   {"cerium",       "Ce"}, // 58   {"praseodymium", "Pr"}, // 59   {"neodymium",    "Nd"}, // 60   {"promethium",   "Pm"}, // 61   {"samarium",     "Sm"}, // 62   {"europium",     "Eu"}, // 63   {"gadolinium",   "Gd"}, // 64   {"terbium",      "Tb"}, // 65   {"dysprosium",   "Dy"}, // 66   {"holmium",      "Ho"}, // 67   {"erbium",       "Er"}, // 68   {"thulium",      "Tm"}, // 69   {"ytterbium",    "Yb"}, // 70   {"lutetium",     "Lu"}, // 71   {"hafnium",      "Hf"}, // 72   {"tantalum",     "Ta"}, // 73   {"tungsten",     "W"}, // 74   {"rhenium",      "Re"}, // 75   {"osmium",       "Os"}, // 76   {"iridium",      "Ir"}, // 77   {"platinum",     "Pt"}, // 78   {"gold",         "Au"}, // 79   {"mercury",      "Hg"}, // 80   {"thallium",     "Tl"}, // 81   {"lead",         "Pb"}, // 82   {"bismuth",      "Bi"}, // 83   {"polonium",     "Po"}, // 84   {"astatine",     "At"}, // 85   {"radon",        "Rn"}, // 86   {"francium",     "Fr"}, // 87   {"radium",       "Ra"}, // 88   {"actinium",     "Ac"}, // 89   {"thorium",      "Th"}, // 90   {"protactinium", "Pa"}, // 91   {"uranium",      "U"}, // 92   {"neptunium",    "Np"}, // 93   {"plutonium",    "Pu"}, // 94   {"americium",    "Am"}, // 95   {"curium",       "Cm"}, // 96   {"berkelium",    "Bk"}, // 97   {"californium",  "Cf"}, // 98   {"einsteinum",   "Es"}, // 99   {"fermium",      "Fm"}, // 100   {"mendelevium",  "Md"}, // 101   {"nobelium",     "No"}, // 102   {"lawrencium",   "Lr"}, // 103   {"rutherfordium","Rf"}, // 104   {"hahnium",      "Ha"}, // 105   {"Unnamed",      "Un"}, // 106   {"Unnamed",      "Un"} // 107  };static ClassDesc AtomInfo_cd(  typeid(AtomInfo),"AtomInfo",3,"public SavableState",  0, create<AtomInfo>, create<AtomInfo>);AtomInfo::AtomInfo(){  overridden_values_ = 0;  load_library_values();}AtomInfo::AtomInfo(const Ref<KeyVal>& keyval){  overridden_values_ = 0;  load_library_values();  override_library_values(keyval);}AtomInfo::AtomInfo(StateIn& s):  SavableState(s){  if (s.node_to_node()) {      s.get_array_double(mass_,MaxZ);      s.get_array_double(atomic_radius_,MaxZ);      s.get_array_double(vdw_radius_,MaxZ);      s.get_array_double(bragg_radius_,MaxZ);      s.get_array_double(maxprob_radius_,MaxZ);      for (int i=0; i<MaxZ; i++) s.get_array_double(rgb_[i],3);      s.getstring(overridden_values_);      if (s.version(::class_desc<AtomInfo>()) >= 3) {          s.get_array_double(ip_,MaxZ);        }    }  else {      overridden_values_ = 0;      load_library_values();      char *overrides;      s.getstring(overrides);      if (overrides) {          Ref<ParsedKeyVal> keyval = new ParsedKeyVal;          keyval->parse_string(overrides);          override_library_values(keyval.pointer());          delete[] overrides;        }    }  if (s.version(::class_desc<AtomInfo>()) < 2) {      atomic_radius_scale_ = 1.0;      vdw_radius_scale_ = 1.0;      bragg_radius_scale_ = 1.0;      maxprob_radius_scale_ = 1.0;    }  else {      s.get(atomic_radius_scale_);      s.get(vdw_radius_scale_);      s.get(bragg_radius_scale_);      s.get(maxprob_radius_scale_);    }}AtomInfo::~AtomInfo(){  delete[] overridden_values_;}voidAtomInfo::save_data_state(StateOut& s){  if (s.node_to_node()) {      s.put_array_double(mass_,MaxZ);      s.put_array_double(atomic_radius_,MaxZ);      s.put_array_double(vdw_radius_,MaxZ);      s.put_array_double(bragg_radius_,MaxZ);      s.put_array_double(maxprob_radius_,MaxZ);      for (int i=0; i<MaxZ; i++) s.put_array_double(rgb_[i],3);      s.put_array_double(ip_,MaxZ);      s.putstring(overridden_values_);    }  else {      s.putstring(overridden_values_);    }  s.put(atomic_radius_scale_);  s.put(vdw_radius_scale_);  s.put(bragg_radius_scale_);  s.put(maxprob_radius_scale_);}voidAtomInfo::load_library_values(){  Ref<MessageGrp> grp = MessageGrp::get_default_messagegrp();  if (grp->me() == 0) {      const char* libdir;      Ref<KeyVal> keyval;      if ((libdir = getenv("SCLIBDIR")) != 0) {          const char* atominfo = "/atominfo.kv";          const char *eq = ::strchr(libdir,'=');          if (eq) libdir = eq + 1;          char *filename = new char[strlen(libdir) + strlen(atominfo) + 1];          strcpy(filename, libdir);          strcat(filename, atominfo);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -