Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# - build library
|
||||
|
||||
link_directories (${GEANT4_LIBRARY_DIR})
|
||||
|
||||
# library
|
||||
set(_TARGET pyG4materials)
|
||||
add_library(
|
||||
${_TARGET} SHARED
|
||||
pyG4AtomicShells.cc
|
||||
pyG4Element.cc
|
||||
pyG4ElementTable.cc
|
||||
pyG4ElementVector.cc
|
||||
pyG4Isotope.cc
|
||||
pyG4Material.cc
|
||||
pyG4MaterialTable.cc
|
||||
pyG4NistManager.cc
|
||||
pymodG4materials.cc
|
||||
)
|
||||
|
||||
set_target_properties(${_TARGET} PROPERTIES PREFIX "")
|
||||
set_target_properties(${_TARGET} PROPERTIES OUTPUT_NAME "G4materials")
|
||||
set_target_properties(${_TARGET}
|
||||
PROPERTIES INSTALL_RPATH
|
||||
${GEANT4_LIBRARY_DIR}
|
||||
BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
||||
target_link_libraries (${_TARGET}
|
||||
${GEANT4_LIBRARIES_WITH_VIS} boost_python)
|
||||
|
||||
# install
|
||||
install(TARGETS ${_TARGET} LIBRARY DESTINATION ${G4MODULES_INSTALL_DIR})
|
||||
@@ -1,5 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.2 2006-04-25 08:09:45 kmura Exp $
|
||||
# $Name: not supported by cvs2svn $
|
||||
# $Id: GNUmakefile 76884 2013-11-18 12:54:03Z gcosmo $
|
||||
# ===========================================================
|
||||
# Makefile for building Geant4Py modules
|
||||
# ===========================================================
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4AtomicShells.cc,v 1.1 2008-06-03 06:27:20 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4AtomicShells.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
// ====================================================================
|
||||
// pyG4AtomicShells.cc
|
||||
//
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4Element.cc,v 1.7 2008-12-04 08:55:25 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4Element.cc 76884 2013-11-18 12:54:03Z gcosmo $
|
||||
// ====================================================================
|
||||
// pyG4Element.cc
|
||||
//
|
||||
@@ -59,7 +58,7 @@ void Print(G4Element& ele)
|
||||
std::cout << ele; // problem with G4cout. (delayed message)
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
using namespace pyG4Element;
|
||||
|
||||
@@ -75,17 +74,11 @@ void export_G4Element()
|
||||
.def(init<const G4String&, const G4String&, G4int>())
|
||||
// ---
|
||||
.def("AddIsotope", &G4Element::AddIsotope)
|
||||
#if G4VERSION_NUMBER >= 920
|
||||
.def("GetName", &G4Element::GetName,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("GetSymbol", &G4Element::GetSymbol,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("SetName", &G4Element::SetName)
|
||||
#else
|
||||
.def("GetName", &G4Element::GetName)
|
||||
.def("GetSymbol", &G4Element::GetSymbol)
|
||||
#endif
|
||||
|
||||
.def("GetZ", &G4Element::GetZ)
|
||||
.def("GetN", &G4Element::GetN)
|
||||
.def("GetA", &G4Element::GetA)
|
||||
@@ -106,12 +99,6 @@ void export_G4Element()
|
||||
.def("GetElement", &G4Element::GetElement,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.staticmethod("GetElement")
|
||||
.def("GetCountUse", &G4Element::GetCountUse)
|
||||
.def("increaseCountUse", &G4Element::increaseCountUse)
|
||||
.def("decreaseCountUse", &G4Element::decreaseCountUse)
|
||||
#if G4VERSION_NUMBER >= 710
|
||||
.def("GetIndexZ", &G4Element::GetIndexZ)
|
||||
#endif
|
||||
.def("GetfCoulomb", &G4Element::GetfCoulomb)
|
||||
.def("GetfRadTsai", &G4Element::GetfRadTsai)
|
||||
.def("GetIonisation", &G4Element::GetIonisation,
|
||||
@@ -123,4 +110,3 @@ void export_G4Element()
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4ElementTable.cc,v 1.4 2006-06-29 15:34:12 gunter Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4ElementTable.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
// ====================================================================
|
||||
// pyG4ElementTable.cc
|
||||
//
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4ElementVector.cc,v 1.2 2008-12-12 03:02:30 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4ElementVector.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
// ====================================================================
|
||||
// pyG4ElementVector.cc
|
||||
//
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4Isotope.cc,v 1.1 2008-12-04 08:55:25 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4Isotope.cc 76884 2013-11-18 12:54:03Z gcosmo $
|
||||
// ====================================================================
|
||||
// pyG4Isotope.cc
|
||||
//
|
||||
@@ -42,7 +41,7 @@ using namespace boost::python;
|
||||
// ====================================================================
|
||||
namespace pyG4Isotope {
|
||||
|
||||
BOOST_PYTHON_FUNCTION_OVERLOADS(f_GetIsotope, G4Isotope::GetIsotope, 1, 2);
|
||||
BOOST_PYTHON_FUNCTION_OVERLOADS(f_GetIsotope, G4Isotope::GetIsotope, 1, 2)
|
||||
|
||||
// copy constructor is private, so ...
|
||||
void Print(G4Isotope& iso)
|
||||
@@ -50,7 +49,7 @@ void Print(G4Isotope& iso)
|
||||
G4cout << iso;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
using namespace pyG4Isotope;
|
||||
|
||||
@@ -65,17 +64,12 @@ void export_G4Isotope()
|
||||
.def(init<const G4String&, G4int, G4int>())
|
||||
.def(init<const G4String&, G4int, G4int, G4double>())
|
||||
// ---
|
||||
#if G4VERSION_NUMBER >= 920
|
||||
.def("GetName", &G4Isotope::GetName,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("SetName", &G4Isotope::SetName)
|
||||
#else
|
||||
.def("GetName", &G4Isotope::GetName)
|
||||
#endif
|
||||
.def("GetZ", &G4Isotope::GetZ)
|
||||
.def("GetN", &G4Isotope::GetN)
|
||||
.def("GetA", &G4Isotope::GetA)
|
||||
.def("GetCountUse", &G4Isotope::GetCountUse)
|
||||
.def("GetIsotope", &G4Isotope::GetIsotope,
|
||||
f_GetIsotope()
|
||||
[return_value_policy<reference_existing_object>()])
|
||||
@@ -99,4 +93,3 @@ void export_G4Isotope()
|
||||
.def(self_ns::str(self))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4Material.cc,v 1.7 2008-12-04 08:55:25 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4Material.cc 76884 2013-11-18 12:54:03Z gcosmo $
|
||||
// ====================================================================
|
||||
// pyG4Material.cc
|
||||
//
|
||||
@@ -47,12 +46,10 @@ void (G4Material::*f1_AddElement)(G4Element*, G4int)
|
||||
void (G4Material::*f2_AddElement)(G4Element*, G4double)
|
||||
= &G4Material::AddElement;
|
||||
|
||||
#if G4VERSION_NUMBER >= 800
|
||||
BOOST_PYTHON_FUNCTION_OVERLOADS(f_GetMaterial, G4Material::GetMaterial, 1, 2);
|
||||
#endif
|
||||
BOOST_PYTHON_FUNCTION_OVERLOADS(f_GetMaterial, G4Material::GetMaterial, 1, 2)
|
||||
|
||||
// raw pointer -> Python list conversion
|
||||
list f_GetFractionVector(const G4Material* material)
|
||||
list f_GetFractionVector(const G4Material* material)
|
||||
{
|
||||
list fracList;
|
||||
const G4double* fracVec= material-> GetFractionVector();
|
||||
@@ -119,16 +116,11 @@ void export_G4Material()
|
||||
.def("AddElement", f1_AddElement)
|
||||
.def("AddElement", f2_AddElement)
|
||||
.def("AddMaterial", &G4Material::AddMaterial)
|
||||
#if G4VERSION_NUMBER >= 920
|
||||
.def("GetName", &G4Material::GetName,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("GetChemicalFormula", &G4Material::GetChemicalFormula,
|
||||
return_value_policy<reference_existing_object>())
|
||||
.def("SetName", &G4Material::SetName)
|
||||
#else
|
||||
.def("GetName", &G4Material::GetName)
|
||||
.def("GetChemicalFormula", &G4Material::GetChemicalFormula)
|
||||
#endif
|
||||
.def("SetChemicalFormula", &G4Material::SetChemicalFormula)
|
||||
.def("GetDensity", &G4Material::GetDensity)
|
||||
.def("GetState", &G4Material::GetState)
|
||||
@@ -165,14 +157,9 @@ void export_G4Material()
|
||||
.def("GetNumberOfMaterials", &G4Material::GetNumberOfMaterials)
|
||||
.staticmethod("GetNumberOfMaterials")
|
||||
.def("GetIndex", &G4Material::GetIndex)
|
||||
#if G4VERSION_NUMBER >= 800
|
||||
.def("GetMaterial", &G4Material::GetMaterial,
|
||||
f_GetMaterial()
|
||||
[return_value_policy<reference_existing_object>()])
|
||||
#else
|
||||
.def("GetMaterial", &G4Material::GetMaterial,
|
||||
return_value_policy<reference_existing_object>())
|
||||
#endif
|
||||
f_GetMaterial()
|
||||
[return_value_policy<reference_existing_object>()])
|
||||
.staticmethod("GetMaterial")
|
||||
// ---
|
||||
//.def(self_ns::str(self))
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4MaterialTable.cc,v 1.4 2006-06-29 15:34:18 gunter Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4MaterialTable.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
// ====================================================================
|
||||
// pyG4MaterialTable.cc
|
||||
//
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pyG4NistManager.cc,v 1.6 2007-11-07 08:49:31 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pyG4NistManager.cc 76884 2013-11-18 12:54:03Z gcosmo $
|
||||
// ====================================================================
|
||||
// pyG4NistManager.cc
|
||||
//
|
||||
@@ -49,8 +48,8 @@ G4Element*(G4NistManager::*f1_FindOrBuildElement)(G4int, G4bool)
|
||||
G4Element*(G4NistManager::*f2_FindOrBuildElement)(const G4String&, G4bool)
|
||||
= &G4NistManager::FindOrBuildElement;
|
||||
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindOrBuildElement,
|
||||
FindOrBuildElement, 1, 2);
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindOrBuildElement,
|
||||
FindOrBuildElement, 1, 2)
|
||||
|
||||
// PrintElement
|
||||
void(G4NistManager::*f1_PrintElement)(const G4String&)
|
||||
@@ -59,48 +58,29 @@ void(G4NistManager::*f2_PrintElement)(G4int)
|
||||
= &G4NistManager::PrintElement;
|
||||
|
||||
// FindOrBuildMaterial
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindOrBuildMaterial,
|
||||
FindOrBuildMaterial, 1, 2);
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindOrBuildMaterial,
|
||||
FindOrBuildMaterial, 1, 2)
|
||||
|
||||
// ConstructNewMaterial
|
||||
#if G4VERSION_NUMBER >= 910
|
||||
G4Material*(G4NistManager::*f1_ConstructNewMaterial)
|
||||
(const G4String&, const std::vector<G4String>&,
|
||||
(const G4String&, const std::vector<G4String>&,
|
||||
const std::vector<G4int>&, G4double, G4bool,
|
||||
G4State, G4double, G4double)
|
||||
= &G4NistManager::ConstructNewMaterial;
|
||||
|
||||
G4Material*(G4NistManager::*f2_ConstructNewMaterial)
|
||||
(const G4String&, const std::vector<G4String>&,
|
||||
(const G4String&, const std::vector<G4String>&,
|
||||
const std::vector<G4double>&, G4double, G4bool,
|
||||
G4State, G4double, G4double)
|
||||
= &G4NistManager::ConstructNewMaterial;
|
||||
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ConstructNewMaterial,
|
||||
ConstructNewMaterial, 4, 8);
|
||||
ConstructNewMaterial, 4, 8)
|
||||
|
||||
#else
|
||||
G4Material*(G4NistManager::*f1_ConstructNewMaterial)
|
||||
(const G4String&, const std::vector<G4String>&,
|
||||
const std::vector<G4int>&, G4double, G4bool)
|
||||
= &G4NistManager::ConstructNewMaterial;
|
||||
|
||||
G4Material*(G4NistManager::*f2_ConstructNewMaterial)
|
||||
(const G4String&, const std::vector<G4String>&,
|
||||
const std::vector<G4double>&, G4double, G4bool)
|
||||
= &G4NistManager::ConstructNewMaterial;
|
||||
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ConstructNewMaterial,
|
||||
ConstructNewMaterial, 4, 5);
|
||||
|
||||
#endif
|
||||
|
||||
#if G4VERSION_NUMBER >= 910
|
||||
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ConstructNewGasMaterial,
|
||||
ConstructNewGasMaterial, 4, 5);
|
||||
#endif
|
||||
ConstructNewGasMaterial, 4, 5)
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
using namespace pyG4NistManager;
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: pymodG4materials.cc,v 1.8 2008-12-12 03:03:59 kmura Exp $
|
||||
// $Name: not supported by cvs2svn $
|
||||
// $Id: pymodG4materials.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
// ====================================================================
|
||||
// pymodG4materials.cc [Geant4Py module]
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user