@@ -93,7 +93,8 @@ CrystVector_REAL UnitCell::GetLatticePar() const
93
93
{
94
94
VFN_DEBUG_MESSAGE (" UnitCell::GetLatticePar()" ,0 )
95
95
96
- if (mClockLatticeParUpdate >mClockLatticePar ) return mCellDim ;
96
+ if ( (mClockLatticeParUpdate >mClockLatticePar )
97
+ &&(mClockLatticeParUpdate >mSpaceGroup .GetClockSpaceGroup ())) return mCellDim ;
97
98
else
98
99
{
99
100
// :NOTE: cannot use this->UpdateLatticePar() because it is not a const member function
@@ -164,7 +165,8 @@ REAL UnitCell::GetLatticePar(int whichPar)const
164
165
if ( (whichPar<0 ) || (whichPar>5 ))
165
166
throw ObjCrystException (" UnitCell::LatticePar(int) :trying to access parameter>5!" );
166
167
167
- if (mClockLatticeParUpdate >mClockLatticePar ) return mCellDim (whichPar);
168
+ if ( (mClockLatticeParUpdate >mClockLatticePar )
169
+ &&(mClockLatticeParUpdate >mSpaceGroup .GetClockSpaceGroup ())) return mCellDim (whichPar);
168
170
else
169
171
{
170
172
const int num = mSpaceGroup .GetSpaceGroupNumber ();
@@ -320,6 +322,14 @@ void UnitCell::Print(ostream &os)const
320
322
const SpaceGroup & UnitCell::GetSpaceGroup () const {return mSpaceGroup ;}
321
323
SpaceGroup & UnitCell::GetSpaceGroup () {return mSpaceGroup ;}
322
324
325
+ void UnitCell::ChangeSpaceGroup (const string &spgId)
326
+ {
327
+ this ->GetSpaceGroup ().ChangeSpaceGroup (spgId);
328
+ this ->InitRefParList ();
329
+ this ->UpdateLatticePar ();
330
+ }
331
+
332
+
323
333
const RefinableObjClock& UnitCell::GetClockLatticePar ()const {return mClockLatticePar ;}
324
334
const RefinableObjClock& UnitCell::GetClockMetricMatrix ()const {return mClockMetricMatrix ;}
325
335
@@ -344,6 +354,9 @@ void UnitCell::Init(const REAL a, const REAL b, const REAL c, const REAL alpha,
344
354
// mSpaceGroup.Print();
345
355
mSpaceGroup .ChangeSpaceGroup (SpaceGroupId);
346
356
// mSpaceGroup.Print();
357
+ if ((alpha<=0 )||(alpha>=M_PI)) throw ObjCrystException (" alpha must be within ]0;pi[" );
358
+ if ((beta<=0 ) ||(beta>=M_PI)) throw ObjCrystException (" beta must be within ]0;pi[" );
359
+ if ((gamma <=0 )||(gamma >=M_PI)) throw ObjCrystException (" gamma must be within ]0;pi[" );
347
360
mCellDim (0 )=a;
348
361
mCellDim (1 )=b;
349
362
mCellDim (2 )=c;
@@ -390,7 +403,8 @@ void UnitCell::InitMatrices() const
390
403
{
391
404
// :NOTE: The Matrices must remain upper triangular, since this is assumed for
392
405
// optimization purposes in some procedures.
393
- if (mClockMetricMatrix >mClockLatticePar ) return ;// no need to update
406
+ if ( (mClockMetricMatrix >mClockLatticePar )
407
+ &&(mClockMetricMatrix >mSpaceGroup .GetClockSpaceGroup ())) return ;// no need to update
394
408
// this->UpdateLatticePar(); we should be able to do this...
395
409
396
410
VFN_DEBUG_MESSAGE (" UnitCell::InitMatrices() for crystal : " +this ->GetName (),5 )
0 commit comments