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")
G4double GetPressure() const
G4IonisParamMat * GetIonisation() const
void SetChemicalFormula(const G4String &chF)
void SetName(const G4String &name)
G4double GetTotNbOfElectPerVolume() const
void AddMaterial(G4Material *material, G4double fraction)
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
const G4String & GetChemicalFormula() const
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
list f_GetFractionVector(const G4Material *material)
const G4String & GetName() const
static G4MaterialTable * GetMaterialTable()
G4double GetDensity() const
const G4ThreeVector const G4double const
const G4Element * GetElement(G4int iel) const
const G4ElementVector * GetElementVector() const
void(G4Material::* f2_AddElement)(G4Element *, G4double)
void(G4Material::* f1_AddElement)(G4Element *, G4int)
G4SandiaTable * GetSandiaTable() const
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
list f_GetVecNbOfAtomsPerVolume(const G4Material *material)
G4double GetElectronDensity() const
void Print(const std::vector< T > &data)
static size_t GetNumberOfMaterials()
G4double GetRadlen() const
G4double GetTotNbOfAtomsPerVolume() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
list f_GetAtomicNumDensityVector(const G4Material *material)
G4double GetTemperature() const
void AddElement(G4Element *element, G4int nAtoms)
list f_GetAtomsVector(const G4Material *material)
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
G4double GetNuclearInterLength() const