Psi4
quad.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef QUAD_H
29 #define QUAD_H
30 
31 #include "psi4/psi4-dec.h"
32 
33 namespace psi {
34 
35 class Quadrature {
36  protected:
38  int npoints_;
40  int index_;
42  double* t_;
44  double* w_;
45  public:
47  Quadrature(int npoints);
49  virtual ~Quadrature();
50 
52  virtual void print(std::string = "outfile") = 0;
53 
55  double getWeight() { return w_[index_]; }
56 
58  double getPoint() { return t_[index_]; }
59 
61  void nextPoint() { index_++; }
62 
64  void reset() { index_ = 0; }
65 
67  bool isDone() { return index_ >= npoints_; }
68 };
69 
71  protected:
73  double center_;
74 
75  public:
81  ChebyshevIIQuadrature(int npoints, double t0 = 1.0);
86 
88  void print(std::string OutFileRMR = "outfile");
89 
90 };
91 
92 }
93 #endif
ChebyshevIIQuadrature(int npoints, double t0=1.0)
Definition: quad.cc:53
~ChebyshevIIQuadrature()
Definition: quad.h:85
int npoints_
Number of points in this quadrature rule.
Definition: quad.h:38
virtual void print(std::string="outfile")=0
Prints the Quadrature rule.
int index_
Current index in the quadrature rule.
Definition: quad.h:40
double * t_
Set of points (arbitrary domain)
Definition: quad.h:42
void print(std::string OutFileRMR="outfile")
Prints the Quadrature rule.
Definition: quad.cc:69
Quadrature(int npoints)
Constructor, allocates memory.
Definition: quad.cc:38
virtual ~Quadrature()
Destructor, frees memory.
Definition: quad.cc:47
double getPoint()
Get the current quadrature point.
Definition: quad.h:58
double center_
The center of the quadrature.
Definition: quad.h:73
double getWeight()
Get the current quadrature weight.
Definition: quad.h:55
void reset()
Reset the quadrature.
Definition: quad.h:64
void nextPoint()
Move to the next point.
Definition: quad.h:61
double * w_
Set of weights (Cartesian points, no spherical r^2)
Definition: quad.h:44
Definition: quad.h:70
Definition: quad.h:35
bool isDone()
See if the quadrature is complete.
Definition: quad.h:67