56 xercesc::DOMElement* atomElement =
NewElement(
"atom");
57 atomElement->setAttributeNode(
NewAttribute(
"unit",
"g/mole"));
58 atomElement->setAttributeNode(
NewAttribute(
"value", a * mole / g));
59 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);
76 xercesc::DOMElement* PElement =
NewElement(
"P");
77 PElement->setAttributeNode(
NewAttribute(
"unit",
"pascal"));
78 PElement->setAttributeNode(
NewAttribute(
"value", P / hep_pascal));
79 element->appendChild(PElement);
86 xercesc::DOMElement* TElement =
NewElement(
"T");
88 TElement->setAttributeNode(
NewAttribute(
"value", T / kelvin));
89 element->appendChild(TElement);
96 xercesc::DOMElement* PElement =
NewElement(
"MEE");
98 PElement->setAttributeNode(
NewAttribute(
"value", MEE / electronvolt));
99 element->appendChild(PElement);
107 xercesc::DOMElement* isotopeElement =
NewElement(
"isotope");
108 isotopeElement->setAttributeNode(
NewAttribute(
"name", name));
120 xercesc::DOMElement* elementElement =
NewElement(
"element");
121 elementElement->setAttributeNode(
NewAttribute(
"name", name));
125 if(NumberOfIsotopes > 0)
127 const G4double* RelativeAbundanceVector
129 for(
G4int i = 0; i < NumberOfIsotopes; ++i)
133 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
134 fractionElement->setAttributeNode(
136 fractionElement->setAttributeNode(
NewAttribute(
"ref", fractionref));
137 elementElement->appendChild(fractionElement);
162 state_str =
"liquid";
171 xercesc::DOMElement* materialElement =
NewElement(
"material");
172 materialElement->setAttributeNode(
NewAttribute(
"name", name));
173 materialElement->setAttributeNode(
NewAttribute(
"state", state_str));
200 if((NumberOfElements > 1) ||
206 for(
G4int i = 0; i < NumberOfElements; ++i)
210 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
211 fractionElement->setAttributeNode(
213 fractionElement->setAttributeNode(
NewAttribute(
"ref", fractionref));
214 materialElement->appendChild(fractionElement);
243 xercesc::DOMElement* matrixElement =
NewElement(
"matrix");
244 matrixElement->setAttributeNode(
NewAttribute(
"name", matrixref));
245 matrixElement->setAttributeNode(
NewAttribute(
"coldim",
"2"));
246 std::ostringstream pvalues;
253 pvalues << pvec->
Energy(i) <<
" " << (*pvec)[i];
255 matrixElement->setAttributeNode(
NewAttribute(
"values", pvalues.str()));
266 xercesc::DOMElement* matrixElement =
NewElement(
"matrix");
267 matrixElement->setAttributeNode(
NewAttribute(
"name", matrixref));
268 matrixElement->setAttributeNode(
NewAttribute(
"coldim",
"1"));
269 std::ostringstream pvalues;
272 matrixElement->setAttributeNode(
NewAttribute(
"values", pvalues.str()));
281 xercesc::DOMElement* propElement;
287 for(
size_t i = 0; i < pvec.size(); ++i)
289 if (pvec[i] !=
nullptr)
292 propElement->setAttributeNode(
299 matElement->appendChild(propElement);
303 for(
size_t i = 0; i < cvec.size(); ++i)
305 if (cvec[i].second ==
true)
314 cvec[i].first, ptable);
315 matElement->appendChild(propElement);
338 for(std::size_t i = 0; i <
isotopeList.size(); ++i)
352 for(std::size_t i = 0; i <
elementList.size(); ++i)
G4GLOB_DLL 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 AddMaterial(const G4Material *const)
void PropertyVectorWrite(const G4String &, const G4PhysicsFreeVector *const)
std::vector< const G4Element * > elementList
xercesc::DOMElement * materialsElement
std::vector< const G4Material * > materialList
std::vector< const G4PhysicsFreeVector * > propertyList
void PWrite(xercesc::DOMElement *, const G4double &)
void ElementWrite(const G4Element *const)
void AddElement(const G4Element *const)
void PropertyConstWrite(const G4String &, const G4double, const G4MaterialPropertiesTable *)
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::vector< G4String > & GetMaterialConstPropertyNames() const
const std::vector< std::pair< G4double, G4bool > > & GetConstProperties() const
const std::vector< G4MaterialPropertyVector * > & GetProperties() const
const std::vector< G4String > & GetMaterialPropertyNames() 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
G4double Energy(const std::size_t index) const
std::size_t GetVectorLength() const