32 #include <boost/python.hpp> 33 #include "G4Version.hh" 34 #include "G4Material.hh" 45 = &G4Material::AddElement;
47 = &G4Material::AddElement;
55 const G4double* fracVec= material-> GetFractionVector();
56 G4int nele= material-> GetNumberOfElements();
57 for(G4int i=0; i<nele; i++) {
58 fracList.append(fracVec[i]);
66 const G4int* atomsVec= material-> GetAtomsVector();
67 G4int nele= material-> GetNumberOfElements();
68 for(G4int i=0; i<nele; i++) {
69 atomsList.append(atomsVec[i]);
76 list nbOfAtomsPerVolumeList;
77 const G4double* nbOfAtomsPerVolumeVec= material-> GetVecNbOfAtomsPerVolume();
78 G4int nele= material-> GetNumberOfElements();
79 for(G4int i=0; i<nele; i++) {
80 nbOfAtomsPerVolumeList.append(nbOfAtomsPerVolumeVec[i]);
82 return nbOfAtomsPerVolumeList;
87 list atomicNumDensityList;
88 const G4double* atomicNumDensityVec= material-> GetAtomicNumDensityVector();
89 G4int nele= material-> GetNumberOfElements();
90 for(G4int i=0; i<nele; i++) {
91 atomicNumDensityList.append(atomicNumDensityVec[i]);
93 return atomicNumDensityList;
111 class_<G4Material, G4Material*, boost::noncopyable>
112 (
"G4Material",
"material class", no_init)
113 .def(init<const G4String&, G4double, G4double, G4double>())
114 .def(init<const G4String&, G4double, G4int>())
118 .def(
"AddMaterial", &G4Material::AddMaterial)
119 .def(
"GetName", &G4Material::GetName,
120 return_value_policy<reference_existing_object>())
121 .def(
"GetChemicalFormula", &G4Material::GetChemicalFormula,
122 return_value_policy<reference_existing_object>())
123 .def(
"SetName", &G4Material::SetName)
124 .def(
"SetChemicalFormula", &G4Material::SetChemicalFormula)
125 .def(
"GetDensity", &G4Material::GetDensity)
126 .def(
"GetState", &G4Material::GetState)
127 .def(
"GetTemperature", &G4Material::GetTemperature)
128 .def(
"GetPressure", &G4Material::GetPressure)
130 .def(
"GetElementVector", &G4Material::GetElementVector,
131 return_internal_reference<>())
132 .def(
"GetElement", &G4Material::GetElement,
133 return_value_policy<reference_existing_object>())
134 .def(
"GetTotNbOfAtomsPerVolume", &G4Material::GetTotNbOfAtomsPerVolume)
135 .def(
"GetTotNbOfElectPerVolume", &G4Material::GetTotNbOfElectPerVolume)
141 .def(
"GetElectronDensity", &G4Material::GetElectronDensity)
142 .def(
"GetRadlen", &G4Material::GetRadlen)
143 .def(
"GetNuclearInterLength", &G4Material::GetNuclearInterLength)
144 .def(
"GetIonisation", &G4Material::GetIonisation,
145 return_internal_reference<>())
146 .def(
"GetSandiaTable", &G4Material::GetSandiaTable,
147 return_internal_reference<>())
149 .def(
"GetZ", &G4Material::GetZ)
150 .def(
"GetA", &G4Material::GetA)
151 .def(
"SetMaterialPropertiesTable", &G4Material::SetMaterialPropertiesTable)
152 .def(
"GetMaterialPropertiesTable", &G4Material::GetMaterialPropertiesTable,
153 return_internal_reference<>())
154 .def(
"GetMaterialTable", &G4Material::GetMaterialTable,
155 return_value_policy<reference_existing_object>())
156 .staticmethod(
"GetMaterialTable")
157 .def(
"GetNumberOfMaterials", &G4Material::GetNumberOfMaterials)
158 .staticmethod(
"GetNumberOfMaterials")
159 .def(
"GetIndex", &G4Material::GetIndex)
160 .def(
"GetMaterial", &G4Material::GetMaterial,
162 [return_value_policy<reference_existing_object>()])
163 .staticmethod(
"GetMaterial")
170 enum_<G4State>(
"G4State")
171 .
value(
"kStateUndefined", kStateUndefined)
172 .value(
"kStateSolid", kStateSolid)
173 .value(
"kStateLiquid", kStateLiquid)
174 .value(
"kStateGas", kStateGas)
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
void(G4Material::* f2_AddElement)(G4Element *, G4double)
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
void Print(G4Material &mat)
std::string value(boost::any const &)
void(G4Material::* f1_AddElement)(G4Element *, G4int)
list f_GetAtomsVector(const G4Material *material)
list f_GetAtomicNumDensityVector(const G4Material *material)
list f_GetFractionVector(const G4Material *material)