MPQC  3.0.0-alpha
orbital.h
1 //
2 // orbital.h
3 //
4 // Copyright (C) 1997 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit 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 Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_qc_wfn_orbital_h
29 #define _chemistry_qc_wfn_orbital_h
30 
31 #include <math/isosurf/volume.h>
32 #include <chemistry/qc/wfn/obwfn.h>
33 #include <chemistry/qc/wfn/orbitalspace.h>
34 #include <math/mmisc/grid.h>
35 
36 namespace sc {
37 
38 class Orbital: public Volume {
39  protected:
41  int orbital_;
42 
43  virtual void compute();
44  public:
45  Orbital(const Ref<KeyVal>&);
46  Orbital(const Ref<OneBodyWavefunction>&, int orbital);
47  ~Orbital();
48  virtual void boundingbox(double valuemin,
49  double valuemax,
50  SCVector3& p1, SCVector3& p2);
51 };
52 
55 class WriteOrbital: public WriteGrid {
56  protected:
58  int orbital_;
59 
60  void label(char* buffer);
62  double calculate_value(SCVector3 point);
63  void initialize();
64 
65  public:
80  WriteOrbital(const Ref<KeyVal> &);
81  ~WriteOrbital();
82 
85 
94  static Ref<Grid> make_default_grid(const Ref<Molecule>& mol,
95  double resolution = 0.2,
96  double margin = 1.0);
97 };
98 
103  private:
104  struct OrbitalMap : public DimensionMap {
105  std::vector<int> map;
106  int operator()(int o) const { return map[o]; }
107  std::size_t ndim() const { return map.size(); }
108  };
109  protected:
110  // provide either obwfn+omap or orbs
112  OrbitalMap omap_;
113  Ref<OrbitalSpace> orbs_;
114 
115  void label(char* buffer);
117  void calculate_values(const std::vector<SCVector3>& Points, std::vector<double>& Values);
118  std::size_t ndim() const { return omap_.ndim(); }
119  const DimensionMap& dimension_map() const { return omap_; }
120  void initialize();
121  public:
140  WriteOrbitals(const Ref<KeyVal> &);
150  WriteOrbitals(const Ref<OrbitalSpace> & orbs, const std::vector<int>& labels, const Ref<sc::Grid> & grig,
151  std::string gridformat, std::string gridfile);
152  ~WriteOrbitals();
153 };
154 
155 
156 }
157 
158 #endif
159 
160 // Local Variables:
161 // mode: c++
162 // c-file-style: "CLJ"
163 // End:
sc::WriteOrbital::label
void label(char *buffer)
A label that identifies the scalar function evaluated at the grid points, is written to the buffer ar...
sc::WriteVectorGrid
WriteVectorGrid provides an interface for writing the value of a vector function evaluated at a given...
Definition: grid.h:141
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::WriteOrbital::get_molecule
Ref< Molecule > get_molecule()
Returns the molecule around which the grid values are calculated.
sc::WriteOrbital::make_default_grid
static Ref< Grid > make_default_grid(const Ref< Molecule > &mol, double resolution=0.2, double margin=1.0)
constructs a default grid for the given molecule, using VDWShape for mol.
sc::WriteOrbitals::initialize
void initialize()
Prepares some pre-calculated values before the repetitive grid calculations are perfomed.
sc::WriteVectorGrid::DimensionMap
Definition: grid.h:148
sc::WriteOrbitals
The WriteOrbitals class writes orbitals at user defined grid points to the standard output or to a se...
Definition: orbital.h:102
sc::WriteOrbitals::WriteOrbitals
WriteOrbitals(const Ref< KeyVal > &)
The KeyVal constructor accepts keywords of WriteVectorGrid and the following additional keywords.
sc::WriteOrbital::WriteOrbital
WriteOrbital(const Ref< KeyVal > &)
The KeyVal constructor uses all keywords of WriteGrid, plus the following additional keywords:
sc::WriteOrbitals::get_molecule
Ref< Molecule > get_molecule()
Returns the molecule around which the grid values are calculated.
sc::WriteOrbitals::ndim
std::size_t ndim() const
number of dimensions of the vector
Definition: orbital.h:118
sc::WriteOrbital::initialize
void initialize()
Prepares some pre-caculated values before the repetitive grid calculations are perfomed.
sc::Orbital::compute
virtual void compute()
Recompute at least the results that have compute true and are not already computed.
sc::map
std::vector< int > map(const GaussianBasisSet &B, const GaussianBasisSet &A)
same as operator<<, except A does not have to be contained in B, map[a] = -1 if function a is not in ...
sc::WriteGrid
The abstract WriteGrid class provides an interface for writing the value of a scalar function evaluat...
Definition: grid.h:85
sc::Volume
A Volume is a Function of three variables.
Definition: volume.h:38
sc::WriteOrbital::calculate_value
double calculate_value(SCVector3 point)
Returns the value of the scalar function at the given coordinate.
sc::WriteOrbital::process_keyval_for_base_class
static Ref< KeyVal > process_keyval_for_base_class(const Ref< KeyVal > kv)
if needed, creates default grid for the base class using the molecule of obwfn
sc::WriteOrbitals::label
void label(char *buffer)
A label that identifies the scalar function evaluated at the grid points, is written to the buffer ar...
sc::WriteOrbitals::dimension_map
const DimensionMap & dimension_map() const
dimension map
Definition: orbital.h:119
sc::SCVector3
a 3-element version of SCVector
Definition: vector3.h:43
sc::WriteOrbital
The WriteOrbital class writes an orbital at user defined grid points to the standard output or to a s...
Definition: orbital.h:55
sc::Orbital
Definition: orbital.h:38
sc::WriteOrbitals::calculate_values
void calculate_values(const std::vector< SCVector3 > &Points, std::vector< double > &Values)
Returns the value of the vector function at the given coordinate.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:24:00 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.