source: ThirdParty/mpqc_open/src/lib/chemistry/qc/psi/psitest.cc@ bbc982

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests 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_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since bbc982 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: 1.4 KB
Line 
1
2#include <util/misc/formio.h>
3#include <chemistry/qc/psi/psiwfn.h>
4#include <math/optimize/opt.h>
5#include <util/keyval/keyval.h>
6
7#include <chemistry/qc/psi/linkage.h>
8#include <math/optimize/linkage.h>
9
10using namespace std;
11using namespace sc;
12
13void die()
14{
15 fprintf(stderr,"die\n");
16 abort();
17}
18
19main(int argc, char**argv)
20{
21
22 set_new_handler(die);
23
24 // the output stream is standard out
25 ostream& o = cout;
26
27 ParsedKeyVal* pkv;
28 Ref<KeyVal> rpkv(pkv = new ParsedKeyVal());
29 pkv->read( SRCDIR "/psi.in");
30 pkv = 0; // should only use rpkv
31
32 int i, do_grad = 1;
33
34 for (i=0; rpkv->exists("mole",i); i++) {
35 Ref<MolecularEnergy> mole;
36 mole << rpkv->describedclassvalue("mole",i);
37 if (do_grad)
38 mole->do_gradient(1);
39 else
40 mole->do_gradient(0);
41
42 if (mole.nonnull()) {
43 mole->print(o);
44
45 o << "energy = " << mole->energy() << endl;
46 if (do_grad) {
47 o << "gradient:\n";
48 o << incindent; mole->gradient().print(o); o << decindent;
49 }
50 }
51 else {
52 o << "mole[" << i << "] is null\n";
53 }
54 }
55
56 for (i=0; rpkv->exists("opt",i); i++) {
57 Ref<Optimize> opt;
58 opt << rpkv->describedclassvalue("opt",i);
59
60 if (opt.nonnull()) {
61 //opt->print(o);
62
63 opt->optimize();
64 }
65 else {
66 o << "opt[" << i << "] is null\n";
67 }
68 opt->function()->print();
69 }
70}
Note: See TracBrowser for help on using the repository browser.