source: ThirdParty/mpqc_open/src/lib/chemistry/qc/basis/gpetite.cc@ 860145

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 860145 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 5.4 KB
Line 
1//
2// gpetite.cc --- implementation of GPetite4 and helpers
3//
4// Copyright (C) 1996 Limit Point Systems, Inc.
5//
6// Author: Curtis Janssen <cljanss@ca.sandia.gov>
7// Maintainer: SNL
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#ifdef __GNUC__
29#pragma implementation
30#endif
31
32#include <util/misc/formio.h>
33
34#include <chemistry/qc/basis/basis.h>
35#include <chemistry/qc/basis/gpetite.h>
36
37using namespace std;
38using namespace sc;
39
40////////////////////////////////////////////////////////////////////////////
41
42canonical_aaaa::canonical_aaaa()
43{
44}
45
46canonical_aaaa::canonical_aaaa(const Ref<GaussianBasisSet> bi,
47 const Ref<GaussianBasisSet> bj,
48 const Ref<GaussianBasisSet> bk,
49 const Ref<GaussianBasisSet> bl)
50{
51}
52
53////////////////////////////////////////////////////////////////////////////
54
55canonical_aabc::canonical_aabc(const Ref<GaussianBasisSet> bi,
56 const Ref<GaussianBasisSet> bj,
57 const Ref<GaussianBasisSet> bk,
58 const Ref<GaussianBasisSet> bl)
59{
60 nk_ = bk->nshell();
61 nl_ = bl->nshell();
62}
63
64////////////////////////////////////////////////////////////////////////////
65
66
67canonical_aabb::canonical_aabb(const Ref<GaussianBasisSet> bi,
68 const Ref<GaussianBasisSet> bj,
69 const Ref<GaussianBasisSet> bk,
70 const Ref<GaussianBasisSet> bl)
71{
72 int ni = bi->nshell();
73 nij_ = (ni*long(ni+1))>>1;
74}
75
76////////////////////////////////////////////////////////////////////////////
77
78canonical_abcd::canonical_abcd(const Ref<GaussianBasisSet> bi,
79 const Ref<GaussianBasisSet> bj,
80 const Ref<GaussianBasisSet> bk,
81 const Ref<GaussianBasisSet> bl)
82{
83 ni_ = bi->nshell();
84 nj_ = bj->nshell();
85 nk_ = bk->nshell();
86}
87
88
89/////////////////////////////////////////////////////////////////////////////
90
91GenPetite4::GenPetite4(const Ref<GaussianBasisSet> &b1,
92 const Ref<GaussianBasisSet> &b2,
93 const Ref<GaussianBasisSet> &b3,
94 const Ref<GaussianBasisSet> &b4)
95{
96 int **atom_map;
97 b1_ = b1;
98 b2_ = b2;
99 b3_ = b3;
100 b4_ = b4;
101
102 ng_ = b1->molecule()->point_group()->char_table().order();
103 if (b2->molecule()->point_group()->char_table().order() != ng_
104 || b3->molecule()->point_group()->char_table().order() != ng_
105 || b4->molecule()->point_group()->char_table().order() != ng_) {
106 throw std::runtime_error("GPetite4: not all point groups are the same");
107 }
108 c1_ = (ng_ == 1);
109
110 atom_map = compute_atom_map(b1);
111 shell_map_i_ = compute_shell_map(atom_map,b1);
112 delete_atom_map(atom_map,b1);
113
114 atom_map = compute_atom_map(b2);
115 shell_map_j_ = compute_shell_map(atom_map,b2);
116 delete_atom_map(atom_map,b2);
117
118 atom_map = compute_atom_map(b3);
119 shell_map_k_ = compute_shell_map(atom_map,b3);
120 delete_atom_map(atom_map,b3);
121
122 atom_map = compute_atom_map(b4);
123 shell_map_l_ = compute_shell_map(atom_map,b4);
124 delete_atom_map(atom_map,b4);
125}
126
127GenPetite4::~GenPetite4() {
128 delete_shell_map(shell_map_i_,b1_);
129 delete_shell_map(shell_map_j_,b2_);
130 delete_shell_map(shell_map_k_,b3_);
131 delete_shell_map(shell_map_l_,b4_);
132}
133
134/////////////////////////////////////////////////////////////////////////////
135
136template <class C4> GPetite4<C4>::GPetite4(const Ref<GaussianBasisSet> &b1,
137 const Ref<GaussianBasisSet> &b2,
138 const Ref<GaussianBasisSet> &b3,
139 const Ref<GaussianBasisSet> &b4,
140 const C4& c): GenPetite4(b1,b2,b3,b4), c_(c)
141{
142}
143
144template <class C4> GPetite4<C4>::~GPetite4()
145{
146}
147
148/////////////////////////////////////////////////////////////////////////////
149
150Ref<GenPetite4>
151sc::construct_gpetite(const Ref<GaussianBasisSet> &b1,
152 const Ref<GaussianBasisSet> &b2,
153 const Ref<GaussianBasisSet> &b3,
154 const Ref<GaussianBasisSet> &b4)
155{
156 if (b1 == b2 && b1 == b3 && b1 == b4) {
157 canonical_aaaa c4(b1,b2,b3,b4);
158 return new GPetite4<canonical_aaaa>(b1,b2,b3,b4,c4);
159 }
160 else if (b1 == b2 && b3 != b4) {
161 canonical_aabc c4(b1,b2,b3,b4);
162 return new GPetite4<canonical_aabc>(b1,b2,b3,b4,c4);
163 }
164 else if (b1 == b2 && b3 == b4) {
165 canonical_aabb c4(b1,b2,b3,b4);
166 return new GPetite4<canonical_aabb>(b1,b2,b3,b4,c4);
167 }
168 else {
169 canonical_abcd c4(b1,b2,b3,b4);
170 return new GPetite4<canonical_abcd>(b1,b2,b3,b4,c4);
171 }
172}
173
174/////////////////////////////////////////////////////////////////////////////
175
176// Local Variables:
177// mode: c++
178// c-file-style: "ETS"
179// End:
Note: See TracBrowser for help on using the repository browser.