57 xercesc::DOMElement* atomElement =
NewElement(
"atom");
58 atomElement->setAttributeNode(
NewAttribute(
"unit",
"g/mole"));
60 element->appendChild(atomElement);
66 xercesc::DOMElement* DElement =
NewElement(
"D");
67 DElement->setAttributeNode(
NewAttribute(
"unit",
"g/cm3"));
69 element->appendChild(DElement);
75 xercesc::DOMElement* PElement =
NewElement(
"P");
76 PElement->setAttributeNode(
NewAttribute(
"unit",
"pascal"));
78 element->appendChild(PElement);
84 xercesc::DOMElement* TElement =
NewElement(
"T");
87 element->appendChild(TElement);
93 xercesc::DOMElement* PElement =
NewElement(
"MEE");
96 element->appendChild(PElement);
104 xercesc::DOMElement* isotopeElement =
NewElement(
"isotope");
105 isotopeElement->setAttributeNode(
NewAttribute(
"name",name));
116 xercesc::DOMElement* elementElement =
NewElement(
"element");
117 elementElement->setAttributeNode(
NewAttribute(
"name",name));
121 if (NumberOfIsotopes>0)
123 const G4double* RelativeAbundanceVector =
125 for (
size_t i=0;i<NumberOfIsotopes;i++)
129 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
131 RelativeAbundanceVector[i]));
132 fractionElement->setAttributeNode(
NewAttribute(
"ref",fractionref));
133 elementElement->appendChild(fractionElement);
151 if (state==
kStateSolid) { state_str =
"solid"; }
else
153 if (state==
kStateGas) { state_str =
"gas"; }
157 xercesc::DOMElement* materialElement =
NewElement(
"material");
158 materialElement->setAttributeNode(
NewAttribute(
"name",name));
159 materialElement->setAttributeNode(
NewAttribute(
"state",state_str));
180 if ( (NumberOfElements>1)
186 for (
size_t i=0;i<NumberOfElements;i++)
191 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
193 MassFractionVector[i]));
194 fractionElement->setAttributeNode(
NewAttribute(
"ref",fractionref));
195 materialElement->appendChild(fractionElement);
214 xercesc::DOMElement* matrixElement =
NewElement(
"matrix");
215 matrixElement->setAttributeNode(
NewAttribute(
"name", matrixref));
216 matrixElement->setAttributeNode(
NewAttribute(
"coldim",
"2"));
217 std::ostringstream pvalues;
220 if (i!=0) { pvalues <<
" "; }
221 pvalues << pvec->
Energy(i) <<
" " << (*pvec)[i];
223 matrixElement->setAttributeNode(
NewAttribute(
"values", pvalues.str()));
231 xercesc::DOMElement* propElement;
237 std::map< G4String, G4PhysicsOrderedFreeVector*,
238 std::less<G4String> >::const_iterator mpos;
240 std::less<G4String> >::const_iterator cpos;
241 for (mpos=pmap->begin(); mpos!=pmap->end(); mpos++)
244 propElement->setAttributeNode(
NewAttribute(
"name", mpos->first));
250 matElement->appendChild(propElement);
254 G4String warn_message =
"Null pointer for material property -"
255 + mpos->first +
"- of material -" + mat->
GetName() +
"- !";
256 G4Exception(
"G4GDMLWriteMaterials::PropertyWrite()",
"NullPointer",
261 for (cpos=cmap->begin(); cpos!=cmap->end(); cpos++)
264 propElement->setAttributeNode(
NewAttribute(
"name", cpos->first));
265 propElement->setAttributeNode(
NewAttribute(
"ref", cpos->first));
266 xercesc::DOMElement* constElement =
NewElement(
"constant");
267 constElement->setAttributeNode(
NewAttribute(
"name", cpos->first));
268 constElement->setAttributeNode(
NewAttribute(
"value", cpos->second));
270 matElement->appendChild(propElement);