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 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 libmints_gridblocker_H
30 #define libmints_gridblocker_H
31 
32 #include "psi4/psi4-dec.h"
33 
34 #include "psi4/libmints/vector3.h"
35 
36 namespace psi {
37 
38 class BasisExtents;
39 class BlockOPoints;
40 
45 class GridBlocker {
46 
47 protected:
48 
49  int debug_;
50  int print_;
51  int bench_;
52 
53  // Reference to previous grid layout
54  const int npoints_ref_;
55  double const* x_ref_;
56  double const* y_ref_;
57  double const* z_ref_;
58  double const* w_ref_;
59  int const* index_ref_;
60 
61  const size_t tol_max_points_;
62  const size_t tol_min_points_;
63  const double tol_max_radius_;
64  std::shared_ptr<BasisExtents> extents_;
65 
66  // New grid layout (built in blocks -- method specific)
67  int npoints_;
70  double* x_;
71  double* y_;
72  double* z_;
73  double* w_;
74  int* index_;
75  std::vector<std::shared_ptr<BlockOPoints> > blocks_;
76 
77 public:
78 
79  GridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
80  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
81  std::shared_ptr<BasisExtents> extents);
82  virtual ~GridBlocker();
83 
84  virtual void block() = 0;
85 
86  int npoints() const { return npoints_; }
87  int max_points() const { return max_points_; }
88  int max_functions() const { return max_functions_; }
89  double* x() const { return x_; }
90  double* y() const { return y_; }
91  double* z() const { return z_; }
92  double* w() const { return w_; }
93  int* index() const { return index_; }
94  const std::vector<std::shared_ptr<BlockOPoints> >& blocks() const { return blocks_; }
95 
96  void set_print(int print) { print_ = print; }
97  void set_debug(int debug) { debug_ = debug; }
98  void set_bench(int bench) { bench_ = bench; }
99 
100 };
101 
106 
107 public:
108 
109  NaiveGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
110  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
111  std::shared_ptr<BasisExtents> extents);
112  virtual ~NaiveGridBlocker();
113 
114  virtual void block();
115 };
116 
121 
122 public:
123 
124  OctreeGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
125  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
126  std::shared_ptr<BasisExtents> extents);
127  virtual ~OctreeGridBlocker();
128 
129  virtual void block();
130 };
131 
132 }
133 #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:4227
virtual ~NaiveGridBlocker()
Definition: cubature.cc:4245
int debug_
Definition: gridblocker.h:49
double * w_
Definition: gridblocker.h:73
double const * z_ref_
Definition: gridblocker.h:57
double const * w_ref_
Definition: gridblocker.h:58
int npoints_
Definition: gridblocker.h:67
virtual void block()=0
void set_print(int print)
Definition: gridblocker.h:96
double * x_
Definition: gridblocker.h:70
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:4272
int const * index_ref_
Definition: gridblocker.h:59
double * x() const
Definition: gridblocker.h:89
virtual ~GridBlocker()
Definition: cubature.cc:4236
virtual void block()
Definition: cubature.cc:4248
const int npoints_ref_
Definition: gridblocker.h:54
int max_functions() const
Definition: gridblocker.h:88
virtual void block()
Definition: cubature.cc:4281
const size_t tol_max_points_
Definition: gridblocker.h:61
const size_t tol_min_points_
Definition: gridblocker.h:62
double * y_
Definition: gridblocker.h:71
double * w() const
Definition: gridblocker.h:92
int max_functions_
Definition: gridblocker.h:69
int max_points_
Definition: gridblocker.h:68
double const * y_ref_
Definition: gridblocker.h:56
int print_
Definition: gridblocker.h:50
int * index() const
Definition: gridblocker.h:93
int npoints() const
Definition: gridblocker.h:86
int bench_
Definition: gridblocker.h:51
Definition: gridblocker.h:45
double * z() const
Definition: gridblocker.h:91
Definition: gridblocker.h:120
std::vector< std::shared_ptr< BlockOPoints > > blocks_
Definition: gridblocker.h:75
const std::vector< std::shared_ptr< BlockOPoints > > & blocks() const
Definition: gridblocker.h:94
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:4239
double * y() const
Definition: gridblocker.h:90
const double tol_max_radius_
Definition: gridblocker.h:63
void set_bench(int bench)
Definition: gridblocker.h:98
double const * x_ref_
Definition: gridblocker.h:55
double * z_
Definition: gridblocker.h:72
int max_points() const
Definition: gridblocker.h:87
int * index_
Definition: gridblocker.h:74
std::shared_ptr< BasisExtents > extents_
Definition: gridblocker.h:64
virtual ~OctreeGridBlocker()
Definition: cubature.cc:4278
Definition: gridblocker.h:105
void set_debug(int debug)
Definition: gridblocker.h:97