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  protected:
47  int debug_;
48  int print_;
49  int bench_;
50 
51  // Reference to previous grid layout
52  const int npoints_ref_;
53  double const* x_ref_;
54  double const* y_ref_;
55  double const* z_ref_;
56  double const* w_ref_;
57  int const* index_ref_;
58 
59  const size_t tol_max_points_;
60  const size_t tol_min_points_;
61  const double tol_max_radius_;
62  std::shared_ptr<BasisExtents> extents_;
63 
64  // New grid layout (built in blocks -- method specific)
65  int npoints_;
68  // The total collocation size
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  GridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
79  double const* w_ref, int const* index_ref, const int max_points, const int min_points,
80  const double max_radius, std::shared_ptr<BasisExtents> extents);
81  virtual ~GridBlocker();
82 
83  virtual void block() = 0;
84 
85  int npoints() const { return npoints_; }
86  int max_points() const { return max_points_; }
87  int max_functions() const { return max_functions_; }
88  int collocation_size() const { return collocation_size_; }
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 
105  public:
106  NaiveGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
107  double const* w_ref, int const* index_ref, const int max_points, const int min_points,
108  const double max_radius, std::shared_ptr<BasisExtents> extents);
109  ~NaiveGridBlocker() override;
110 
111  void block() override;
112 };
113 
118  public:
119  OctreeGridBlocker(const int npoints_ref, double const* x_ref, double const* y_ref, double const* z_ref,
120  double const* w_ref, int const* index_ref, const int max_points, const int min_points,
121  const double max_radius, std::shared_ptr<BasisExtents> extents);
122  ~OctreeGridBlocker() override;
123 
124  void block() override;
125 };
126 }
127 #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:4161
int debug_
Definition: gridblocker.h:47
double * w_
Definition: gridblocker.h:73
double const * z_ref_
Definition: gridblocker.h:55
double const * w_ref_
Definition: gridblocker.h:56
int npoints_
Definition: gridblocker.h:65
virtual void block()=0
void set_print(int print)
Definition: gridblocker.h:96
double * x_
Definition: gridblocker.h:70
void block() override
Definition: cubature.cc:4182
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:4206
int const * index_ref_
Definition: gridblocker.h:57
double * x() const
Definition: gridblocker.h:89
virtual ~GridBlocker()
Definition: cubature.cc:4176
const int npoints_ref_
Definition: gridblocker.h:52
~OctreeGridBlocker() override
Definition: cubature.cc:4211
int collocation_size() const
Definition: gridblocker.h:88
int max_functions() const
Definition: gridblocker.h:87
const size_t tol_max_points_
Definition: gridblocker.h:59
size_t collocation_size_
Definition: gridblocker.h:69
const size_t tol_min_points_
Definition: gridblocker.h:60
double * y_
Definition: gridblocker.h:71
double * w() const
Definition: gridblocker.h:92
~NaiveGridBlocker() override
Definition: cubature.cc:4181
int max_functions_
Definition: gridblocker.h:67
int max_points_
Definition: gridblocker.h:66
double const * y_ref_
Definition: gridblocker.h:54
int print_
Definition: gridblocker.h:48
int * index() const
Definition: gridblocker.h:93
int npoints() const
Definition: gridblocker.h:85
int bench_
Definition: gridblocker.h:49
Definition: gridblocker.h:45
double * z() const
Definition: gridblocker.h:91
Definition: gridblocker.h:117
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:4177
double * y() const
Definition: gridblocker.h:90
const double tol_max_radius_
Definition: gridblocker.h:61
void set_bench(int bench)
Definition: gridblocker.h:98
double const * x_ref_
Definition: gridblocker.h:53
double * z_
Definition: gridblocker.h:72
int max_points() const
Definition: gridblocker.h:86
void block() override
Definition: cubature.cc:4212
int * index_
Definition: gridblocker.h:74
std::shared_ptr< BasisExtents > extents_
Definition: gridblocker.h:62
Definition: gridblocker.h:104
void set_debug(int debug)
Definition: gridblocker.h:97