26 #include "ObjCryst/ObjCryst/General.h"
27 #include "ObjCryst/ObjCryst/IO.h"
28 #include "ObjCryst/RefinableObj/IO.h"
29 #include "ObjCryst/RefinableObj/GlobalOptimObj.h"
31 #include "ObjCryst/ObjCryst/Scatterer.h"
32 #include "ObjCryst/ObjCryst/Crystal.h"
33 #include "ObjCryst/ObjCryst/ZScatterer.h"
35 #include "ObjCryst/ObjCryst/ScatteringPower.h"
36 #include "ObjCryst/ObjCryst/ScatteringPowerSphere.h"
37 #include "ObjCryst/ObjCryst/Atom.h"
38 #include "ObjCryst/ObjCryst/DiffractionDataSingleCrystal.h"
39 #include "ObjCryst/ObjCryst/PowderPattern.h"
40 #include "ObjCryst/Quirks/VFNStreamFormat.h"
41 #include "ObjCryst/ObjCryst/Molecule.h"
47 #include <boost/format.hpp>
63 ss.imbue(std::locale::classic());
72 while(0==isgraph(is.peek())) is.get();
75 while((endchar!=is.peek())&&(
' '!=is.peek()))
79 tmp<<(char)(tolower(c)) ;
81 if(tmp.str().find(
"nan")!=string::npos)
83 VFN_DEBUG_MESSAGE(
"InputFloat(..):"<<tmp.str()<<
" -> NAN ! -> 1",9);
86 if(tmp.str().find(
"inf")!=string::npos)
88 VFN_DEBUG_MESSAGE(
"InputFloat(..):"<<tmp.str()<<
" -> INF ! -> 1",9);
91 tmp.imbue(std::locale::classic());
93 VFN_DEBUG_MESSAGE(
"InputFloat(..):"<<f<<
","<<is.good(),3);
99 #if defined(_MSC_VER) || defined(__BORLANDC__)
100 return _isnan(r) || (!_finite(r));
102 return (isnan(r)!=0) || (isinf(r)!=0);
108 VFN_DEBUG_ENTRY(
"XMLCrystFileSaveGlobal(filename)",5)
110 ofstream out(filename.c_str());
114 VFN_DEBUG_EXIT(
"XMLCrystFileSaveGlobal(filename):End",5)
119 VFN_DEBUG_ENTRY(
"XMLCrystFileSaveGlobal(ostream)",5)
120 out.imbue(std::locale::classic());
124 strftime(strDate,sizeof(strDate),"%Y-%m-%dT%H:%M:%S%Z",gmtime(&date));
125 tag.AddAttribute("Date",strDate);
126 tag.AddAttribute("Revision","2024001");
135 for(
int i=0;i<gPowderPatternRegistry.GetNb();i++)
136 gPowderPatternRegistry.GetObj(i).XMLOutput(out,1);
141 tag.SetIsEndTag(true);
148 VFN_DEBUG_ENTRY(
"XMLCrystFileLoadObjectList(filename)",5)
150 ifstream is(filename.c_str());
152 is.imbue(std::locale::classic());
159 VFN_DEBUG_EXIT(
"XMLCrystFileLoadObjectList(filename):End",5)
160 for(
int i=0;i<reg.
GetNb();i++) reg.
GetObj(i).Print();
165 if((
"Crystal"==pTag->GetName()||
166 "DiffractionDataSingleCrystal"==pTag->GetName()||
167 "PowderPattern"==pTag->GetName()||
168 "GlobalOptimObj"==pTag->GetName())
169 && !(pTag->IsEndTag())) reg.
Register(*pTag);
176 const string &tagName,
177 const string &name, T*obj)
179 VFN_DEBUG_ENTRY(
"XMLCrystFileLoadObject(filename,IOCrystTag,T&)",5)
181 ifstream is(filename.c_str());
183 is.imbue(std::locale::classic());
190 cout<<
"XMLCrystFileLoadObject(filename,IOCrystTag,T&):Not Found !"<<endl;
193 VFN_DEBUG_EXIT(
"XMLCrystFileLoadObject(filename,IOCrystTag,T&)",5)
196 if(tagName!=tag.GetName())
continue;
197 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
198 if(
"Name"==tag.GetAttributeName(i))
199 if(name==tag.GetAttributeValue(i))
break;
201 VFN_DEBUG_MESSAGE(
"XMLCrystFileLoadObject(filename,IOCrystTag,T&):Found"<<tag,5)
203 obj->XMLInput(is,tag);
205 VFN_DEBUG_EXIT(
"XMLCrystFileLoadObject(filename,IOCrystTag,T&)",5)
213 DiffractionDataSingleCrystal*);
217 PowderPatternBackground*);
219 PowderPatternDiffraction*);
225 VFN_DEBUG_ENTRY(
"XMLCrystFileLoadAllObject(filename,)",5)
226 ifstream is(filename.c_str());
227 if(is.fail())
throw ObjCrystException(
"XMLCrystFileLoadAllObject() failed input");
229 (*fpObjCrystInformUser)(
"Finished loading XML file:"+filename);
230 VFN_DEBUG_EXIT(
"XMLCrystFileLoadAllObject(filename,)",5)
234 VFN_DEBUG_ENTRY(
"XMLCrystFileLoadAllObject(istream)",5)
235 is.imbue(std::locale::classic());
237 do {is>>tag;}
while((
"ObjCryst"!=tag.GetName()) && (
false==is.eof()));
242 if(
true==is.eof())
break;
243 if(tag.GetName()==
"Crystal")
245 Crystal* obj =
new Crystal;
246 obj->XMLInput(is,tag);
247 (*fpObjCrystInformUser)(
"XML: finished reading Crystal object:"+obj->GetName());
249 if(tag.GetName()==
"PowderPattern")
251 PowderPattern* obj =
new PowderPattern;
252 obj->XMLInput(is,tag);
253 (*fpObjCrystInformUser)(
"XML: finished reading Powder Pattern object:"+obj->GetName());
255 if(tag.GetName()==
"DiffractionDataSingleCrystal")
257 DiffractionDataSingleCrystal* obj =
new DiffractionDataSingleCrystal;
258 obj->XMLInput(is,tag);
259 (*fpObjCrystInformUser)(
"XML: finished reading Single Crystal Diffraction object:"+obj->GetName());
261 if(tag.GetName()==
"GlobalOptimObj")
263 MonteCarloObj* obj =
new MonteCarloObj;
264 obj->XMLInput(is,tag);
265 (*fpObjCrystInformUser)(
"XML: finished reading Global Optimization object:"+obj->GetName());
268 (*fpObjCrystInformUser)(
"Finished loading XML");
269 VFN_DEBUG_EXIT(
"XMLCrystFileLoadAllObject(istream)",5)
278 VFN_DEBUG_ENTRY(
"ScatteringPowerAtom::XMLOutput():"<<this->
GetName(),5)
279 for(
int i=0;i<indent;i++) os <<
" " ;
281 tag.AddAttribute(
"Name",
mName);
282 tag.AddAttribute(
"Symbol",
mSymbol);
289 REAL* bdata = (REAL*)
mB.data();
313 for(
int i=0;i<=indent;i++) os <<
" " ;
319 tag2.SetIsEndTag(
true);
322 tag.SetIsEndTag(
true);
323 for(
int i=0;i<indent;i++) os <<
" " ;
325 VFN_DEBUG_EXIT(
"ScatteringPowerAtom::XMLOutput():"<<this->
GetName(),5)
330 VFN_DEBUG_ENTRY(
"ScatteringPowerAtom::XMLInput():"<<this->
GetName(),5)
331 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
333 if(
"Name"==tagg.GetAttributeName(i)) this->
SetName(tagg.GetAttributeValue(i));
334 if(
"Symbol"==tagg.GetAttributeName(i))
mSymbol=tagg.GetAttributeValue(i);
336 (*fpObjCrystInformUser)(
"Input ScatteringPowerAtom:"+
mName+
"("+
mSymbol+
")");
341 if((
"ScatteringPowerAtom"==tag.GetName())&&tag.IsEndTag())
343 VFN_DEBUG_EXIT(
"ScatteringPowerAtom::Exit():"<<this->
GetName(),5)
346 if(
"RGBColour"==tag.GetName())
353 if(
"Par"==tag.GetName())
355 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
357 if(
"Name"==tag.GetAttributeName(i))
359 if(
"Biso"==tag.GetAttributeValue(i))
365 if(
"B11"==tag.GetAttributeValue(i))
371 if(
"B22"==tag.GetAttributeValue(i))
377 if(
"B33"==tag.GetAttributeValue(i))
383 if(
"B12"==tag.GetAttributeValue(i))
389 if(
"B13"==tag.GetAttributeValue(i))
395 if(
"B23"==tag.GetAttributeValue(i))
401 if(
"ML Error"==tag.GetAttributeValue(i))
406 if(
"ML-NbGhost"==tag.GetAttributeValue(i))
411 if(
"Formal Charge"==tag.GetAttributeValue(i))
429 VFN_DEBUG_ENTRY(
"Atom::XMLOutput():"<<this->
GetName(),5)
430 for(
int i=0;i<indent;i++) os <<
" " ;
432 tag.AddAttribute(
"Name",
mName);
450 tag.SetIsEndTag(
true);
452 for(
int i=0;i<indent;i++) os <<
" " ;
455 VFN_DEBUG_EXIT(
"Atom::XMLOutput():"<<this->
GetName(),5)
460 VFN_DEBUG_ENTRY(
"Atom::XMLInput():"<<this->
GetName(),5)
462 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
464 if(
"Name"==tagg.GetAttributeName(i)) this->
SetName(tagg.GetAttributeValue(i));
465 if(
"ScattPow"==tagg.GetAttributeName(i)) scattPowName=tagg.GetAttributeValue(i);
467 (*fpObjCrystInformUser)(
"XML: Loading Atom:"+this->
GetName());
470 VFN_DEBUG_MESSAGE(
"Found Scattering Power:"<< scattPowName<<
" at "<<scattPow,4);
475 if((
"Atom"==tag.GetName())&&tag.IsEndTag())
477 VFN_DEBUG_EXIT(
"Atom::Exit():"<<this->
GetName(),5)
480 if(
"Par"==tag.GetName())
482 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
484 if(
"Name"==tag.GetAttributeName(i))
486 if(
"x"==tag.GetAttributeValue(i))
491 if(
"y"==tag.GetAttributeValue(i))
496 if(
"z"==tag.GetAttributeValue(i))
501 if(
"Occup"==tag.GetAttributeValue(i))
517 void ZAtom::XMLOutput(ostream &os,
int indent)
const
519 VFN_DEBUG_ENTRY(
"ZAtom::XMLOutput():"<<this->GetName(),5)
520 for(
int i=0;i<indent;i++) os << " " ;
522 tag.AddAttribute("Name",
mName);
545 this->
GetZScatterer().GetPar(&mAngle).XMLOutput(os,"Angle",indent);
548 this->
GetZScatterer().GetPar(&mDihed).XMLOutput(os,"DihedAng",indent);
551 this->
GetZScatterer().GetPar(&mOccupancy).XMLOutput(os,"Occup",indent);
555 tag.SetIsEndTag(true);
556 for(
int i=0;i<indent;i++) os << " " ;
558 VFN_DEBUG_EXIT("
ZAtom::XMLOutput():"<<this->GetName(),5)
563 VFN_DEBUG_ENTRY(
"ZAtom::XMLInput():"<<this->GetName(),5)
564 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
566 if(
"Name"==tagg.GetAttributeName(i))
568 this->SetName(tagg.GetAttributeValue(i));
571 if(
"ScattPow"==tagg.GetAttributeName(i))
576 .GetObj(tagg.GetAttributeValue(i)));
580 if(
"BondAtom"==tagg.GetAttributeName(i))
585 if(
"AngleAtom"==tagg.GetAttributeName(i))
590 if(
"DihedAtom"==tagg.GetAttributeName(i))
599 if((
"ZAtom"==tag.GetName())&&tag.IsEndTag())
601 VFN_DEBUG_EXIT(
"ZAtom::Exit():"<<this->GetName(),5)
604 if("Par"==tag.GetName())
606 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
608 if(
"Name"==tag.GetAttributeName(i))
610 if(
"BondLength"==tag.GetAttributeValue(i))
615 if(
"Angle"==tag.GetAttributeValue(i))
620 if(
"DihedAng"==tag.GetAttributeValue(i))
625 if(
"Occup"==tag.GetAttributeValue(i))
644 VFN_DEBUG_ENTRY(
"ZScatterer::XMLOutput():"<<this->GetName(),5)
645 for(
int i=0;i<indent;i++) os <<
" " ;
647 tag.AddAttribute(
"Name",
mName);
651 this->GetPar(mXYZ.data()+0).XMLOutput(os,
"x",indent);
654 this->GetPar(mXYZ.data()+1).XMLOutput(os,
"y",indent);
657 this->GetPar(mXYZ.data()+2).XMLOutput(os,
"z",indent);
660 this->GetPar(&mOccupancy).XMLOutput(os,
"Occup",indent);
663 this->GetPar(&mPhi).XMLOutput(os,
"Phi",indent);
666 this->GetPar(&mChi).XMLOutput(os,
"Chi",indent);
669 this->GetPar(&mPsi).XMLOutput(os,
"Psi",indent);
672 for(
int i=0;i<mZAtomRegistry.GetNb();i++) mZAtomRegistry.GetObj(i).XMLOutput(os,indent);
674 if(mZAtomRegistry.GetNb()>0)
676 for(
int i=0;i<=indent;i++) os <<
" " ;
678 tag2.AddAttribute(
"Name",this->GetZAtomRegistry().GetObj(mCenterAtomIndex).GetName());
683 tag.SetIsEndTag(
true);
684 for(
int i=0;i<indent;i++) os <<
" " ;
686 VFN_DEBUG_EXIT(
"ZScatterer::XMLOutput():"<<this->GetName(),5)
691 VFN_DEBUG_ENTRY(
"ZScatterer::XMLInput():"<<this->GetName(),5)
692 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
694 if(
"Name"==tagg.GetAttributeName(i)) this->SetName(tagg.GetAttributeValue(i));
696 (*fpObjCrystInformUser)(
"XML: Loading ZScatterer:"+this->GetName());
700 if((
"ZScatterer"==tag.GetName())&&tag.IsEndTag())
702 VFN_DEBUG_EXIT(
"ZScatterer::Exit():"<<this->GetName(),5)
705 if(
"Par"==tag.GetName())
707 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
709 if(
"Name"==tag.GetAttributeName(i))
711 if(
"x"==tag.GetAttributeValue(i))
713 this->GetPar(mXYZ.data()+0).XMLInput(is,tag);
716 if(
"y"==tag.GetAttributeValue(i))
718 this->GetPar(mXYZ.data()+1).XMLInput(is,tag);
721 if(
"z"==tag.GetAttributeValue(i))
723 this->GetPar(mXYZ.data()+2).XMLInput(is,tag);
726 if(
"Occup"==tag.GetAttributeValue(i))
728 this->GetPar(&mOccupancy).XMLInput(is,tag);
731 if(
"Phi"==tag.GetAttributeValue(i))
733 this->GetPar(&mPhi).XMLInput(is,tag);
736 if(
"Chi"==tag.GetAttributeValue(i))
738 this->GetPar(&mChi).XMLInput(is,tag);
741 if(
"Psi"==tag.GetAttributeValue(i))
743 this->GetPar(&mPsi).XMLInput(is,tag);
750 if(
"ZAtom"==tag.GetName())
754 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
755 if(
"ScattPow"==tag.GetAttributeName(i))
756 scattPow=&(this->GetCrystal().GetScatteringPowerRegistry()
757 .GetObj(tag.GetAttributeValue(i)));
758 const long nb=mZAtomRegistry.GetNb();
759 this->AddAtom(
"",scattPow,0,0,0,0,0,1);
760 mZAtomRegistry.GetObj(nb).XMLInput(is,tag);
764 sprintf(buf,
"%d-%d",(
int)nb,(
int)(mZAtomRegistry.GetObj(nb).GetZBondAtom()));
765 this->GetPar(&(mZAtomRegistry.GetObj(nb).mBondLength))
766 .SetName(
"Length"+(
string)buf);
768 sprintf(buf,
"%d-%d-%d",(
int)nb,(
int)(mZAtomRegistry.GetObj(nb).GetZBondAtom()),
769 (
int)(mZAtomRegistry.GetObj(nb).GetZAngleAtom()));
770 this->GetPar(&(mZAtomRegistry.GetObj(nb).mAngle))
771 .SetName(
"Angle"+(
string)buf);
773 sprintf(buf,
"%d-%d-%d-%d",(
int)nb,(
int)(mZAtomRegistry.GetObj(nb).GetZBondAtom()),
774 (
int)(mZAtomRegistry.GetObj(nb).GetZAngleAtom()),
775 (
int)(mZAtomRegistry.GetObj(nb).GetZDihedralAngleAtom()));
776 this->GetPar(&(mZAtomRegistry.GetObj(nb).mDihed))
777 .SetName(
"Dihed"+(
string)buf);
780 if(
"PivotAtom"==tag.GetName())
782 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
783 if(
"Name"==tag.GetAttributeName(i))
785 mCenterAtomIndex=this->GetZAtomRegistry().Find(tag.GetAttributeValue(i));
797 VFN_DEBUG_ENTRY(
"Crystal::XMLOutput():"<<this->GetName(),5)
799 for(
int i=0;i<indent;i++) os <<
" " ;
801 tag.AddAttribute(
"Name",
mName);
802 tag.AddAttribute(
"SpaceGroup",this->GetSpaceGroup().GetName());
807 this->GetPar(
"a").XMLOutput(os,
"a",indent);
810 this->GetPar(
"b").XMLOutput(os,
"b",indent);
813 this->GetPar(
"c").XMLOutput(os,
"c",indent);
816 this->GetPar(
"alpha").XMLOutput(os,
"alpha",indent);
819 this->GetPar(
"beta").XMLOutput(os,
"beta",indent);
822 this->GetPar(
"gamma").XMLOutput(os,
"gamma",indent);
825 for(
unsigned int i=0;i<this->GetNbOption();i++)
827 this->GetOption(i).XMLOutput(os,indent);
831 for(
int i=0;i<mScatteringPowerRegistry.GetNb();i++)
832 mScatteringPowerRegistry.GetObj(i).XMLOutput(os,indent);
834 for(
int i=0;i<mScattererRegistry.GetNb();i++)
835 mScattererRegistry.GetObj(i).XMLOutput(os,indent);
838 if(mvBumpMergePar.size()>0)
840 VBumpMergePar::const_iterator pos;
841 for(pos=mvBumpMergePar.begin();pos!=mvBumpMergePar.end();pos++)
843 for(
int k=0;k<=indent;k++) os <<
" " ;
845 tagBump.AddAttribute(
"ScattPow1",pos->first.first->GetName());
846 tagBump.AddAttribute(
"ScattPow2",pos->first.second->GetName());
849 ss << pos->second.mCanOverlap;
850 tagBump.AddAttribute(
"AllowMerge",ss.str());
853 tagBump.SetIsEndTag(
true);
854 os<<sqrt(pos->second.mDist2)<<tagBump<<endl;
856 for(
int k=0;k<=indent;k++) os <<
" " ;
858 os << tag2<< mBumpMergeScale;
859 tag2.SetIsEndTag(
true);
862 if(mvBondValenceRo.size()>0)
864 map<pair<const ScatteringPower*,const ScatteringPower*>, REAL>::const_iterator pos;
865 for(pos=mvBondValenceRo.begin();pos!=mvBondValenceRo.end();pos++)
867 for(
int k=0;k<=indent;k++) os <<
" " ;
869 tagBVRo.AddAttribute(
"ScattPow1",pos->first.first->GetName());
870 tagBVRo.AddAttribute(
"ScattPow2",pos->first.second->GetName());
872 tagBVRo.SetIsEndTag(
true);
873 os<<pos->second<<tagBVRo<<endl;
875 for(
int k=0;k<=indent;k++) os <<
" " ;
877 os << tag2<< mBondValenceCostScale;
878 tag2.SetIsEndTag(
true);
881 if(mInterMolDistList.size()>0) {
882 for(
int i=0;i<mInterMolDistList.size();i++) {
883 for(
int k=0;k<=indent;k++) os <<
" " ;
884 XMLCrystTag tagIMD(
"InterMolecularDistRestr",
false,
true);
886 string tmpAt1 = mInterMolDistList[i].get_list_At1();
887 tagIMD.AddAttribute(
"At1",tmpAt1);
889 string tmpAt2 = mInterMolDistList[i].get_list_At2();
898 tagIMD.AddAttribute(
"At2",tmpAt2);
899 tagIMD.AddAttribute(
"Dist",std::to_string(sqrt(mInterMolDistList[i].mDist2)));
900 tagIMD.AddAttribute(
"Delta",std::to_string(mInterMolDistList[i].mDelta));
901 tagIMD.AddAttribute(
"Sigma",std::to_string(mInterMolDistList[i].mSig));
905 for(
int k=0;k<=indent;k++) os <<
" " ;
907 os << tag2<< mInterMolDistCostScale;
908 tag2.SetIsEndTag(
true);
911 for(
int k=0;k<=indent;k++) os <<
" " ;
913 os << tag3<< mCostCalcMethod;
914 tag3.SetIsEndTag(
true);
917 for(
int k=0;k<=indent;k++) os <<
" " ;
919 os << tag4<< mDistMaxMultiplier;
920 tag4.SetIsEndTag(
true);
924 tag.SetIsEndTag(
true);
925 for(
int i=0;i<indent;i++) os <<
" " ;
927 VFN_DEBUG_EXIT(
"Crystal::XMLOutput():"<<this->GetName(),5)
932 VFN_DEBUG_ENTRY(
"Crystal::XMLInput():"<<this->GetName(),5)
933 (*fpObjCrystInformUser)(
"XML: Loading Crystal:");
935 for(
long i=0;i<mScatteringPowerRegistry.GetNb();i++)
937 this->RemoveSubRefObj(mScatteringPowerRegistry.GetObj(i));
938 mScatteringPowerRegistry.GetObj(i).DeRegisterClient(*
this);
941 std::list<ScatteringPowerAtom*> vold_scattpow;
942 if(mDeleteSubObjInDestructor)
944 mScatteringPowerRegistry.DeleteAll();
949 for(std::vector<ScatteringPower*>::const_iterator pos=mScatteringPowerRegistry.begin() ;
950 pos!=mScatteringPowerRegistry.end(); ++pos)
952 if((*pos)->GetClassName().compare(
"ScatteringPowerAtom")!=0)
continue;
955 mScatteringPowerRegistry.DeRegisterAll();
958 for(
long i=0;i<mScattererRegistry.GetNb();i++)
960 this->RemoveSubRefObj(mScattererRegistry.GetObj(i));
961 mScattererRegistry.GetObj(i).DeRegisterClient(*
this);
963 if(mDeleteSubObjInDestructor)
965 mScattererRegistry.DeleteAll();
969 mScattererRegistry.DeRegisterAll();
972 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
974 if(
"Name"==tagg.GetAttributeName(i)) this->SetName(tagg.GetAttributeValue(i));
975 if(
"SpaceGroup"==tagg.GetAttributeName(i))
976 this->Init(1,2,3,M_PI/2,M_PI/2,M_PI/2,tagg.GetAttributeValue(i),this->GetName());
978 (*fpObjCrystInformUser)(
"XML: Loading Crystal:"+this->GetName()+
"(spg:"+this->GetSpaceGroup().GetName()+
")");
982 if((
"Crystal"==tag.GetName())&&tag.IsEndTag())
984 this->UpdateDisplay();
985 VFN_DEBUG_EXIT(
"Crystal::Exit():"<<this->GetName(),5)
988 if(
"Par"==tag.GetName())
990 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
992 if(
"Name"==tag.GetAttributeName(i))
994 this->GetPar(tag.GetAttributeValue(i)).XMLInput(is,tag);
999 if(
"Option"==tag.GetName())
1001 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1002 if(
"Name"==tag.GetAttributeName(i))
1003 mOptionRegistry.GetObj(tag.GetAttributeValue(i)).XMLInput(is,tag);
1004 this->InitRefParList();
1007 if(
"AntiBumpDistance"==tag.GetName())
1010 bool useMerge=
false;
1014 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1016 if(
"AllowMerge"==tag.GetAttributeName(i))
1018 stringstream ss(tag.GetAttributeValue(i));
1023 if(
"ScattPow1"==tag.GetAttributeName(i)) scattPow1=tag.GetAttributeValue(i);
1024 if(
"ScattPow2"==tag.GetAttributeName(i)) scattPow2=tag.GetAttributeValue(i);
1029 this->SetBumpMergeDistance(mScatteringPowerRegistry.GetObj(scattPow1),
1030 mScatteringPowerRegistry.GetObj(scattPow2),
1032 else this->SetBumpMergeDistance(mScatteringPowerRegistry.GetObj(scattPow1),
1033 mScatteringPowerRegistry.GetObj(scattPow2),
1037 if(
"BondValenceRo"==tag.GetName())
1042 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1044 if(
"ScattPow1"==tag.GetAttributeName(i)) scattPow1=tag.GetAttributeValue(i);
1045 if(
"ScattPow2"==tag.GetAttributeName(i)) scattPow2=tag.GetAttributeValue(i);
1049 this->AddBondValenceRo(mScatteringPowerRegistry.GetObj(scattPow1),
1050 mScatteringPowerRegistry.GetObj(scattPow2),ro);
1053 if(
"AntiBumpScale"==tag.GetName())
1055 is>>mBumpMergeScale;
1058 if(
"BondValenceCostScale"==tag.GetName())
1060 is>>mBondValenceCostScale;
1063 if(
"InterMolecularDistRestr"==tag.GetName())
1072 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1074 if(
"At1"==tag.GetAttributeName(i)) {
1075 string tmpAt1=tag.GetAttributeValue(i);
1076 if(tmpAt1.length()==0) {
1080 stringstream ss(tmpAt1);
1082 while (ss >> word) {
1083 At1.push_back(word);
1090 if(
"At2"==tag.GetAttributeName(i)) {
1091 string tmpAt2=tag.GetAttributeValue(i);
1092 if(tmpAt2.length()==0) {
1096 stringstream ss(tmpAt2);
1098 while (ss >> word) {
1099 At2.push_back(word);
1106 if(
"Dist"==tag.GetAttributeName(i)) {
1107 Dist=tag.GetAttributeValue(i);
1108 if(Dist.length()==0) {
1113 if(
"Sigma"==tag.GetAttributeName(i)) {
1114 Sigma=tag.GetAttributeValue(i);
1115 if(Sigma.length()==0) {
1120 if(
"Delta"==tag.GetAttributeName(i)) {
1121 Delta=tag.GetAttributeValue(i);
1122 if(Delta.length()==0) {
1129 this->SetNewInterMolDist(At1, At2, stof(Dist), stof(Sigma), stof(Delta));
1133 if(
"InterMolDistScale"==tag.GetName())
1135 is>>mInterMolDistCostScale;
1138 if(
"mCostCalcMethod"==tag.GetName())
1140 is>>mCostCalcMethod;
1143 if(
"mDistMaxMultiplier"==tag.GetName())
1145 is>>mDistMaxMultiplier;
1148 if(
"Atom"==tag.GetName())
1150 VFN_DEBUG_ENTRY(
"Crystal::XMLInput():reading an Atom",5)
1154 this->AddScatterer(at);
1155 VFN_DEBUG_EXIT(
"Crystal::XMLInput():reading an Atom",5)
1158 if(
"ScatteringPowerAtom"==tag.GetName())
1160 VFN_DEBUG_ENTRY(
"Crystal::XMLInput():reading a ScatteringPowerAtom",5)
1161 VFN_DEBUG_MESSAGE(
"Crystal::XMLInput():reading a ScatteringPowerAtom",5)
1164 if(!mDeleteSubObjInDestructor)
1167 for(std::list<ScatteringPowerAtom*>::iterator pos= vold_scattpow.begin();
1168 pos!=vold_scattpow.end();++pos)
1170 if((*pos)->GetSymbol() != sc->
GetSymbol())
continue;
1171 if((*pos)->GetName() != sc->
GetName())
continue;
1172 if((*pos)->GetFormalCharge() != sc->GetFormalCharge())
continue;
1175 if((*pos)->IsIsotropic() != sc->
IsIsotropic())
continue;
1176 if(fabs((*pos)->GetBiso() - sc->
GetBiso()) > 1e-4f)
continue;
1177 if(!(*pos)->IsIsotropic())
1179 if(fabs((*pos)->GetBij(0) - sc->
GetBij(0)) > 1e-4f)
continue;
1180 if(fabs((*pos)->GetBij(1) - sc->
GetBij(1)) > 1e-4f)
continue;
1181 if(fabs((*pos)->GetBij(2) - sc->
GetBij(2)) > 1e-4f)
continue;
1182 if(fabs((*pos)->GetBij(3) - sc->
GetBij(3)) > 1e-4f)
continue;
1183 if(fabs((*pos)->GetBij(4) - sc->
GetBij(4)) > 1e-4f)
continue;
1184 if(fabs((*pos)->GetBij(5) - sc->
GetBij(5)) > 1e-4f)
continue;
1186 VFN_DEBUG_MESSAGE(
"Crystal::XMLInput(): reusing scattering power: "<<sc->
GetName(),5);
1191 this->AddScatteringPower(sc);
1192 VFN_DEBUG_EXIT(
"Crystal::XMLInput():reading a ScatteringPowerAtom",5)
1195 if(
"ScatteringPowerSphere"==tag.GetName())
1197 VFN_DEBUG_ENTRY(
"Crystal::XMLInput():reading a ScatteringPowerSphere",5)
1198 VFN_DEBUG_MESSAGE(
"Crystal::XMLInput():reading a ScatteringPowerSphere",5)
1201 this->AddScatteringPower(sc);
1202 VFN_DEBUG_EXIT(
"Crystal::XMLInput():reading a ScatteringPowerSphere",5)
1205 if(
"ZScatterer"==tag.GetName())
1207 VFN_DEBUG_ENTRY(
"Crystal::XMLInput():reading a ZScatterer",5)
1208 VFN_DEBUG_MESSAGE(
"Crystal::XMLInput():reading a ZScatterer",5)
1211 this->AddScatterer(z);
1212 VFN_DEBUG_EXIT(
"Crystal::XMLInput():reading a ZScatterer",5)
1215 if(
"Molecule"==tag.GetName())
1217 VFN_DEBUG_ENTRY(
"Crystal::XMLInput():reading a Molecule",5)
1218 VFN_DEBUG_MESSAGE(
"Crystal::XMLInput():reading a Molecule",5)
1221 this->AddScatterer(z);
1222 VFN_DEBUG_EXIT(
"Crystal::XMLInput():reading a Molecule",5)
1226 (*fpObjCrystInformUser)(
"XML: Finished loading Crystal:"+this->GetName());
1235 VFN_DEBUG_ENTRY(
"Radiation::XMLOutput():"<<this->GetName(),5)
1237 if(WAVELENGTH_ALPHA12==this->GetWavelengthType())
1238 tag.AddAttribute(
"XRayTube",mXRayTubeName);
1239 for(
int i=0;i<indent;i++) os <<
" " ;
1243 mRadiationType.XMLOutput(os,indent);
1246 mWavelengthType.XMLOutput(os,indent);
1249 for(
int i=0;i<indent;i++) os <<
" " ;
1252 os << tag2<< mLinearPolarRate;
1253 tag2.SetIsEndTag(
true);
1257 switch(this->GetWavelengthType())
1259 case WAVELENGTH_MONOCHROMATIC: this->GetPar(mWavelength.data()).XMLOutput(os,indent);
break;
1260 case WAVELENGTH_ALPHA12:
1262 this->GetPar(mWavelength.data()).XMLOutput(os,indent);
1264 this->GetPar(
"XRayTubeDeltaLambda").XMLOutput(os,indent);
1266 this->GetPar(
"XRayTubeAlpha2Alpha1Ratio").XMLOutput(os,indent);
1269 case WAVELENGTH_TOF:
break;
1275 tag.SetIsEndTag(
true);
1276 for(
int i=0;i<indent;i++) os <<
" " ;
1279 VFN_DEBUG_EXIT(
"Radiation::XMLOutput():"<<this->GetName(),5)
1284 VFN_DEBUG_ENTRY(
"Radiation::XMLInput():"<<this->GetName(),5)
1285 string scattPowName;
1286 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
1288 if(
"XRayTube"==tagg.GetAttributeName(i))
1289 if(tagg.GetAttributeValue(i)!=
"")
1290 this->SetWavelength(tagg.GetAttributeValue(i));
1296 if((
"Radiation"==tag.GetName())&&tag.IsEndTag())
1299 this->SetWavelengthType((
WavelengthType) mWavelengthType.GetChoice());
1300 VFN_DEBUG_EXIT(
"Radiation::Exit():"<<this->GetName(),5)
1303 if(
"Option"==tag.GetName())
1305 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1306 if(
"Name"==tag.GetAttributeName(i))
1308 if(
"Radiation"==tag.GetAttributeValue(i)) mRadiationType.XMLInput(is,tag);
1309 if(
"Spectrum"==tag.GetAttributeValue(i)) mWavelengthType.XMLInput(is,tag);
1312 if(
"LinearPolarRate"==tag.GetName())
1314 is>>mLinearPolarRate;
1317 if(
"XRayTubeDeltaLambda"==tag.GetName())
1319 is>>mXRayTubeDeltaLambda;
1322 if(
"XRayTubeAlpha2Alpha1Ratio"==tag.GetName())
1324 is>>mXRayTubeAlpha2Alpha1Ratio;
1327 if(
"Par"==tag.GetName())
1329 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1331 if(
"Name"==tag.GetAttributeName(i))
1333 if(
"Wavelength"==tag.GetAttributeValue(i))
1335 this->GetPar(mWavelength.data()).XMLInput(is,tag);
1338 if(
"XRayTubeDeltaLambda"==tag.GetAttributeValue(i))
1340 this->GetPar(
"XRayTubeDeltaLambda").XMLInput(is,tag);
1343 if(
"XRayTubeAlpha2Alpha1Ratio"==tag.GetAttributeValue(i))
1345 this->GetPar(
"XRayTubeAlpha2Alpha1Ratio").XMLInput(is,tag);
1361 VFN_DEBUG_ENTRY(
"DiffractionDataSingleCrystal::XMLOutput():"<<this->GetName(),5)
1362 for(
int i=0;i<indent;i++) os <<
" " ;
1364 tag.AddAttribute(
"Name",
mName);
1365 tag.AddAttribute(
"Crystal",this->GetCrystal().GetName());
1369 this->GetPar(
"Scale factor").XMLOutput(os,
"Scale factor",indent);
1372 mRadiation.XMLOutput(os,indent);
1375 this->GetPar(&mGlobalBiso).XMLOutput(os,
"globalBiso",indent);
1378 mGroupOption.XMLOutput(os,indent);
1381 for(
int i=0;i<indent;i++) os <<
" " ;
1383 os << tag2<< mMaxSinThetaOvLambda;
1384 tag2.SetIsEndTag(
true);
1385 os << tag2<<endl<<endl;
1387 if(mGroupOption.GetChoice()!=2)
1390 for(
int i=0;i<indent;i++) os <<
" " ;
1393 for(
long j=0;j<this->GetNbRefl();j++)
1395 for(
int i=0;i<=indent;i++) os <<
" " ;
1396 os << mIntH(j) <<
" "
1399 << mObsIntensity(j) <<
" "
1400 << mObsSigma(j) <<
" "
1405 tag3.SetIsEndTag(
true);
1406 for(
int i=0;i<indent;i++) os <<
" " ;
1412 for(
int i=0;i<indent;i++) os <<
" " ;
1416 for(
long j=0;j<mNbGroup;j++)
1422 tag4.AddAttribute(
"Iobs",s.str());
1427 tag4.AddAttribute(
"IobsSigma",s.str());
1432 tag4.AddAttribute(
"Weight",s.str());
1434 for(
int i=0;i<=indent;i++) os <<
" " ;
1436 for(
long k=first;k<mGroupIndex(j);k++)
1438 for(
int i=0;i<=indent;i++) os <<
" " ;
1439 os << mIntH(k) <<
" "<< mIntK(k) <<
" "<< mIntL(k) <<
" "<<endl;
1441 for(
int i=0;i<=indent;i++) os <<
" " ;
1442 tag4.SetIsEndTag(
true);
1444 first=mGroupIndex(j);
1447 tag3.SetIsEndTag(
true);
1448 for(
int i=0;i<indent;i++) os <<
" " ;
1453 tag.SetIsEndTag(
true);
1454 for(
int i=0;i<indent;i++) os <<
" " ;
1456 VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::XMLOutput():"<<this->GetName(),5)
1461 VFN_DEBUG_ENTRY(
"DiffractionDataSingleCrystal::XMLInput():"<<this->GetName(),5)
1462 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
1464 if(
"Name"==tagg.GetAttributeName(i)) this->SetName(tagg.GetAttributeValue(i));
1465 if(
"Crystal"==tagg.GetAttributeName(i))
1471 if((
"DiffractionDataSingleCrystal"==tag.GetName())&&tag.IsEndTag())
1473 this->UpdateDisplay();
1474 VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::XMLInput():"<<this->GetName(),5)
1477 if(
"Option"==tag.GetName())
1479 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1480 if(
"Name"==tag.GetAttributeName(i))
1482 string name=tag.GetAttributeValue(i);
1483 if(name==
"Twinning correction") name=
"Group Reflections";
1484 mOptionRegistry.GetObj(name).XMLInput(is,tag);
1488 if(
"Par"==tag.GetName())
1490 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1492 if(
"Name"==tag.GetAttributeName(i))
1494 if(
"Scale factor"==tag.GetAttributeValue(i))
1496 this->GetPar(&mScaleFactor).XMLInput(is,tag);
1502 if(
"Radiation"==tag.GetName()) mRadiation.XMLInput(is,tag);
1503 if(
"MaxSinThetaOvLambda"==tag.GetName())
1505 is>>mMaxSinThetaOvLambda;
1508 if(
"Par"==tag.GetName())
1510 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1512 if(
"Name"==tag.GetAttributeName(i))
1514 if(
"globalBiso"==tag.GetAttributeValue(i))
1516 this->GetPar(&mGlobalBiso).XMLInput(is,tag);
1522 if(
"HKLIobsSigmaWeightList"==tag.GetName())
1525 CrystVector_long h(100),k(100),l(100);
1526 CrystVector_REAL iobs(100),sigma(100),weight(100);
1529 is >>h(nbrefl)>>k(nbrefl)>>l(nbrefl);
1535 if(nbrefl==iobs.numElements())
1537 h.resizeAndPreserve(nbrefl+100);
1538 k.resizeAndPreserve(nbrefl+100);
1539 l.resizeAndPreserve(nbrefl+100);
1540 iobs.resizeAndPreserve(nbrefl+100);
1541 sigma.resizeAndPreserve(nbrefl+100);
1542 weight.resizeAndPreserve(nbrefl+100);
1544 while(0==isgraph(is.peek())) is.get();
1547 while(is.peek()!=
'<');
1550 h.resizeAndPreserve(nbrefl);
1551 k.resizeAndPreserve(nbrefl);
1552 l.resizeAndPreserve(nbrefl);
1553 iobs.resizeAndPreserve(nbrefl);
1554 sigma.resizeAndPreserve(nbrefl);
1555 weight.resizeAndPreserve(nbrefl);
1556 this->SetHklIobs(h,k,l,iobs,sigma);
1557 this->SetWeight(weight);
1558 this->SortReflectionBySinThetaOverLambda();
1560 this->FitScaleFactorForRw();
1562 if(
"HKLIobsSigmaWeightGROUPList"==tag.GetName())
1567 mGroupOption.SetChoice(2);
1569 mOptionRegistry.DeRegister(mGroupOption);
1570 mClockMaster.RemoveChild(mGroupOption.GetClock());
1574 mObsIntensity.resize(500);
1575 mObsSigma.resize(500);
1576 mGroupIndex.resize(500);
1577 mGroupIobs.resize(500);
1578 mGroupSigma.resize(500);
1579 mGroupWeight.resize(500);
1583 if(grouptag.GetName()==
"HKLIobsSigmaWeightGROUPList")
break;
1584 if(grouptag.GetName()==
"HKLGroup")
1586 for(
unsigned int i=0;i<grouptag.GetNbAttribute();++i)
1588 if(grouptag.GetAttributeName(i)==
"Iobs")
1591 sst<<grouptag.GetAttributeValue(i);
1592 sst>>mGroupIobs(mNbGroup);
1595 if(grouptag.GetAttributeName(i)==
"IobsSigma")
1598 sst<<grouptag.GetAttributeValue(i);
1599 sst>>mGroupSigma(mNbGroup);
1602 if(grouptag.GetAttributeName(i)==
"Weight")
1605 sst<<grouptag.GetAttributeValue(i);
1606 sst>>mGroupWeight(mNbGroup);
1610 VFN_DEBUG_MESSAGE(
"Group #"<<mNbGroup<<
" ,Iobs="<<mGroupIobs(mNbGroup)<<
" ,Sigma="<<mGroupSigma(mNbGroup)<<
" ,Weight="<<mGroupWeight(mNbGroup),2)
1613 is >>mH(mNbRefl)>>mK(mNbRefl)>>mL(mNbRefl);
1614 VFN_DEBUG_MESSAGE(
" "<<mH(mNbRefl)<<
" "<<mK(mNbRefl)<<
" "<<mL(mNbRefl),2)
1615 mGroupIndex(mNbRefl)=mNbGroup;
1617 if(mNbRefl==mH.numElements())
1619 mH.resizeAndPreserve(mNbRefl+500);
1620 mK.resizeAndPreserve(mNbRefl+500);
1621 mL.resizeAndPreserve(mNbRefl+500);
1622 mObsIntensity.resizeAndPreserve(mNbRefl+500);
1623 mObsSigma.resizeAndPreserve(mNbRefl+500);
1624 mGroupIndex.resizeAndPreserve(mNbRefl+500);
1626 while(0==isgraph(is.peek())) is.get();
1628 while(is.peek()!=
'<');
1630 if(++mNbGroup==mGroupIobs.numElements())
1632 mGroupIobs.resizeAndPreserve(mNbGroup+500);
1633 mGroupSigma.resizeAndPreserve(mNbGroup+500);
1634 mGroupWeight.resizeAndPreserve(mNbGroup+500);
1638 mH.resizeAndPreserve(mNbRefl);
1639 mK.resizeAndPreserve(mNbRefl);
1640 mL.resizeAndPreserve(mNbRefl);
1641 mObsIntensity.resizeAndPreserve(mNbRefl);
1642 mObsSigma.resizeAndPreserve(mNbRefl);
1643 mWeight.resizeAndPreserve(mNbRefl);
1644 mGroupIndex.resizeAndPreserve(mNbRefl);
1646 mGroupIobs.resizeAndPreserve(mNbGroup);
1647 mGroupWeight.resizeAndPreserve(mNbGroup);
1648 mGroupSigma.resizeAndPreserve(mNbGroup);
1650 mHasObservedData=
true;
1652 mMultiplicity.resize(mNbRefl);
1655 this->PrepareHKLarrays();
1656 this->SortReflectionBySinThetaOverLambda();
1667 VFN_DEBUG_ENTRY(
"PowderPatternBackground::XMLOutput():"<<this->GetName(),5)
1668 for(
int i=0;i<indent;i++) os <<
" " ;
1670 tag.AddAttribute(
"Name",this->GetName());
1674 mInterpolationModel.XMLOutput(os,indent);
1678 for(
int i=0;i<indent;i++) os <<
" " ;
1682 if(this->GetParentPowderPattern().GetRadiation().GetWavelengthType()!=WAVELENGTH_TOF)
1685 for(
long j=0;j<mBackgroundNbPoint;j++)
1688 for(
int i=0;i<=indent;i++) os <<
" " ;
1689 os << mBackgroundInterpPointX(j)*scale <<
" "
1690 << mBackgroundInterpPointIntensity(j) <<
" "
1691 << !this->GetPar(mBackgroundInterpPointIntensity.data()+j).IsFixed()<<
" "
1695 tag2.SetIsEndTag(
true);
1696 for(
int i=0;i<indent;i++) os <<
" " ;
1699 #ifdef USE_BACKGROUND_MAXLIKE_ERROR
1700 this->GetPar(
"ML Model Error").XMLOutput(os,
"ML Model Error",indent);
1705 tag.SetIsEndTag(
true);
1706 for(
int i=0;i<indent;i++) os <<
" " ;
1708 VFN_DEBUG_EXIT(
"PowderPatternBackground::XMLOutput():"<<this->GetName(),5)
1713 VFN_DEBUG_ENTRY(
"PowderPatternBackground::XMLInput():"<<this->GetName(),5)
1714 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
1716 if(
"Name"==tagg.GetAttributeName(i)) this->SetName(tagg.GetAttributeValue(i));
1717 if(
"Interpolation"==tagg.GetAttributeName(i))
1719 if(
"Linear"==tagg.GetAttributeValue(i)) mInterpolationModel.SetChoice(0);
1720 if(
"Spline"==tagg.GetAttributeValue(i)) mInterpolationModel.SetChoice(1);
1726 if((
"PowderPatternBackground"==tag.GetName())&&tag.IsEndTag())
1728 this->UpdateDisplay();
1729 VFN_DEBUG_EXIT(
"PowderPatternBackground::Exit():"<<this->GetName(),5)
1732 if((
"TThetaIntensityList"==tag.GetName())||(
"XIntensityList"==tag.GetName()))
1735 CrystVector_REAL bckgd2Theta(100);
1736 CrystVector_REAL bckgd(100);
1737 CrystVector_bool fix(100);
1740 VFN_DEBUG_MESSAGE(
"PowderPatternBackground::XMLInput():"<<mBackgroundNbPoint,1)
1741 is >>bckgd2Theta(nbPoint)
1745 if(nbPoint==bckgd2Theta.numElements())
1747 bckgd2Theta.resizeAndPreserve(nbPoint+100);
1748 bckgd.resizeAndPreserve(nbPoint+100);
1749 fix.resizeAndPreserve(nbPoint+100);
1751 while(0==isgraph(is.peek())) is.get();
1754 while(is.peek()!=
'<');
1755 bckgd2Theta.resizeAndPreserve(nbPoint);
1756 bckgd.resizeAndPreserve(nbPoint);
1757 if(this->GetParentPowderPattern().GetRadiation().GetWavelengthType()!=WAVELENGTH_TOF)
1758 bckgd2Theta*= DEG2RAD;
1759 this->SetInterpPoints(bckgd2Theta,bckgd);
1760 this->InitRefParList();
1764 if(
"Par"==tag.GetName())
1766 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1768 if(
"Name"==tag.GetAttributeName(i))
1770 if(
"ML Model Error"==tag.GetAttributeValue(i))
1772 #ifdef USE_BACKGROUND_MAXLIKE_ERROR
1773 this->GetPar(
"ML Model Error").XMLInput(is,tag);
1780 if(
"Option"==tag.GetName())
1782 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1783 if(
"Name"==tag.GetAttributeName(i))
1784 mOptionRegistry.GetObj(tag.GetAttributeValue(i)).XMLInput(is,tag);
1796 VFN_DEBUG_ENTRY(
"PowderPatternDiffraction::XMLOutput():"<<this->GetName(),5)
1797 for(
int i=0;i<indent;i++) os <<
" " ;
1799 tag.AddAttribute(
"Name",this->GetName());
1800 tag.AddAttribute(
"Crystal",this->GetCrystal().GetName());
1803 ss<<this->IsIgnoringImagScattFact();
1804 tag.AddAttribute(
"IgnoreImagScattFact",ss.str());
1809 if(mFreezeLatticePar)
1812 t.AddAttribute(
"a", (boost::format(
"%f")%mFrozenLatticePar(0)).str() );
1813 t.AddAttribute(
"b", (boost::format(
"%f")%mFrozenLatticePar(1)).str() );
1814 t.AddAttribute(
"c", (boost::format(
"%f")%mFrozenLatticePar(2)).str() );
1815 t.AddAttribute(
"alpha", (boost::format(
"%f")%(mFrozenLatticePar(3)*180/M_PI)).str() );
1816 t.AddAttribute(
"beta" , (boost::format(
"%f")%(mFrozenLatticePar(4)*180/M_PI)).str() );
1817 t.AddAttribute(
"gamma", (boost::format(
"%f")%(mFrozenLatticePar(5)*180/M_PI)).str() );
1818 t.SetIsEmptyTag(
true);
1819 for(
int i=0;i<indent;i++) os <<
" " ;
1823 if(mpReflectionProfile!=0) mpReflectionProfile->XMLOutput(os,indent);
1825 this->GetPar(&mGlobalBiso).XMLOutput(os,
"globalBiso",indent);
1828 if(mCorrTextureMarchDollase.GetNbPhase()>0)
1830 mCorrTextureMarchDollase.XMLOutput(os,indent);
1833 mCorrTextureEllipsoid.XMLOutput(os,indent);
1836 if(mFhklObsSq.numElements()>0)
1839 for(
int i=0;i<indent;i++) os <<
" " ;
1842 for(
long j=0;j<this->GetNbRefl();j++)
1844 for(
int i=0;i<=indent;i++) os <<
" " ;
1845 os << mIntH(j) <<
" "
1848 << mFhklObsSq(j) <<endl;
1851 tag2.SetIsEndTag(
true);
1852 for(
int i=0;i<indent;i++) os <<
" " ;
1856 if(mpLeBailData!=0) mpLeBailData->XMLOutput(os,indent);
1860 tag.SetIsEndTag(
true);
1861 for(
int i=0;i<indent;i++) os <<
" " ;
1863 VFN_DEBUG_EXIT(
"PowderPatternDiffraction::XMLOutput():"<<this->GetName(),5)
1868 VFN_DEBUG_ENTRY(
"PowderPatternDiffraction::XMLInput():"<<this->GetName(),5)
1869 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
1871 if(
"Name"==tagg.GetAttributeName(i)) this->SetName(tagg.GetAttributeValue(i));
1872 if(
"Crystal"==tagg.GetAttributeName(i))
1874 if(
"NeedLorentzCorr"==tagg.GetAttributeName(i))
1876 stringstream ss(tagg.GetAttributeValue(i));
1882 if(
"NeedPolarCorr"==tagg.GetAttributeName(i))
1884 stringstream ss(tagg.GetAttributeValue(i));
1890 if(
"Polar_AFactor"==tagg.GetAttributeName(i))
1892 stringstream ss(tagg.GetAttributeValue(i));
1898 if(
"NeedSlitApertureCorr"==tagg.GetAttributeName(i))
1900 stringstream ss(tagg.GetAttributeValue(i));
1906 if(
"IgnoreImagScattFact"==tagg.GetAttributeName(i))
1908 stringstream ss(tagg.GetAttributeValue(i));
1911 this->SetIsIgnoringImagScattFact(b);
1912 mClockLorentzPolarSlitCorrPar.Reset();
1918 if((
"PowderPatternCrystal"==tag.GetName())&&tag.IsEndTag())
1920 this->UpdateDisplay();
1921 VFN_DEBUG_EXIT(
"PowderPatternDiffraction::Exit():"<<this->GetName(),5)
1924 if(
"Par"==tag.GetName())
1926 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1928 if(
"Name"==tag.GetAttributeName(i))
1930 if(
"globalBiso"==tag.GetAttributeValue(i))
1932 this->GetPar(&mGlobalBiso).XMLInput(is,tag);
1935 if(
"U"==tag.GetAttributeValue(i))
1937 mpReflectionProfile->GetPar(
"U").XMLInput(is,tag);
1940 if(
"V"==tag.GetAttributeValue(i))
1942 mpReflectionProfile->GetPar(
"V").XMLInput(is,tag);
1945 if(
"W"==tag.GetAttributeValue(i))
1947 mpReflectionProfile->GetPar(
"W").XMLInput(is,tag);
1950 if(
"Eta0"==tag.GetAttributeValue(i))
1952 mpReflectionProfile->GetPar(
"Eta0").XMLInput(is,tag);
1955 if(
"Eta1"==tag.GetAttributeValue(i))
1957 mpReflectionProfile->GetPar(
"Eta1").XMLInput(is,tag);
1960 if(
"W0"==tag.GetAttributeValue(i))
1965 if(
"W1"==tag.GetAttributeValue(i))
1970 if(
"W2"==tag.GetAttributeValue(i))
1979 if(
"Option"==tag.GetName())
1981 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
1983 if(
"Name"==tag.GetAttributeName(i))
1985 if(
"Profile Type"!=tag.GetAttributeValue(i))
1986 mOptionRegistry.GetObj(tag.GetAttributeValue(i)).XMLInput(is,tag);
1991 if(
"TextureMarchDollase"==tag.GetName())
1993 mCorrTextureMarchDollase.XMLInput(is,tag);
1996 if(
"TextureEllipsoid"==tag.GetName())
1998 mCorrTextureEllipsoid.XMLInput(is,tag);
2001 if(
"ReflectionProfilePseudoVoigt"==tag.GetName())
2003 if(mpReflectionProfile==0)
2008 if(mpReflectionProfile->GetClassName()!=
"ReflectionProfilePseudoVoigt")
2012 mpReflectionProfile->XMLInput(is,tag);
2015 if(
"ReflectionProfilePseudoVoigtAnisotropic"==tag.GetName())
2017 if(mpReflectionProfile==0)
2022 if(mpReflectionProfile->GetClassName()!=
"ReflectionProfilePseudoVoigtAnisotropic")
2026 mpReflectionProfile->XMLInput(is,tag);
2029 if(
"ReflectionProfileDoubleExponentialPseudoVoigt"==tag.GetName())
2031 if(mpReflectionProfile==0)
2037 if(mpReflectionProfile->GetClassName()!=
"ReflectionProfileDoubleExponentialPseudoVoigt")
2041 mpReflectionProfile->XMLInput(is,tag);
2044 if(
"FhklObsSq"==tag.GetName())
2047 CrystVector_REAL iobs(100),sigma;
2048 CrystVector_long h(100),k(100),l(100);
2049 mFhklObsSq.resize(100);
2052 is >>h(nbrefl)>>k(nbrefl)>>l(nbrefl)>>iobs(nbrefl);
2054 if(nbrefl==h.numElements())
2056 h.resizeAndPreserve(nbrefl+100);
2057 k.resizeAndPreserve(nbrefl+100);
2058 l.resizeAndPreserve(nbrefl+100);
2059 iobs.resizeAndPreserve(nbrefl+100);
2061 while(0==isgraph(is.peek())) is.get();
2063 while(is.peek()!=
'<');
2065 h.resizeAndPreserve(nbrefl);
2066 k.resizeAndPreserve(nbrefl);
2067 l.resizeAndPreserve(nbrefl);
2068 iobs.resizeAndPreserve(nbrefl);
2069 sigma.resizeAndPreserve(nbrefl);
2074 mpLeBailData->SetHklIobs(h,k,l,iobs,sigma);
2075 mpLeBailData->SetWavelength(this->GetRadiation().GetWavelength()(0));
2076 mpLeBailData->SetRadiationType(this->GetRadiation().GetRadiationType());
2079 const REAL min=iobs.max()*1e-6;
2080 unsigned long iresol=0;
2081 for(
long i=0;i<nbrefl;++i)
if(iobs(i)>min) iresol=i;
2083 sprintf(buf,
"LeBail (d=%4.2fA?):",1/(2*abs(mpLeBailData->GetSinThetaOverLambda()(iresol))+1e-6));
2084 mpLeBailData->SetName(
string(buf)+this->GetCrystal().GetName());
2087 if(
"DiffractionDataSingleCrystal"==tag.GetName())
2090 mpLeBailData->XMLInput(is,tag);
2092 if(
"FrozenLatticePar"==tag.GetName())
2094 this->FreezeLatticePar(
true);
2095 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
2097 if(
"a"==tag.GetAttributeName(i))
2099 stringstream ss(tag.GetAttributeValue(i));
2103 this->SetFrozenLatticePar(0,v);
2105 if(
"b"==tag.GetAttributeName(i))
2107 stringstream ss(tag.GetAttributeValue(i));
2111 this->SetFrozenLatticePar(1,v);
2113 if(
"c"==tag.GetAttributeName(i))
2115 stringstream ss(tag.GetAttributeValue(i));
2119 this->SetFrozenLatticePar(2,v);
2121 if(
"alpha"==tag.GetAttributeName(i))
2123 stringstream ss(tag.GetAttributeValue(i));
2127 this->SetFrozenLatticePar(3,v*M_PI/180);
2129 if(
"beta"==tag.GetAttributeName(i))
2131 stringstream ss(tag.GetAttributeValue(i));
2135 this->SetFrozenLatticePar(4,v*M_PI/180);
2137 if(
"gamma"==tag.GetAttributeName(i))
2139 stringstream ss(tag.GetAttributeValue(i));
2143 this->SetFrozenLatticePar(5,v*M_PI/180);
2156 VFN_DEBUG_ENTRY(
"PowderPattern::XMLOutput():"<<this->GetName(),5)
2157 for(
int i=0;i<indent;i++) os <<
" " ;
2159 tag.AddAttribute(
"Name",
mName);
2163 this->GetPar(&mXZero).XMLOutput(os,
"Zero",indent);
2165 if(this->GetRadiation().GetWavelengthType()==WAVELENGTH_TOF)
2167 this->GetPar(&mDIFC).XMLOutput(os,
"TOF-DIFC",indent);
2170 this->GetPar(&mDIFA).XMLOutput(os,
"TOF-DIFA",indent);
2175 this->GetPar(&m2ThetaDisplacement).XMLOutput(os,
"2ThetaDisplacement",indent);
2178 this->GetPar(&m2ThetaTransparency).XMLOutput(os,
"2ThetaTransparency",indent);
2183 this->GetPar(&mMuR).XMLOutput(os,
"MuR",indent);
2187 for(
unsigned int i=0;i<this->GetNbOption();i++)
2189 this->GetOption(i).XMLOutput(os,indent);
2193 mRadiation.XMLOutput(os,indent);
2196 for(
int i=0;i<indent;i++) os <<
" " ;
2198 os << tag2<< mMaxSinThetaOvLambda;
2199 tag2.SetIsEndTag(
true);
2200 os << tag2<<endl<<endl;
2203 for(
int j=0;j<mPowderPatternComponentRegistry.GetNb();j++)
2205 mPowderPatternComponentRegistry.GetObj(j).XMLOutput(os,indent);
2206 XMLCrystTag tagg(
"PowderPatternComponent",
false,
true);
2209 ss<<mScaleFactor(j);
2210 tagg.AddAttribute(
"Scale",ss.str());
2212 tagg.AddAttribute(
"Name",mPowderPatternComponentRegistry.GetObj(j).GetName());
2214 for(
int i=0;i<indent;i++) os <<
" " ;
2215 os<<tagg<<endl<<endl;
2218 for(
int i=0;i<indent;i++) os <<
" " ;
2222 if(this->GetRadiation().GetWavelengthType()!=WAVELENGTH_TOF)
2225 for(
unsigned long j=0;j<this->GetNbPoint();j++)
2227 for(
int i=0;i<=indent;i++) os <<
" " ;
2228 os << scale*mX(j) <<
" "
2229 << mPowderPatternObs(j) <<
" "
2230 << mPowderPatternObsSigma(j) <<
" "
2231 << mPowderPatternWeight(j) <<
" "
2234 tag2.SetIsEndTag(
true);
2235 for(
int i=0;i<indent;i++) os <<
" " ;
2238 for(
int j=0;j<mExcludedRegionMinX.numElements();j++)
2241 for(
int i=0;i<indent;i++) os <<
" " ;
2242 if(this->GetRadiation().GetWavelengthType()==WAVELENGTH_TOF)
2245 << mExcludedRegionMinX(j) <<
" "
2246 << mExcludedRegionMaxX(j) ;
2251 << mExcludedRegionMinX(j)*RAD2DEG <<
" "
2252 << mExcludedRegionMaxX(j)*RAD2DEG ;
2254 tag3.SetIsEndTag(
true);
2260 tag.SetIsEndTag(
true);
2261 for(
int i=0;i<indent;i++) os <<
" " ;
2263 VFN_DEBUG_EXIT(
"PowderPattern::XMLOutput():"<<this->GetName(),5)
2268 VFN_DEBUG_ENTRY(
"PowderPattern::XMLInput():"<<this->GetName(),5)
2269 for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
2271 if(
"Name"==tagg.GetAttributeName(i)) this->SetName(tagg.GetAttributeValue(i));
2276 if((
"PowderPattern"==tag.GetName())&&tag.IsEndTag())
2278 this->UpdateDisplay();
2279 VFN_DEBUG_EXIT(
"PowderPattern::Exit():"<<this->GetName(),5)
2282 if(
"Radiation"==tag.GetName()) mRadiation.XMLInput(is,tag);
2283 if(
"MaxSinThetaOvLambda"==tag.GetName())
2285 is>>mMaxSinThetaOvLambda;
2288 if(
"Par"==tag.GetName())
2290 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
2292 if(
"Name"==tag.GetAttributeName(i))
2294 if((
"2ThetaZero"==tag.GetAttributeValue(i)) ||(
"Zero"==tag.GetAttributeValue(i)))
2296 this->GetPar(&mXZero).XMLInput(is,tag);
2299 if(
"2ThetaDisplacement"==tag.GetAttributeValue(i))
2301 this->GetPar(&m2ThetaDisplacement).XMLInput(is,tag);
2304 if(
"2ThetaTransparency"==tag.GetAttributeValue(i))
2306 this->GetPar(&m2ThetaTransparency).XMLInput(is,tag);
2309 if(
"TOF-DIFC"==tag.GetAttributeValue(i))
2311 this->GetPar(&mDIFC).XMLInput(is,tag);
2314 if(
"TOF-DIFA"==tag.GetAttributeValue(i))
2316 this->GetPar(&mDIFA).XMLInput(is,tag);
2319 if(
"MuR"==tag.GetAttributeValue(i))
2321 this->GetPar(&mMuR).XMLInput(is,tag);
2328 if(
"Option"==tag.GetName())
2330 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
2331 if(
"Name"==tag.GetAttributeName(i))
2332 mOptionRegistry.GetObj(tag.GetAttributeValue(i)).XMLInput(is,tag);
2335 if(
"PowderPatternBackground"==tag.GetName())
2342 if(
"PowderPatternCrystal"==tag.GetName())
2349 if(
"PowderPatternComponent"==tag.GetName())
2353 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
2355 if(
"Scale"==tag.GetAttributeName(i))
2357 stringstream ss(tag.GetAttributeValue(i));
2361 if(
"Name"==tag.GetAttributeName(i)) name=tag.GetAttributeValue(i);
2364 mScaleFactor(mPowderPatternComponentRegistry.GetNb()-1)=scale;
2365 VFN_DEBUG_MESSAGE(
"->Adding Component :"<<name<<
"with scale="<<scale,8);
2368 if(
"ExcludeX"==tag.GetName())
2372 if(this->GetRadiation().GetWavelengthType()==WAVELENGTH_TOF)
2373 this->AddExcludedRegion(min,max);
2374 else this->AddExcludedRegion(min*DEG2RAD,max*DEG2RAD);
2378 if(
"IobsSigmaWeightList"==tag.GetName())
2381 VFN_DEBUG_ENTRY(
"Loading Iobs-Sigma-Weight List...",8);
2383 for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
2385 if(
"TThetaMin"==tag.GetAttributeName(i))
2387 stringstream ss(tag.GetAttributeValue(i));
2389 VFN_DEBUG_MESSAGE(
"2Theta min="<<min,8);
2392 if(
"TThetaStep"==tag.GetAttributeName(i))
2394 stringstream ss(tag.GetAttributeValue(i));
2396 VFN_DEBUG_MESSAGE(
"2Theta step="<<step<<tag.GetAttributeValue(i),8);
2400 while(0==isgraph(is.peek())) is.get();
2403 cout <<
"PowderPattern::XMLInput(): no data point in the powder pattern !"<<endl;
2405 VFN_DEBUG_EXIT(
"Loading Iobs-Sigma-Weight List...",8);
2409 mPowderPatternObs.resize(500);
2410 mPowderPatternObsSigma.resize(500);
2411 mPowderPatternWeight.resize(500);
2414 is >>mPowderPatternObs(mNbPoint)
2415 >>mPowderPatternObsSigma(mNbPoint)
2416 >>mPowderPatternWeight(mNbPoint);
2418 VFN_DEBUG_MESSAGE(
"Point #"<<mNbPoint,5);
2419 if(mNbPoint==(
unsigned long)mPowderPatternObs.numElements())
2421 mPowderPatternObs.resizeAndPreserve(mNbPoint+500);
2422 mPowderPatternObsSigma.resizeAndPreserve(mNbPoint+500);
2423 mPowderPatternWeight.resizeAndPreserve(mNbPoint+500);
2425 while(0==isgraph(is.peek())) is.get();
2427 while(is.peek()!=
'<');
2428 this->SetPowderPatternPar(min,step,mNbPoint);
2429 mClockPowderPatternPar.Click();
2432 VFN_DEBUG_EXIT(
"Loading Iobs-Sigma-Weight List...",8);
2435 if(
"XIobsSigmaWeightList"==tag.GetName())
2437 VFN_DEBUG_ENTRY(
"Loading X-Iobs-Sigma-Weight List...",8);
2438 while(0==isgraph(is.peek())) is.get();
2441 cout <<
"PowderPattern::XMLInput(): no data point in the powder pattern !"<<endl;
2443 VFN_DEBUG_EXIT(
"Loading Iobs-Sigma-Weight List...",8);
2448 mPowderPatternObs.resize(500);
2449 mPowderPatternObsSigma.resize(500);
2450 mPowderPatternWeight.resize(500);
2454 >>mPowderPatternObs(mNbPoint)
2455 >>mPowderPatternObsSigma(mNbPoint)
2456 >>mPowderPatternWeight(mNbPoint);
2458 VFN_DEBUG_MESSAGE(
"Point #"<<mNbPoint,5);
2459 if(mNbPoint==(
unsigned long)mPowderPatternObs.numElements())
2461 mX.resizeAndPreserve(mNbPoint+500);
2462 mPowderPatternObs.resizeAndPreserve(mNbPoint+500);
2463 mPowderPatternObsSigma.resizeAndPreserve(mNbPoint+500);
2464 mPowderPatternWeight.resizeAndPreserve(mNbPoint+500);
2466 while(0==isgraph(is.peek())) is.get();
2468 while(is.peek()!=
'<');
2469 mX.resizeAndPreserve(mNbPoint);
2470 if(this->GetRadiation().GetWavelengthType()!=WAVELENGTH_TOF)
2472 this->SetPowderPatternX(mX);
2475 VFN_DEBUG_EXIT(
"Loading X-Iobs-Sigma-Weight List...",8);
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
void XMLCrystFileLoadObject(const string &filename, const string &tagName, const string &name, T *obj)
Load an object from a file, identifying it from its tag.
ObjRegistry< OptimizationObj > gOptimizationObjRegistry("List of all Optimization objects")
Global Registry for all OptimizationObj.
ObjRegistry< PowderPatternComponent > gPowderPatternComponentRegistry("List of all PowderPattern Components")
Global registry for all PowderPatternComponent objects.
WavelengthType
Incident beam characteristics : monochromatic, X-Ray tube with Alpha1 and alpha2, MAD (a few waveleng...
float string2floatC(const string &s)
Function to convert a substring to a floating point value, imposing a C locale (using '.
bool ISNAN_OR_INF(REAL r)
Test if the value is a NaN.
void XMLCrystFileLoadAllObject(const string &filename)
Load all 'top' objects from a file (Crystal, PowderPattern, DiffDataSingleCrystal and GlobalOptimObj ...
float InputFloat(istream &is, const char endchar)
Safely read a floating-point value from a stream.
ObjRegistry< Crystal > gCrystalRegistry("List of all Crystals")
Global registry for all Crystal objects.
ObjRegistry< DiffractionDataSingleCrystal > gDiffractionDataSingleCrystalRegistry("Global DiffractionDataSingleCrystal Registry")
Global registry for all PowderPattern objects.
void XMLCrystFileSaveGlobal(const string &filename)
Save all Objcryst++ objects.
ObjRegistry< XMLCrystTag > XMLCrystFileLoadObjectList(const string &filename)
Get the list (tags) of ObjCryst objects in a file.
The basic atom scatterer, in a crystal.
const ScatteringPower * mpScattPowAtom
The ScatteringPowerAtom associated to that atom.
void Init(const REAL x, const REAL y, const REAL z, const string &name, const ScatteringPower *pow, const REAL popu=1)
initialize the atom (used for arrays of atoms).
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
ObjRegistry< ScatteringPower > & GetScatteringPowerRegistry()
Get the registry of ScatteringPower included in this Crystal.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input the crystal structure from a stream.
DiffractionData object for Single Crystal analysis.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Exception class for ObjCryst++ library.
Molecule : class for complex scatterer descriptions using cartesian coordinates with bond length/angl...
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Phase to compute a background contribution to a powder pattern using an interpolation.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void SetParentPowderPattern(PowderPattern &)
Set the PowderPattern object which uses this component.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Class to compute the contribution to a powder pattern from a crystalline phase.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
virtual void SetParentPowderPattern(PowderPattern &)
Set the PowderPattern object which uses this component.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Pseudo-Voigt reflection profile.
Pseudo-Voigt reflection profile, with 6-parameters anisotropic Lorentzian broadening and Toraya asymm...
Double-Exponential Pseudo-Voigt profile for TOF.
const Crystal & GetCrystal() const
In which crystal is this Scatterer included ?
CrystVector_REAL mXYZ
coordinates of the scatterer (or of its center..)
void SetCrystal(Crystal &)
Set the crystal in which is included this Scatterer.
REAL mOccupancy
Occupancy : 0 <= occ <= 1 For a multi-atom scatterer (polyhedron,..), this is the overall occupancy o...
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Abstract Base Class to describe the scattering power of any Scatterer component in a crystal.
float mColourRGB[3]
Colour for this ScatteringPower using RGB.
bool mIsIsotropic
Is the scattering isotropic ?
bool IsIsotropic() const
Returns true if the scattering power is isotropic, else false.
REAL GetBiso() const
Returns the isotropic temperature B factor.
REAL GetBij(const size_t &i, const size_t &j) const
Returns the anisotropic temperature B factor for (i, j) pair.
CrystVector_REAL mB
Anisotropic B(ij)
REAL GetMaximumLikelihoodNbGhostAtom() const
Maximum Likelihood: get the number of ghost elements per asymmetric unit.
REAL mBiso
Temperature isotropic B factor.
void SetColour(const string &colorName)
Set the colour from the associated POV-Ray name.
REAL GetMaximumLikelihoodPositionError() const
Maximum Likelihood: get the estimated error (sigma) on the positions for this kind of element.
The Scattering Power for an Atom.
virtual const string & GetSymbol() const
Returns the symbol ('Ta', 'O2-',...) of the atom.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
string mSymbol
Symbol of this atom.
void Init()
Initialization of the object, used by all constructors, and operator=.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
\ brief ScatteringPower for a spherical particule
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Class for individual atoms in a ZScatterer Object.
long GetZAngleAtom() const
Index of the 2nd atom used to define the atom in the Z-Matrix (the one from which the angle is calcul...
long GetZDihedralAngleAtom() const
Index of the 3rd atom used to define the atom in the Z-Matrix (the one from which the dihedral angle ...
const ZScatterer & GetZScatterer() const
Get the ZScatterer associated to this ZAtom.
void SetScatteringPower(const ScatteringPower *)
Set the ScatteringPower.
long mAtomBond
The index (in the ZScatterer) of the atoms which are used to define the position of this atom.
string mName
Name for this atom.
REAL mBondLength
Bond length, angle and dihedral angle.
long GetZBondAtom() const
Index of the 1st atom used to define the atom in the Z-Matrix (the one from which the bondlength is c...
const ScatteringPower * GetScatteringPower() const
ScatteringPower for this atom.
ZScatterer: the basic type of complex scatterers, where atom positions are defined using a standard "...
const ObjRegistry< ZAtom > & GetZAtomRegistry() const
Access to the registry of ZAtoms.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
class to input or output a well-formatted xml beginning or ending tag.
void XMLOutput(ostream &os, const string &name, int indent=0) const
XMLOutput to stream in well-formed XML.
void XMLInput(istream &is, const XMLCrystTag &tag)
XMLInput From stream.
T & GetObj(const unsigned int i)
Get object #i in the registry.
long GetNb() const
Get the index of an object in the registry, from its name Warning: it can change if an object is remo...
void Register(T &obj)
Register a new object. Already registered objects are skipped.
virtual void SetName(const string &name)
Name of the object.
RefinablePar & GetPar(const long i)
Access all parameters in the order they were inputted.
virtual const string & GetName() const
Name of the object.
string mName
Name for this RefinableObject. Should be unique, at least in the same scope.+.