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 file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef QUAD_H
30 #define QUAD_H
31 
32 #include "psi4/psi4-dec.h"
33 
34 namespace psi {
35 
36 class Quadrature {
37  protected:
39  int npoints_;
41  int index_;
43  double* t_;
45  double* w_;
46  public:
48  Quadrature(int npoints);
50  virtual ~Quadrature();
51 
53  virtual void print(std::string = "outfile") = 0;
54 
56  double getWeight() { return w_[index_]; }
57 
59  double getPoint() { return t_[index_]; }
60 
62  void nextPoint() { index_++; }
63 
65  void reset() { index_ = 0; }
66 
68  bool isDone() { return index_ >= npoints_; }
69 };
70 
72  protected:
74  double center_;
75 
76  public:
82  ChebyshevIIQuadrature(int npoints, double t0 = 1.0);
87 
89  void print(std::string OutFileRMR = "outfile");
90 
91 };
92 
93 }
94 #endif
ChebyshevIIQuadrature(int npoints, double t0=1.0)
Definition: quad.cc:54
~ChebyshevIIQuadrature()
Definition: quad.h:86
int npoints_
Number of points in this quadrature rule.
Definition: quad.h:39
virtual void print(std::string="outfile")=0
Prints the Quadrature rule.
int index_
Current index in the quadrature rule.
Definition: quad.h:41
double * t_
Set of points (arbitrary domain)
Definition: quad.h:43
void print(std::string OutFileRMR="outfile")
Prints the Quadrature rule.
Definition: quad.cc:70
Quadrature(int npoints)
Constructor, allocates memory.
Definition: quad.cc:39
virtual ~Quadrature()
Destructor, frees memory.
Definition: quad.cc:48
double getPoint()
Get the current quadrature point.
Definition: quad.h:59
double center_
The center of the quadrature.
Definition: quad.h:74
double getWeight()
Get the current quadrature weight.
Definition: quad.h:56
void reset()
Reset the quadrature.
Definition: quad.h:65
void nextPoint()
Move to the next point.
Definition: quad.h:62
double * w_
Set of weights (Cartesian points, no spherical r^2)
Definition: quad.h:45
Definition: quad.h:71
Definition: quad.h:36
bool isDone()
See if the quadrature is complete.
Definition: quad.h:68