31 #include <boost/python.hpp>
34 using namespace boost::python;
39 namespace pyG4Material {
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;
110 using namespace pyG4Material;
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>())
126 return_value_policy<reference_existing_object>())
128 return_value_policy<reference_existing_object>())
137 return_internal_reference<>())
139 return_value_policy<reference_existing_object>())
151 return_internal_reference<>())
153 return_internal_reference<>())
159 return_internal_reference<>())
161 return_value_policy<reference_existing_object>())
162 .staticmethod(
"GetMaterialTable")
164 .staticmethod(
"GetNumberOfMaterials")
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")