32 #include <boost/python.hpp>
36 using namespace boost::python;
41 namespace pyG4Material {
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;
104 using namespace pyG4Material;
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>())
120 return_value_policy<reference_existing_object>())
122 return_value_policy<reference_existing_object>())
131 return_internal_reference<>())
133 return_value_policy<reference_existing_object>())
145 return_internal_reference<>())
147 return_internal_reference<>())
153 return_internal_reference<>())
155 return_value_policy<reference_existing_object>())
156 .staticmethod(
"GetMaterialTable")
158 .staticmethod(
"GetNumberOfMaterials")
162 [return_value_policy<reference_existing_object>()])
163 .staticmethod(
"GetMaterial")
170 enum_<G4State>(
"G4State")
static size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
void SetName(const G4String &name)
G4double GetRadlen() const
const G4ElementVector * GetElementVector() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
const G4String & GetName() const
G4double GetTotNbOfElectPerVolume() const
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
const G4String & GetChemicalFormula() const
const XML_Char int const XML_Char * value
void(G4Material::* f2_AddElement)(G4Element *, G4double)
const G4ThreeVector const G4double const
void Print(G4Element &ele)
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
void SetChemicalFormula(const G4String &chF)
G4double GetPressure() const
void AddElement(G4Element *element, G4int nAtoms)
G4IonisParamMat * GetIonisation() const
list f_GetAtomsVector(const G4Material *material)
G4GLOB_DLL std::ostream G4cout
list f_GetAtomicNumDensityVector(const G4Material *material)
G4SandiaTable * GetSandiaTable() const
list f_GetFractionVector(const G4Material *material)
G4double GetTotNbOfAtomsPerVolume() const
void AddMaterial(G4Material *material, G4double fraction)
const G4Element * GetElement(G4int iel) const
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
void(G4Material::* f1_AddElement)(G4Element *, G4int)
G4double GetElectronDensity() const
G4double GetNuclearInterLength() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4double GetTemperature() const
G4double GetDensity() const