bool CSPropMaterial::Write2XML(TiXmlNode& root, bool parameterised, bool sparse) { if (CSProperties::Write2XML(root,parameterised,sparse) == false) return false; TiXmlElement* prop=root.ToElement(); if (prop==NULL) return false; prop->SetAttribute("Isotropy",bIsotropy); /*************** 3D - Properties *****************/ TiXmlElement value("Property"); WriteVectorTerm(Epsilon,value,"Epsilon",parameterised); WriteVectorTerm(Mue,value,"Mue",parameterised); WriteVectorTerm(Kappa,value,"Kappa",parameterised); WriteVectorTerm(Sigma,value,"Sigma",parameterised); /*************** 1D - Properties *****************/ WriteTerm(Density,value,"Density",parameterised); prop->InsertEndChild(value); /********** 3D - Properties Weight **************/ TiXmlElement Weight("Weight"); WriteVectorTerm(WeightEpsilon,Weight,"Epsilon",parameterised); WriteVectorTerm(WeightMue,Weight,"Mue",parameterised); WriteVectorTerm(WeightKappa,Weight,"Kappa",parameterised); WriteVectorTerm(WeightSigma,Weight,"Sigma",parameterised); /********** 1D - Properties Weight **************/ WriteTerm(WeightDensity,Weight,"Density",parameterised); prop->InsertEndChild(Weight); return true; }
bool CSPropExcitation::Write2XML(TiXmlNode& root, bool parameterised, bool sparse) { if (CSProperties::Write2XML(root,parameterised,sparse) == false) return false; TiXmlElement* prop=root.ToElement(); if (prop==NULL) return false; prop->SetAttribute("Number",(int)uiNumber); WriteTerm(m_Frequency,*prop,"Frequency",parameterised); WriteTerm(Delay,*prop,"Delay",parameterised); prop->SetAttribute("Type",iExcitType); WriteVectorTerm(Excitation,*prop,"Excite",parameterised); TiXmlElement Weight("Weight"); WriteTerm(WeightFct[0],Weight,"X",parameterised); WriteTerm(WeightFct[1],Weight,"Y",parameterised); WriteTerm(WeightFct[2],Weight,"Z",parameterised); prop->InsertEndChild(Weight); WriteVectorTerm(PropagationDir,*prop,"PropDir",parameterised); return true; }
bool CSPropDebyeMaterial::Write2XML(TiXmlNode& root, bool parameterised, bool sparse) { if (CSPropDispersiveMaterial::Write2XML(root,parameterised,sparse) == false) return false; TiXmlElement* prop=root.ToElement(); if (prop==NULL) return false; string suffix; for (int o=0;o<m_Order;++o) { suffix = ConvertInt(o+1); TiXmlElement* value=prop->FirstChildElement("Property"); if (value==NULL) return false; WriteVectorTerm(EpsDelta[o],*value,"EpsilonDelta_"+suffix,parameterised); WriteVectorTerm(EpsRelaxTime[o],*value,"EpsilonRelaxTime_"+suffix,parameterised); TiXmlElement* weight=prop->FirstChildElement("Weight"); if (weight==NULL) return false; WriteVectorTerm(WeightEpsDelta[o],*weight,"EpsilonDelta_"+suffix,parameterised); WriteVectorTerm(WeightEpsRelaxTime[o],*weight,"EpsilonRelaxTime_"+suffix,parameterised); } return true; }
void WriteVectorTerm(ParameterScalar PS[3], TiXmlElement &elem, string attr, bool mode, bool scientific, const char delimiter) { WriteVectorTerm(PS, elem, attr.c_str(), mode, scientific, delimiter); }