~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/lib/libmints/integral.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <libmints/basisset.h>
 
2
#include <libmints/onebody.h>
 
3
#include <libmints/twobody.h>
 
4
#include <libmints/overlap.h>
 
5
#include <libmints/kinetic.h>
 
6
#include <libmints/potential.h>
 
7
#include <libmints/integral.h>
 
8
#include <libmints/dipole.h>
 
9
#include <libmints/quadrupole.h>
 
10
#include <libmints/symmetry.h>
 
11
#include <libmints/eri.h>
 
12
 
 
13
using namespace psi;
 
14
 
 
15
/** Initialize IntegralFactory object given a GaussianBasisSet for each center. */
 
16
IntegralFactory::IntegralFactory(const Ref<BasisSet> &bs1, const Ref<BasisSet> &bs2,
 
17
                const Ref<BasisSet> &bs3, const Ref<BasisSet> &bs4)
 
18
{
 
19
    set_basis(bs1, bs2, bs3, bs4);
 
20
}
 
21
 
 
22
IntegralFactory::~IntegralFactory()
 
23
{
 
24
    
 
25
}
 
26
 
 
27
void IntegralFactory::set_basis(const Ref<BasisSet> &bs1, const Ref<BasisSet> &bs2,
 
28
    const Ref<BasisSet> &bs3, const Ref<BasisSet> &bs4)
 
29
{
 
30
    bs1_ = bs1;
 
31
    bs2_ = bs2;
 
32
    bs3_ = bs3;
 
33
    bs4_ = bs4;
 
34
    
 
35
    // Find the max am
 
36
    Ref<BasisSet> max12 = bs1_->max_am() > bs2_->max_am() ? bs1_ : bs2_;
 
37
    Ref<BasisSet> max34 = bs3_->max_am() > bs4_->max_am() ? bs3_ : bs4_;
 
38
    Ref<BasisSet> max1234 = max12->max_am() > max34->max_am() ? max12 : max34;
 
39
    
 
40
    init_spherical_harmonics(max1234->max_am());
 
41
}
 
42
 
 
43
Ref<OneBodyInt> IntegralFactory::overlap(int deriv)
 
44
{
 
45
    return new OverlapInt((IntegralFactory*)this, bs1_, bs2_, deriv);
 
46
}
 
47
 
 
48
Ref<OneBodyInt> IntegralFactory::kinetic(int deriv)
 
49
{
 
50
    return new KineticInt((IntegralFactory*)this, bs1_, bs2_, deriv);
 
51
}
 
52
 
 
53
Ref<OneBodyInt> IntegralFactory::potential(int deriv)
 
54
{
 
55
    return new PotentialInt((IntegralFactory*)this, bs1_, bs2_, deriv);
 
56
}
 
57
 
 
58
Ref<OneBodyInt> IntegralFactory::dipole(int deriv)
 
59
{
 
60
    return new DipoleInt((IntegralFactory*)this, bs1_, bs2_, deriv);
 
61
}
 
62
 
 
63
Ref<OneBodyInt> IntegralFactory::quadrupole()
 
64
{
 
65
    return new QuadrupoleInt((IntegralFactory*)this, bs1_, bs2_);
 
66
}
 
67
 
 
68
Ref<TwoBodyInt> IntegralFactory::eri(int deriv)
 
69
{
 
70
    return new ERI((IntegralFactory*)this, bs1_, bs2_, bs3_, bs4_, deriv);
 
71
}
 
72
 
 
73
void IntegralFactory::init_spherical_harmonics(int max_am)
 
74
{
 
75
    for (int i=0; i<=max_am; ++i)
 
76
        spherical_transforms_.push_back(SphericalTransform(i));
 
77
}