Psi4
gridblocker.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 libmints_gridblocker_H
29 #define libmints_gridblocker_H
30 
31 #include "psi4/psi4-dec.h"
32 
33 #include "psi4/libmints/vector3.h"
34 
35 namespace psi {
36 
37 class PSIO;
38 class BasisSet;
39 class Matrix;
40 class Vector;
41 class IntVector;
42 class Vector3;
43 class BasisExtents;
44 class BlockOPoints;
45 
50 class GridBlocker {
51 
52 protected:
53 
54  int debug_;
55  int print_;
56  int bench_;
57 
58  // Reference to previous grid layout
59  const int npoints_ref_;
60  double const* x_ref_;
61  double const* y_ref_;
62  double const* z_ref_;
63  double const* w_ref_;
64  int const* index_ref_;
65 
66  const size_t tol_max_points_;
67  const size_t tol_min_points_;
68  const double tol_max_radius_;
69  std::shared_ptr<BasisExtents> extents_;
70 
71  // New grid layout (built in blocks -- method specific)
72  int npoints_;
75  double* x_;
76  double* y_;
77  double* z_;
78  double* w_;
79  int* index_;
80  std::vector<std::shared_ptr<BlockOPoints> > blocks_;
81 
82 public:
83 
84  GridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
85  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
86  std::shared_ptr<BasisExtents> extents);
87  virtual ~GridBlocker();
88 
89  virtual void block() = 0;
90 
91  int npoints() const { return npoints_; }
92  int max_points() const { return max_points_; }
93  int max_functions() const { return max_functions_; }
94  double* x() const { return x_; }
95  double* y() const { return y_; }
96  double* z() const { return z_; }
97  double* w() const { return w_; }
98  int* index() const { return index_; }
99  const std::vector<std::shared_ptr<BlockOPoints> >& blocks() const { return blocks_; }
100 
101  void set_print(int print) { print_ = print; }
102  void set_debug(int debug) { debug_ = debug; }
103  void set_bench(int bench) { bench_ = bench; }
104 
105 };
106 
111 
112 public:
113 
114  NaiveGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
115  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
116  std::shared_ptr<BasisExtents> extents);
117  virtual ~NaiveGridBlocker();
118 
119  virtual void block();
120 };
121 
126 
127 public:
128 
129  OctreeGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
130  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
131  std::shared_ptr<BasisExtents> extents);
132  virtual ~OctreeGridBlocker();
133 
134  virtual void block();
135 };
136 
137 }
138 #endif
GridBlocker(const int npoints_ref, double const *x_ref, double const *y_ref, double const *z_ref, double const *w_ref, int const *index_ref, const int max_points, const int min_points, const double max_radius, std::shared_ptr< BasisExtents > extents)
Definition: cubature.cc:4355
virtual ~NaiveGridBlocker()
Definition: cubature.cc:4373
int debug_
Definition: gridblocker.h:54
double * w_
Definition: gridblocker.h:78
double const * z_ref_
Definition: gridblocker.h:62
double const * w_ref_
Definition: gridblocker.h:63
int npoints_
Definition: gridblocker.h:72
virtual void block()=0
void set_print(int print)
Definition: gridblocker.h:101
double * x_
Definition: gridblocker.h:75
OctreeGridBlocker(const int npoints_ref, double const *x_ref, double const *y_ref, double const *z_ref, double const *w_ref, int const *index_ref, const int max_points, const int min_points, const double max_radius, std::shared_ptr< BasisExtents > extents)
Definition: cubature.cc:4400
int const * index_ref_
Definition: gridblocker.h:64
double * x() const
Definition: gridblocker.h:94
virtual ~GridBlocker()
Definition: cubature.cc:4364
virtual void block()
Definition: cubature.cc:4376
const int npoints_ref_
Definition: gridblocker.h:59
int max_functions() const
Definition: gridblocker.h:93
virtual void block()
Definition: cubature.cc:4409
const size_t tol_max_points_
Definition: gridblocker.h:66
const size_t tol_min_points_
Definition: gridblocker.h:67
double * y_
Definition: gridblocker.h:76
double * w() const
Definition: gridblocker.h:97
int max_functions_
Definition: gridblocker.h:74
int max_points_
Definition: gridblocker.h:73
double const * y_ref_
Definition: gridblocker.h:61
int print_
Definition: gridblocker.h:55
int * index() const
Definition: gridblocker.h:98
int npoints() const
Definition: gridblocker.h:91
int bench_
Definition: gridblocker.h:56
Definition: gridblocker.h:50
double * z() const
Definition: gridblocker.h:96
Definition: gridblocker.h:125
std::vector< std::shared_ptr< BlockOPoints > > blocks_
Definition: gridblocker.h:80
const std::vector< std::shared_ptr< BlockOPoints > > & blocks() const
Definition: gridblocker.h:99
NaiveGridBlocker(const int npoints_ref, double const *x_ref, double const *y_ref, double const *z_ref, double const *w_ref, int const *index_ref, const int max_points, const int min_points, const double max_radius, std::shared_ptr< BasisExtents > extents)
Definition: cubature.cc:4367
double * y() const
Definition: gridblocker.h:95
const double tol_max_radius_
Definition: gridblocker.h:68
void set_bench(int bench)
Definition: gridblocker.h:103
double const * x_ref_
Definition: gridblocker.h:60
double * z_
Definition: gridblocker.h:77
int max_points() const
Definition: gridblocker.h:92
int * index_
Definition: gridblocker.h:79
std::shared_ptr< BasisExtents > extents_
Definition: gridblocker.h:69
virtual ~OctreeGridBlocker()
Definition: cubature.cc:4406
Definition: gridblocker.h:110
void set_debug(int debug)
Definition: gridblocker.h:102