Skip to content

Commit a55f20d

Browse files
committed
Throw an exception if alpha, beta or gamma are not within ]0;pi[ in UnitCell::Init()
1 parent c36a34a commit a55f20d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ObjCryst/ObjCryst/UnitCell.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ void UnitCell::Init(const REAL a, const REAL b, const REAL c, const REAL alpha,
344344
//mSpaceGroup.Print();
345345
mSpaceGroup.ChangeSpaceGroup(SpaceGroupId);
346346
//mSpaceGroup.Print();
347+
if((alpha<=0)||(alpha>=M_PI)) throw ObjCrystException("alpha must be within ]0;pi[");
348+
if((beta<=0) ||(beta>=M_PI)) throw ObjCrystException("beta must be within ]0;pi[");
349+
if((gamma<=0)||(gamma>=M_PI)) throw ObjCrystException("gamma must be within ]0;pi[");
347350
mCellDim(0)=a;
348351
mCellDim(1)=b;
349352
mCellDim(2)=c;

0 commit comments

Comments
 (0)