31 #include <boost/python.hpp> 32 #include "G4Material.hh" 43 = &G4Material::AddElement;
45 = &G4Material::AddElement;
48 G4Material* (*f1_GetMaterial)(
const G4String&, G4bool)
49 = &G4Material::GetMaterial;
50 G4Material* (*f2_GetMaterial)(G4double, G4double, G4double)
51 = &G4Material::GetMaterial;
52 G4Material* (*f3_GetMaterial)(size_t, G4double)
53 = &G4Material::GetMaterial;
61 const G4double* fracVec= material-> GetFractionVector();
62 G4int nele= material-> GetNumberOfElements();
63 for(G4int i=0; i<nele; i++) {
64 fracList.append(fracVec[i]);
72 const G4int* atomsVec= material-> GetAtomsVector();
73 G4int nele= material-> GetNumberOfElements();
74 for(G4int i=0; i<nele; i++) {
75 atomsList.append(atomsVec[i]);
82 list nbOfAtomsPerVolumeList;
83 const G4double* nbOfAtomsPerVolumeVec= material-> GetVecNbOfAtomsPerVolume();
84 G4int nele= material-> GetNumberOfElements();
85 for(G4int i=0; i<nele; i++) {
86 nbOfAtomsPerVolumeList.append(nbOfAtomsPerVolumeVec[i]);
88 return nbOfAtomsPerVolumeList;
93 list atomicNumDensityList;
94 const G4double* atomicNumDensityVec= material-> GetAtomicNumDensityVector();
95 G4int nele= material-> GetNumberOfElements();
96 for(G4int i=0; i<nele; i++) {
97 atomicNumDensityList.append(atomicNumDensityVec[i]);
99 return atomicNumDensityList;
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>())
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)
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)
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<>())
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)
167 [return_value_policy<reference_existing_object>()])
169 return_value_policy<reference_existing_object>())
171 return_value_policy<reference_existing_object>())
172 .staticmethod(
"GetMaterial")
179 enum_<G4State>(
"G4State")
180 .
value(
"kStateUndefined", kStateUndefined)
181 .value(
"kStateSolid", kStateSolid)
182 .value(
"kStateLiquid", kStateLiquid)
183 .value(
"kStateGas", kStateGas)
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
void(G4Material::* f2_AddElement)(G4Element *, G4double)
G4Material *(* f2_GetMaterial)(G4double, G4double, G4double)
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
void Print(G4Material &mat)
G4Material *(* f3_GetMaterial)(size_t, G4double)
void(G4Material::* f1_AddElement)(G4Element *, G4int)
list f_GetAtomsVector(const G4Material *material)
list f_GetAtomicNumDensityVector(const G4Material *material)
list f_GetFractionVector(const G4Material *material)
G4Material *(* f1_GetMaterial)(const G4String &, G4bool)