MADNESS  version 0.9
atom.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31  $Id: test_problems.h 1856 2010-04-06 14:03:52Z mgr522 $
32 */
33 
39 #ifndef MADNESS_INTERIOR_BC_ATOM_H__INCLUDED
40 #define MADNESS_INTERIOR_BC_ATOM_H__INCLUDED
41 
42 //#define WORLD_INSTANTIATE_STATIC_TEMPLATES
43 #include <madness/mra/mra.h>
44 #include "basisfunction.h"
45 #include <string>
46 
47 using namespace madness;
48 
50 
52 class Atom {
53  protected:
54  Atom() {}
55 
56  std::vector<BasisFunc> basis;
58 
59  public:
62  : basis(0) {
63 
64  center[0] = c[0];
65  center[1] = c[1];
66  center[2] = c[2];
67  }
68 
69  Atom(const Vector<double, 3> &c, int n)
70  : basis(n) {
71 
72  center[0] = c[0];
73  center[1] = c[1];
74  center[2] = c[2];
75  }
76 
77  virtual ~Atom() {
78  for(std::vector<BasisFunc>::iterator iter = basis.begin();
79  iter != basis.end();
80  ++iter) {
81 
82  iter->reset();
83  }
84  }
85 
86  BasisFunc getBasisFunc(unsigned int n) {
87  MADNESS_ASSERT(n >= 0 && n < basis.size());
88  return basis[n];
89  }
90 
91  const Vector<double, 3> &getCenter() const {
92  return center;
93  }
94 
95  virtual int dimBasis() const = 0;
96 };
97 
99 class Hydrogen : public Atom {
100  private:
101  Hydrogen() : Atom() {}
102 
103  public:
105  : Atom(c, 2) {
106 
107  std::vector<double> c1(3), c2(1);
108  std::vector<double> e1(3), e2(1);
109 
110  c1[0] = 0.033494604338;
111  c1[1] = 0.234726953484;
112  c1[2] = 0.813757326146;
113  e1[0] = 18.7311370;
114  e1[1] = 2.8253944;
115  e1[2] = 0.6401217;
116 
117  c2[0] = 1.0;
118  e2[0] = 0.1612778;
119 
120  basis[0] = BasisFunc(new SBF(c1, e1, center));
121  basis[1] = BasisFunc(new SBF(c2, e2, center));
122  }
123 
124  virtual int dimBasis() const { return 2; }
125 };
126 
127 #endif // MADNESS_INTERIOR_BC_ATOM_H__INCLUDED
Definition: shared_ptr_bits.h:38
Main include file for MADNESS and defines Function interface.
std::vector< BasisFunc > basis
Definition: atom.h:56
FLOAT e1(FLOAT z)
Definition: y1.cc:144
Provides code to project Gaussian basis functions from independent quantum chemistry packages into MA...
const Vector< double, 3 > & getCenter() const
Definition: atom.h:91
Atom(const Vector< double, 3 > &c, int n)
Definition: atom.h:69
virtual int dimBasis() const
Definition: atom.h:124
BasisFunc getBasisFunc(unsigned int n)
Definition: atom.h:86
virtual ~Atom()
Definition: atom.h:77
Atom()
Definition: atom.h:54
Atom(const Vector< double, 3 > &c)
Sets up the basis functions for the atom.
Definition: atom.h:61
Hydrogen atom.
Definition: atom.h:99
std::shared_ptr< GaussianBF > BasisFunc
Definition: atom.h:49
Definition: chem/molecule.h:55
An s basis function.
Definition: basisfunction.h:85
Vector< double, 3 > center
Definition: atom.h:57
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
const double c
Definition: gfit.cc:200
Hydrogen(Vector< double, 3 > &c)
Definition: atom.h:104