Geant4-11
Functions
pymodG4materials.cc File Reference
#include <boost/python.hpp>

Go to the source code of this file.

Functions

 BOOST_PYTHON_MODULE (G4materials)
 
void export_G4AtomicShells ()
 
void export_G4Element ()
 
void export_G4ElementTable ()
 
void export_G4ElementVector ()
 
void export_G4Isotope ()
 
void export_G4Material ()
 
void export_G4MaterialTable ()
 
void export_G4NistManager ()
 

Function Documentation

◆ BOOST_PYTHON_MODULE()

BOOST_PYTHON_MODULE ( G4materials  )

◆ export_G4AtomicShells()

void export_G4AtomicShells ( )

Definition at line 39 of file pyG4AtomicShells.cc.

40{
41 class_<G4AtomicShells, boost::noncopyable>
42 ("G4AtomicShells", "Atomic subshell binding energy table", no_init)
43
44 .def("GetNumberOfShells", &G4AtomicShells::GetNumberOfShells)
45 .staticmethod("GetNumberOfShells")
46
47 .def("GetNumberOfElectrons", &G4AtomicShells::GetNumberOfElectrons)
48 .staticmethod("GetNumberOfElectrons")
49
50 .def("GetBindingEnergy", &G4AtomicShells::GetBindingEnergy)
51 .staticmethod("GetBindingEnergy")
52
53 .def("GetTotalBindingEnergy", &G4AtomicShells::GetTotalBindingEnergy)
54 ;
55}
static G4double GetTotalBindingEnergy(G4int Z)
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
static G4int GetNumberOfShells(G4int Z)

References G4AtomicShells::GetBindingEnergy(), G4AtomicShells::GetNumberOfElectrons(), G4AtomicShells::GetNumberOfShells(), and G4AtomicShells::GetTotalBindingEnergy().

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4Element()

void export_G4Element ( )

Definition at line 67 of file pyG4Element.cc.

68{
69 class_<G4Element, G4Element*, boost::noncopyable>
70 ("G4Element", "element class", no_init)
71 // constructors
72 .def(init<const G4String&, const G4String&, G4double, G4double>())
73 .def(init<const G4String&, const G4String&, G4int>())
74 // ---
75 .def("AddIsotope", &G4Element::AddIsotope)
76 .def("GetName", &G4Element::GetName,
77 return_value_policy<reference_existing_object>())
78 .def("GetSymbol", &G4Element::GetSymbol,
79 return_value_policy<reference_existing_object>())
80 .def("SetName", &G4Element::SetName)
81 .def("GetZ", &G4Element::GetZ)
82 .def("GetN", &G4Element::GetN)
83 .def("GetA", &G4Element::GetA)
84 .def("GetNbOfAtomicShells", &G4Element::GetNbOfAtomicShells)
85 .def("GetAtomicShell", &G4Element::GetAtomicShell)
86 .def("GetNumberOfIsotopes", &G4Element::GetNumberOfIsotopes)
87 .def("GetIsotopeVector", &G4Element::GetIsotopeVector,
88 return_internal_reference<>())
89 .def("GetRelativeAbundanceVector", f_GetRelativeAbundanceVector)
90 .def("GetIsotope", &G4Element::GetIsotope,
91 return_value_policy<reference_existing_object>())
92 .def("GetElementTable", &G4Element::GetElementTable,
93 return_value_policy<reference_existing_object>())
94 .staticmethod("GetElementTable")
95 .def("GetNumberOfElements", &G4Element::GetNumberOfElements)
96 .staticmethod("GetNumberOfElements")
97 .def("GetIndex", &G4Element::GetIndex)
98 .def("GetElement", &G4Element::GetElement,
99 return_value_policy<reference_existing_object>())
100 .staticmethod("GetElement")
101 .def("GetfCoulomb", &G4Element::GetfCoulomb)
102 .def("GetfRadTsai", &G4Element::GetfRadTsai)
103 .def("GetIonisation", &G4Element::GetIonisation,
104 return_internal_reference<>())
105 // ---
106 .def("Print", Print)
107 ;
108}
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:397
const G4String & GetSymbol() const
Definition: G4Element.hh:128
G4double GetZ() const
Definition: G4Element.hh:131
G4int GetNbOfAtomicShells() const
Definition: G4Element.hh:147
static size_t GetNumberOfElements()
Definition: G4Element.cc:404
void SetName(const G4String &name)
Definition: G4Element.hh:215
void AddIsotope(G4Isotope *isotope, G4double RelativeAbundance)
Definition: G4Element.cc:151
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
G4double GetA() const
Definition: G4Element.hh:139
size_t GetIndex() const
Definition: G4Element.hh:182
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
const G4String & GetName() const
Definition: G4Element.hh:127
G4double GetfCoulomb() const
Definition: G4Element.hh:191
G4IonisParamElm * GetIonisation() const
Definition: G4Element.hh:199
G4double GetfRadTsai() const
Definition: G4Element.hh:195
G4double GetN() const
Definition: G4Element.hh:135
G4double GetAtomicShell(G4int index) const
Definition: G4Element.cc:366
static G4Element * GetElement(G4String name, G4bool warning=true)
Definition: G4Element.cc:411
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
list f_GetRelativeAbundanceVector(const G4Element *element)
Definition: pyG4Element.cc:43
void Print(G4Element &ele)
Definition: pyG4Element.cc:55

References G4Element::AddIsotope(), pyG4Element::f_GetRelativeAbundanceVector(), G4Element::GetA(), G4Element::GetAtomicShell(), G4Element::GetElement(), G4Element::GetElementTable(), G4Element::GetfCoulomb(), G4Element::GetfRadTsai(), G4Element::GetIndex(), G4Element::GetIonisation(), G4Element::GetIsotope(), G4Element::GetIsotopeVector(), G4Element::GetN(), G4Element::GetName(), G4Element::GetNbOfAtomicShells(), G4Element::GetNumberOfElements(), G4Element::GetNumberOfIsotopes(), G4Element::GetSymbol(), G4Element::GetZ(), pyG4Element::Print(), and G4Element::SetName().

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4ElementTable()

void export_G4ElementTable ( )

Definition at line 41 of file pyG4ElementTable.cc.

42{
43 class_<G4ElementTable> ("G4ElementTable", "element table")
44 .def(vector_indexing_suite<G4ElementTable>())
45 .def(self_ns::str(self))
46 ;
47}

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4ElementVector()

void export_G4ElementVector ( )

Definition at line 41 of file pyG4ElementVector.cc.

42{
43 class_<G4ElementVector> ("G4ElementVector", "element vector")
44 .def(vector_indexing_suite<G4ElementVector>())
45 .def(self_ns::str(self))
46 ;
47}

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4Isotope()

void export_G4Isotope ( )

Definition at line 58 of file pyG4Isotope.cc.

59{
60 class_<G4Isotope, G4Isotope*, boost::noncopyable>
61 ("G4Isotope", "isotope class", no_init)
62 // constructors
63 .def(init<const G4String&, G4int, G4int>())
64 .def(init<const G4String&, G4int, G4int, G4double>())
65 // ---
66 .def("GetName", &G4Isotope::GetName,
67 return_value_policy<reference_existing_object>())
68 .def("SetName", &G4Isotope::SetName)
69 .def("GetZ", &G4Isotope::GetZ)
70 .def("GetN", &G4Isotope::GetN)
71 .def("GetA", &G4Isotope::GetA)
72 .def("GetIsotope", &G4Isotope::GetIsotope,
73 f_GetIsotope()
74 [return_value_policy<reference_existing_object>()])
75 .staticmethod("GetIsotope")
76 .def("GetIsotopeTable", &G4Isotope::GetIsotopeTable,
77 return_value_policy<reference_existing_object>())
78 .staticmethod("GetIsotopeTable")
79 .def("GetNumberOfIsotopes", &G4Isotope::GetNumberOfIsotopes)
80 .staticmethod("GetNumberOfIsotopes")
81
82 .def("GetIndex", &G4Isotope::GetIndex)
83 // ---
84 .def("Print", Print)
85 .def(self == self)
86 .def(self != self)
87 ;
88
89 // G4IsotopeTable
90 class_<G4IsotopeTable> ("G4IsotopeTable", "isotope table")
91 .def(vector_indexing_suite<G4IsotopeTable>())
92 .def(self_ns::str(self))
93 ;
94}
size_t GetIndex() const
Definition: G4Isotope.hh:110
static const G4IsotopeTable * GetIsotopeTable()
Definition: G4Isotope.cc:181
G4int GetZ() const
Definition: G4Isotope.hh:90
void SetName(const G4String &name)
Definition: G4Isotope.hh:131
static size_t GetNumberOfIsotopes()
Definition: G4Isotope.cc:188
static G4Isotope * GetIsotope(const G4String &name, G4bool warning=false)
Definition: G4Isotope.cc:195
G4int GetN() const
Definition: G4Isotope.hh:93
const G4String & GetName() const
Definition: G4Isotope.hh:87
G4double GetA() const
Definition: G4Isotope.hh:96
void Print(G4Isotope &iso)
Definition: pyG4Isotope.cc:46

References G4Isotope::GetA(), G4Isotope::GetIndex(), G4Isotope::GetIsotope(), G4Isotope::GetIsotopeTable(), G4Isotope::GetN(), G4Isotope::GetName(), G4Isotope::GetNumberOfIsotopes(), G4Isotope::GetZ(), pyG4Isotope::Print(), and G4Isotope::SetName().

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4Material()

void export_G4Material ( )

Definition at line 115 of file pyG4Material.cc.

116{
117 class_<G4Material, G4Material*, boost::noncopyable>
118 ("G4Material", "material class", no_init)
119 .def(init<const G4String&, G4double, G4double, G4double>())
120 .def(init<const G4String&, G4double, G4int>())
121 // ---
122 .def("AddElement", f1_AddElement)
123 .def("AddElement", f2_AddElement)
124 .def("AddMaterial", &G4Material::AddMaterial)
125 .def("GetName", &G4Material::GetName,
126 return_value_policy<reference_existing_object>())
127 .def("GetChemicalFormula", &G4Material::GetChemicalFormula,
128 return_value_policy<reference_existing_object>())
129 .def("SetName", &G4Material::SetName)
130 .def("SetChemicalFormula", &G4Material::SetChemicalFormula)
131 .def("GetDensity", &G4Material::GetDensity)
132 .def("GetState", &G4Material::GetState)
133 .def("GetTemperature", &G4Material::GetTemperature)
134 .def("GetPressure", &G4Material::GetPressure)
135 // ---
136 .def("GetElementVector", &G4Material::GetElementVector,
137 return_internal_reference<>())
138 .def("GetElement", &G4Material::GetElement,
139 return_value_policy<reference_existing_object>())
140 .def("GetTotNbOfAtomsPerVolume", &G4Material::GetTotNbOfAtomsPerVolume)
141 .def("GetTotNbOfElectPerVolume", &G4Material::GetTotNbOfElectPerVolume)
142 .def("GetFractionVector", f_GetFractionVector)
143 .def("GetAtomsVector", f_GetAtomsVector)
144 .def("GetVecNbOfAtomsPerVolume", f_GetVecNbOfAtomsPerVolume)
145 .def("GetAtomicNumDensityVector", f_GetAtomicNumDensityVector)
146 // ----
147 .def("GetElectronDensity", &G4Material::GetElectronDensity)
148 .def("GetRadlen", &G4Material::GetRadlen)
149 .def("GetNuclearInterLength", &G4Material::GetNuclearInterLength)
150 .def("GetIonisation", &G4Material::GetIonisation,
151 return_internal_reference<>())
152 .def("GetSandiaTable", &G4Material::GetSandiaTable,
153 return_internal_reference<>())
154 // ---
155 .def("GetZ", &G4Material::GetZ)
156 .def("GetA", &G4Material::GetA)
157 .def("SetMaterialPropertiesTable", &G4Material::SetMaterialPropertiesTable)
158 .def("GetMaterialPropertiesTable", &G4Material::GetMaterialPropertiesTable,
159 return_internal_reference<>())
160 .def("GetMaterialTable", &G4Material::GetMaterialTable,
161 return_value_policy<reference_existing_object>())
162 .staticmethod("GetMaterialTable")
163 .def("GetNumberOfMaterials", &G4Material::GetNumberOfMaterials)
164 .staticmethod("GetNumberOfMaterials")
165 .def("GetIndex", &G4Material::GetIndex)
166 .def("GetMaterial", f1_GetMaterial, f_GetMaterial()
167 [return_value_policy<reference_existing_object>()])
168 .def("GetMaterial", f2_GetMaterial,
169 return_value_policy<reference_existing_object>())
170 .def("GetMaterial", f3_GetMaterial,
171 return_value_policy<reference_existing_object>())
172 .staticmethod("GetMaterial")
173 // ---
174 //.def(self_ns::str(self))
175 .def("Print", Print)
176 ;
177
178 // ---
179 enum_<G4State>("G4State")
180 .value("kStateUndefined", kStateUndefined)
181 .value("kStateSolid", kStateSolid)
182 .value("kStateLiquid", kStateLiquid)
183 .value("kStateGas", kStateGas)
184 ;
185}
@ kStateSolid
Definition: G4Material.hh:111
@ kStateLiquid
Definition: G4Material.hh:111
@ kStateGas
Definition: G4Material.hh:111
@ kStateUndefined
Definition: G4Material.hh:111
G4double GetPressure() const
Definition: G4Material.hh:179
void SetName(const G4String &name)
Definition: G4Material.hh:285
G4double GetDensity() const
Definition: G4Material.hh:176
const G4String & GetChemicalFormula() const
Definition: G4Material.hh:174
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:186
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
Definition: G4Material.hh:252
G4double GetTotNbOfAtomsPerVolume() const
Definition: G4Material.hh:205
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:679
G4State GetState() const
Definition: G4Material.hh:177
G4double GetTemperature() const
Definition: G4Material.hh:178
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:198
G4double GetZ() const
Definition: G4Material.cc:736
G4double GetTotNbOfElectPerVolume() const
Definition: G4Material.hh:208
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:222
void SetChemicalFormula(const G4String &chF)
Definition: G4Material.cc:632
G4double GetA() const
Definition: G4Material.cc:750
G4SandiaTable * GetSandiaTable() const
Definition: G4Material.hh:225
G4double GetElectronDensity() const
Definition: G4Material.hh:213
G4double GetRadlen() const
Definition: G4Material.hh:216
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:672
void AddMaterial(G4Material *material, G4double fraction)
Definition: G4Material.cc:496
const G4String & GetName() const
Definition: G4Material.hh:173
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
Definition: G4Material.cc:839
size_t GetIndex() const
Definition: G4Material.hh:256
G4double GetNuclearInterLength() const
Definition: G4Material.hh:219
void Print(G4Material &mat)
G4Material *(* f2_GetMaterial)(G4double, G4double, G4double)
Definition: pyG4Material.cc:50
list f_GetAtomsVector(const G4Material *material)
Definition: pyG4Material.cc:69
G4Material *(* f3_GetMaterial)(size_t, G4double)
Definition: pyG4Material.cc:52
void(G4Material::* f1_AddElement)(G4Element *, G4int)
Definition: pyG4Material.cc:42
list f_GetAtomicNumDensityVector(const G4Material *material)
Definition: pyG4Material.cc:91
void(G4Material::* f2_AddElement)(G4Element *, G4double)
Definition: pyG4Material.cc:44
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
Definition: pyG4Material.cc:80
list f_GetFractionVector(const G4Material *material)
Definition: pyG4Material.cc:58
G4Material *(* f1_GetMaterial)(const G4String &, G4bool)
Definition: pyG4Material.cc:48

References G4Material::AddMaterial(), pyG4Material::f1_AddElement, pyG4Material::f1_GetMaterial, pyG4Material::f2_AddElement, pyG4Material::f2_GetMaterial, pyG4Material::f3_GetMaterial, pyG4Material::f_GetAtomicNumDensityVector(), pyG4Material::f_GetAtomsVector(), pyG4Material::f_GetFractionVector(), pyG4Material::f_GetVecNbOfAtomsPerVolume(), G4Material::GetA(), G4Material::GetChemicalFormula(), G4Material::GetDensity(), G4Material::GetElectronDensity(), G4Material::GetElement(), G4Material::GetElementVector(), G4Material::GetIndex(), G4Material::GetIonisation(), G4Material::GetMaterialPropertiesTable(), G4Material::GetMaterialTable(), G4Material::GetName(), G4Material::GetNuclearInterLength(), G4Material::GetNumberOfMaterials(), G4Material::GetPressure(), G4Material::GetRadlen(), G4Material::GetSandiaTable(), G4Material::GetState(), G4Material::GetTemperature(), G4Material::GetTotNbOfAtomsPerVolume(), G4Material::GetTotNbOfElectPerVolume(), G4Material::GetZ(), kStateGas, kStateLiquid, kStateSolid, kStateUndefined, pyG4Material::Print(), G4Material::SetChemicalFormula(), G4Material::SetMaterialPropertiesTable(), and G4Material::SetName().

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4MaterialTable()

void export_G4MaterialTable ( )

Definition at line 41 of file pyG4MaterialTable.cc.

42{
43 class_<G4MaterialTable> ("G4MaterialTable", "material table")
44 .def(vector_indexing_suite<G4MaterialTable>())
45 .def(self_ns::str(self))
46 ;
47}

Referenced by BOOST_PYTHON_MODULE().

◆ export_G4NistManager()

void export_G4NistManager ( )

Definition at line 91 of file pyG4NistManager.cc.

92{
93#if G4VERSION_NUMBER >= 710
94
95 class_<G4NistManager, boost::noncopyable>
96 ("G4NistManager", "manager class for NIST materials", no_init)
97 // ---
98 .def("Instance", &G4NistManager::Instance,
99 return_value_policy<reference_existing_object>())
100 .staticmethod("Instance")
101 // ---
102 .def("SetVerbose", &G4NistManager::SetVerbose)
103 .def("GetVerbose", &G4NistManager::GetVerbose)
104 // ---
105#if G4VERSION_NUMBER < 910
106 .def("RegisterElement", &G4NistManager::RegisterElement)
107 .def("DeRegisterElement", &G4NistManager::DeRegisterElement)
108#endif
109 .def("GetElement", &G4NistManager::GetElement,
110 return_internal_reference<>())
111 .def("FindOrBuildElement", f1_FindOrBuildElement,
112 f_FindOrBuildElement()
113 [return_value_policy<reference_existing_object>()])
114 .def("FindOrBuildElement", f2_FindOrBuildElement,
115 f_FindOrBuildElement()
116 [return_value_policy<reference_existing_object>()])
117 .def("GetNumberOfElements", &G4NistManager::GetNumberOfElements)
118 .def("GetZ", &G4NistManager::GetZ)
119 .def("GetIsotopeMass", &G4NistManager::GetIsotopeMass)
120 .def("PrintElement", f1_PrintElement)
121 .def("PrintElement", f2_PrintElement)
122 .def("PrintG4Element", &G4NistManager::PrintG4Element)
123 // ---
124#if G4VERSION_NUMBER < 910
125 .def("RegisterMaterial", &G4NistManager::RegisterMaterial)
126 .def("DeRegisterMaterial", &G4NistManager::DeRegisterMaterial)
127#endif
128 .def("GetMaterial", &G4NistManager::GetMaterial,
129 return_value_policy<reference_existing_object>())
130 .def("FindOrBuildMaterial", &G4NistManager::FindOrBuildMaterial,
131 f_FindOrBuildMaterial()
132 [return_value_policy<reference_existing_object>()])
133 .def("ConstructNewMaterial", f1_ConstructNewMaterial,
134 f_ConstructNewMaterial()
135 [return_value_policy<reference_existing_object>()])
136 .def("ConstructNewMaterial", f2_ConstructNewMaterial,
137 f_ConstructNewMaterial()
138 [return_value_policy<reference_existing_object>()])
139#if G4VERSION_NUMBER >= 910
140 .def("ConstructNewGasMaterial", &G4NistManager::ConstructNewGasMaterial,
141 f_ConstructNewGasMaterial()
142 [return_value_policy<reference_existing_object>()])
143#endif
144 .def("GetNumberOfMaterials", &G4NistManager::GetNumberOfMaterials)
145 .def("ListMaterials", &G4NistManager::ListMaterials)
146 .def("PrintG4Material", &G4NistManager::PrintG4Material)
147 ;
148#endif
149}
G4Material * ConstructNewGasMaterial(const G4String &name, const G4String &nameNist, G4double temp, G4double pres, G4bool isotopes=true)
G4int GetVerbose() const
G4double GetIsotopeMass(G4int Z, G4int N) const
G4Element * GetElement(size_t index) const
void ListMaterials(const G4String &) const
void PrintG4Material(const G4String &) const
void PrintG4Element(const G4String &) const
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4int GetZ(const G4String &symb) const
size_t GetNumberOfElements() const
static G4NistManager * Instance()
void SetVerbose(G4int)
size_t GetNumberOfMaterials() const
G4Material * GetMaterial(size_t index) const

References G4NistManager::ConstructNewGasMaterial(), G4NistManager::FindOrBuildMaterial(), G4NistManager::GetElement(), G4NistManager::GetIsotopeMass(), G4NistManager::GetMaterial(), G4NistManager::GetNumberOfElements(), G4NistManager::GetNumberOfMaterials(), G4NistManager::GetVerbose(), G4NistManager::GetZ(), G4NistManager::Instance(), G4NistManager::ListMaterials(), G4NistManager::PrintG4Element(), G4NistManager::PrintG4Material(), and G4NistManager::SetVerbose().

Referenced by BOOST_PYTHON_MODULE().