56 xercesc::DOMElement* atomElement =
NewElement(
"atom");
57 atomElement->setAttributeNode(
NewAttribute(
"unit",
"g/mole"));
59 element->appendChild(atomElement);
65 xercesc::DOMElement* DElement =
NewElement(
"D");
66 DElement->setAttributeNode(
NewAttribute(
"unit",
"g/cm3"));
68 element->appendChild(DElement);
74 xercesc::DOMElement* PElement =
NewElement(
"P");
75 PElement->setAttributeNode(
NewAttribute(
"unit",
"pascal"));
77 element->appendChild(PElement);
83 xercesc::DOMElement* TElement =
NewElement(
"T");
86 element->appendChild(TElement);
92 xercesc::DOMElement* PElement =
NewElement(
"MEE");
95 element->appendChild(PElement);
103 xercesc::DOMElement* isotopeElement =
NewElement(
"isotope");
104 isotopeElement->setAttributeNode(
NewAttribute(
"name",name));
115 xercesc::DOMElement* elementElement =
NewElement(
"element");
116 elementElement->setAttributeNode(
NewAttribute(
"name",name));
120 if (NumberOfIsotopes>0)
122 const G4double* RelativeAbundanceVector =
124 for (
size_t i=0;i<NumberOfIsotopes;i++)
128 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
130 RelativeAbundanceVector[i]));
131 fractionElement->setAttributeNode(
NewAttribute(
"ref",fractionref));
132 elementElement->appendChild(fractionElement);
150 if (state==
kStateSolid) { state_str =
"solid"; }
else
152 if (state==
kStateGas) { state_str =
"gas"; }
156 xercesc::DOMElement* materialElement =
NewElement(
"material");
157 materialElement->setAttributeNode(
NewAttribute(
"name",name));
158 materialElement->setAttributeNode(
NewAttribute(
"state",state_str));
179 if ( (NumberOfElements>1)
185 for (
size_t i=0;i<NumberOfElements;i++)
190 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
192 MassFractionVector[i]));
193 fractionElement->setAttributeNode(
NewAttribute(
"ref",fractionref));
194 materialElement->appendChild(fractionElement);
219 xercesc::DOMElement* matrixElement =
NewElement(
"matrix");
220 matrixElement->setAttributeNode(
NewAttribute(
"name", matrixref));
221 matrixElement->setAttributeNode(
NewAttribute(
"coldim",
"2"));
222 std::ostringstream pvalues;
225 if (i!=0) { pvalues <<
" "; }
226 pvalues << pvec->
Energy(i) <<
" " << (*pvec)[i];
228 matrixElement->setAttributeNode(
NewAttribute(
"values", pvalues.str()));
236 xercesc::DOMElement* propElement;
243 std::map<
G4int, G4PhysicsOrderedFreeVector*,
244 std::less<G4int> >::const_iterator mpos;
246 std::less<G4int> >::const_iterator cpos;
249 for (mpos=pmap->begin(); mpos!=pmap->end(); mpos++)
261 matElement->appendChild(propElement);
265 G4String warn_message =
"Null pointer for material property -"
268 G4Exception(
"G4GDMLWriteMaterials::PropertyWrite()",
"NullPointer",
274 for (cpos=cmap->begin(); cpos!=cmap->end(); cpos++)
281 xercesc::DOMElement* constElement =
NewElement(
"constant");
284 constElement->setAttributeNode(
NewAttribute(
"value", cpos->second));
286 matElement->appendChild(propElement);