source: ThirdParty/mpqc_open/src/lib/chemistry/cca/MPQC_Physics_Units_Impl.cc@ 7516f6

Action_Thermostats Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.1 ChemicalSpaceEvaluator Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Exclude_Hydrogens_annealWithBondGraph Fix_Verbose_Codepatterns ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion Gui_displays_atomic_force_velocity JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool PythonUI_with_named_parameters Recreated_GuiChecks StoppableMakroAction TremoloParser_IncreasedPrecision
Last change on this file since 7516f6 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: 2.9 KB
Line 
1//
2// File: MPQC_Physics_Units_Impl.cc
3// Symbol: MPQC.Physics_Units-v0.2
4// Symbol Type: class
5// Babel Version: 0.10.2
6// Description: Server-side implementation for MPQC.Physics_Units
7//
8// WARNING: Automatically generated; only changes within splicers preserved
9//
10// babel-version = 0.10.2
11//
12#include "MPQC_Physics_Units_Impl.hh"
13
14// DO-NOT-DELETE splicer.begin(MPQC.Physics_Units._includes)
15// Put additional includes or other arbitrary code here...
16// DO-NOT-DELETE splicer.end(MPQC.Physics_Units._includes)
17
18// user-defined constructor.
19void MPQC::Physics_Units_impl::_ctor() {
20 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units._ctor)
21 // add construction details here
22 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units._ctor)
23}
24
25// user-defined destructor.
26void MPQC::Physics_Units_impl::_dtor() {
27 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units._dtor)
28 // add destruction details here
29 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units._dtor)
30}
31
32// static class initializer.
33void MPQC::Physics_Units_impl::_load() {
34 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units._load)
35 // guaranteed to be called at most once before any other method in this class
36 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units._load)
37}
38
39// user-defined static methods: (none)
40
41// user-defined non-static methods:
42/**
43 * Initializes the units as a human readable string
44 * options are "angstroms" or "bohr"
45 */
46void
47MPQC::Physics_Units_impl::initialize (
48 /* in */ const ::std::string& unitname )
49throw ()
50{
51 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units.initialize)
52 // insert implementation here
53 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units.initialize)
54}
55
56/**
57 * Returns the units as a human readable string.
58 */
59::std::string
60MPQC::Physics_Units_impl::get_unit_name ()
61throw ()
62
63{
64 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units.get_unit_name)
65 return units->string_rep();
66 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units.get_unit_name)
67}
68
69/**
70 * Converts from self's units to the given unit name.
71 */
72double
73MPQC::Physics_Units_impl::convert_to (
74 /* in */ const ::std::string& unitname )
75throw ()
76{
77 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units.convert_to)
78 if (units.null()) return 0;
79 sc::Ref<sc::Units> u = new sc::Units(unitname.c_str());
80 return units->to(u);
81 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units.convert_to)
82}
83
84/**
85 * Converts to self's units from the given unit name.
86 */
87double
88MPQC::Physics_Units_impl::convert_from (
89 /* in */ const ::std::string& unitname )
90throw ()
91{
92 // DO-NOT-DELETE splicer.begin(MPQC.Physics_Units.convert_from)
93 if (units.null()) return 0;
94 sc::Ref<sc::Units> u = new sc::Units(unitname.c_str());
95 return units->from(u);
96 // DO-NOT-DELETE splicer.end(MPQC.Physics_Units.convert_from)
97}
98
99
100// DO-NOT-DELETE splicer.begin(MPQC.Physics_Units._misc)
101void
102MPQC::Physics_Units_impl::set_units(const sc::Ref<sc::Units> &u)
103{
104 units = u;
105}
106// DO-NOT-DELETE splicer.end(MPQC.Physics_Units._misc)
107
Note: See TracBrowser for help on using the repository browser.