57 xercesc::DOMElement* atomElement =
NewElement(
"atom");
58 atomElement->setAttributeNode(
NewAttribute(
"unit",
"g/mole"));
59 atomElement->setAttributeNode(
NewAttribute(
"value",a*mole/g));
60 element->appendChild(atomElement);
66 xercesc::DOMElement* DElement =
NewElement(
"D");
67 DElement->setAttributeNode(
NewAttribute(
"unit",
"g/cm3"));
68 DElement->setAttributeNode(
NewAttribute(
"value",d*cm3/g));
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");
86 TElement->setAttributeNode(
NewAttribute(
"value",T/kelvin));
87 element->appendChild(TElement);
93 xercesc::DOMElement* PElement =
NewElement(
"MEE");
95 PElement->setAttributeNode(
NewAttribute(
"value",MEE/electronvolt));
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;
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);
G4DLLIMPORT std::ostream G4cout
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
const G4String & GetName() const
xercesc::DOMElement * defineElement
void TWrite(xercesc::DOMElement *, const G4double &)
void MEEWrite(xercesc::DOMElement *, const G4double &)
void MaterialWrite(const G4Material *const)
void DWrite(xercesc::DOMElement *, const G4double &)
void AtomWrite(xercesc::DOMElement *, const G4double &)
virtual void MaterialsWrite(xercesc::DOMElement *)
void AddIsotope(const G4Isotope *const)
void PropertyVectorWrite(const G4String &, const G4PhysicsOrderedFreeVector *const)
void AddMaterial(const G4Material *const)
std::vector< const G4Element * > elementList
xercesc::DOMElement * materialsElement
std::vector< const G4Material * > materialList
void PWrite(xercesc::DOMElement *, const G4double &)
void ElementWrite(const G4Element *const)
void AddElement(const G4Element *const)
void PropertyWrite(xercesc::DOMElement *, const G4Material *const)
void IsotopeWrite(const G4Isotope *const)
virtual ~G4GDMLWriteMaterials()
std::vector< const G4Isotope * > isotopeList
xercesc::DOMElement * NewElement(const G4String &)
G4String GenerateName(const G4String &, const void *const)
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
G4double GetMeanExcitationEnergy() const
const G4String & GetName() const
const std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * GetPropertiesMap() const
const std::map< G4String, G4double, std::less< G4String > > * GetPropertiesCMap() const
G4double GetPressure() const
G4double GetDensity() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4double GetTemperature() const
const G4Element * GetElement(G4int iel) const
const G4double * GetFractionVector() const
G4IonisParamMat * GetIonisation() const
size_t GetNumberOfElements() const
const G4String & GetName() const
size_t GetVectorLength() const
G4double Energy(size_t index) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)