49 for(
G4int i=0; i<maxNumElm; ++i) {
51 elm2Data[i] =
nullptr;
53 compData[i] =
nullptr;
62 for(
G4int i=0; i<maxNumElm; ++i) {
65 if(
nullptr != compID[i]) {
66 for(
size_t j=0; j<compID[i]->size(); ++j) {
67 delete (*(compData[i]))[j];
77 if(Z < 1 || Z >= maxNumElm) {
78 G4cout <<
"G4ElementData::InitialiseForElement ERROR for " << name
79 <<
" Z = " <<
Z <<
" is out of range!" <<
G4endl;
80 G4Exception(
"G4ElementData::InitialiseForElement()",
"mat601",
84 if(
nullptr != elmData[
Z]) {
delete elmData[
Z]; }
90 if(Z < 1 || Z >= maxNumElm) {
91 G4cout <<
"G4ElementData::InitialiseForElement ERROR for " << name
92 <<
" Z = " <<
Z <<
" is out of range!" <<
G4endl;
93 G4Exception(
"G4ElementData::InitialiseForElement()",
"mat601",
97 if(
nullptr != elm2Data[
Z]) {
delete elm2Data[
Z]; }
103 if(Z < 1 || Z >= maxNumElm || nComponents < 0) {
104 G4cout <<
"G4ElementData::InitialiseForComponent ERROR for " << name
105 <<
" Z= " <<
Z <<
" Ncomp= " << nComponents
106 <<
" is out of range!" <<
G4endl;
107 G4Exception(
"G4ElementData::InitialiseForComponent()",
"mat602",
113 if(
nullptr == compID[
Z]) {
114 compID[
Z] =
new std::vector<G4int>();
115 compData[
Z] =
new std::vector<G4PhysicsVector*>();
117 compID[
Z]->resize(nComponents, -1);
118 compData[
Z]->resize(nComponents,
nullptr);
124 if(Z < 1 || Z >= maxNumElm ||
125 (
G4int)compID[
Z]->size() == compLength[
Z]) {
126 G4cout <<
"G4ElementData::AddComponent ERROR for " << name
127 <<
" Z = " <<
Z <<
" is out of range!" <<
G4endl;
128 G4Exception(
"G4ElementData::AddComponent()",
"mat603",
132 (*(compData[
Z]))[compLength[
Z]] = v;
133 (*(compID[
Z]))[compLength[
Z]] = id;
134 compLength[
Z] = compLength[
Z] + 1;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void InitialiseForComponent(G4int Z, G4int nComponents=0)
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)