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-2018 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  // The total collocation size
72  double* x_;
73  double* y_;
74  double* z_;
75  double* w_;
76  int* index_;
77  std::vector<std::shared_ptr<BlockOPoints> > blocks_;
78 
79 public:
80 
81  GridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
82  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
83  std::shared_ptr<BasisExtents> extents);
84  virtual ~GridBlocker();
85 
86  virtual void block() = 0;
87 
88  int npoints() const { return npoints_; }
89  int max_points() const { return max_points_; }
90  int max_functions() const { return max_functions_; }
91  int collocation_size() const { return collocation_size_; }
92  double* x() const { return x_; }
93  double* y() const { return y_; }
94  double* z() const { return z_; }
95  double* w() const { return w_; }
96  int* index() const { return index_; }
97  const std::vector<std::shared_ptr<BlockOPoints> >& blocks() const { return blocks_; }
98 
99  void set_print(int print) { print_ = print; }
100  void set_debug(int debug) { debug_ = debug; }
101  void set_bench(int bench) { bench_ = bench; }
102 
103 };
104 
109 
110 public:
111 
112  NaiveGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
113  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
114  std::shared_ptr<BasisExtents> extents);
115  virtual ~NaiveGridBlocker();
116 
117  virtual void block();
118 };
119 
124 
125 public:
126 
127  OctreeGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
128  double const* w_ref, int const* index_ref, const int max_points, const int min_points, const double max_radius,
129  std::shared_ptr<BasisExtents> extents);
130  virtual ~OctreeGridBlocker();
131 
132  virtual void block();
133 };
134 
135 }
136 #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:4262
virtual ~NaiveGridBlocker()
Definition: cubature.cc:4280
int debug_
Definition: gridblocker.h:49
double * w_
Definition: gridblocker.h:75
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:99
double * x_
Definition: gridblocker.h:72
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:4308
int const * index_ref_
Definition: gridblocker.h:59
double * x() const
Definition: gridblocker.h:92
virtual ~GridBlocker()
Definition: cubature.cc:4271
virtual void block()
Definition: cubature.cc:4283
const int npoints_ref_
Definition: gridblocker.h:54
int collocation_size() const
Definition: gridblocker.h:91
int max_functions() const
Definition: gridblocker.h:90
virtual void block()
Definition: cubature.cc:4317
const size_t tol_max_points_
Definition: gridblocker.h:61
size_t collocation_size_
Definition: gridblocker.h:71
const size_t tol_min_points_
Definition: gridblocker.h:62
double * y_
Definition: gridblocker.h:73
double * w() const
Definition: gridblocker.h:95
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:96
int npoints() const
Definition: gridblocker.h:88
int bench_
Definition: gridblocker.h:51
Definition: gridblocker.h:45
double * z() const
Definition: gridblocker.h:94
Definition: gridblocker.h:123
std::vector< std::shared_ptr< BlockOPoints > > blocks_
Definition: gridblocker.h:77
const std::vector< std::shared_ptr< BlockOPoints > > & blocks() const
Definition: gridblocker.h:97
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:4274
double * y() const
Definition: gridblocker.h:93
const double tol_max_radius_
Definition: gridblocker.h:63
void set_bench(int bench)
Definition: gridblocker.h:101
double const * x_ref_
Definition: gridblocker.h:55
double * z_
Definition: gridblocker.h:74
int max_points() const
Definition: gridblocker.h:89
int * index_
Definition: gridblocker.h:76
std::shared_ptr< BasisExtents > extents_
Definition: gridblocker.h:64
virtual ~OctreeGridBlocker()
Definition: cubature.cc:4314
Definition: gridblocker.h:108
void set_debug(int debug)
Definition: gridblocker.h:100