本文整理汇总了C++中UnitCell::a方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitCell::a方法的具体用法?C++ UnitCell::a怎么用?C++ UnitCell::a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitCell
的用法示例。
在下文中一共展示了UnitCell::a方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: round
// Wrap a vector in an Orthorombic UnitCell
static Vector3D wrap_orthorombic(const UnitCell& cell, const Vector3D& vect) {
Vector3D res;
res[0] = static_cast<float>(vect[0] - round(vect[0]/cell.a())*cell.a());
res[1] = static_cast<float>(vect[1] - round(vect[1]/cell.b())*cell.b());
res[2] = static_cast<float>(vect[2] - round(vect[2]/cell.c())*cell.c());
return res;
}
示例2:
TEST(UnitCellTest, cellParameters)
{
Real a = static_cast<Real>(2.0);
Real b = static_cast<Real>(3.0);
Real c = static_cast<Real>(4.0);
Real alpha = static_cast<Real>(70 * DEG_TO_RAD);
Real beta = static_cast<Real>(120 * DEG_TO_RAD);
Real gamma = static_cast<Real>(85 * DEG_TO_RAD);
UnitCell unitCell;
unitCell.setCellParameters(a, b, c, alpha, beta, gamma);
EXPECT_FLOAT_EQ(static_cast<float>(a), static_cast<float>(unitCell.a()));
EXPECT_FLOAT_EQ(static_cast<float>(b), static_cast<float>(unitCell.b()));
EXPECT_FLOAT_EQ(static_cast<float>(c), static_cast<float>(unitCell.c()));
EXPECT_FLOAT_EQ(static_cast<float>(alpha),
static_cast<float>(unitCell.alpha()));
EXPECT_FLOAT_EQ(static_cast<float>(beta),
static_cast<float>(unitCell.beta()));
EXPECT_FLOAT_EQ(static_cast<float>(gamma),
static_cast<float>(unitCell.gamma()));
}
示例3: getConstrainedUnitCell
/** Returns a new UnitCell-object with crystal system constraints taken into
*account
*
* This method constructs a new UnitCell-object based on the values of the
*supplied cell,
* but takes into account the constraints of the crystal system. For
*monoclinic, a unique b-axis is assumed.
*
* It's useful for "cleaning" user input.
*
* @param unitCell :: UnitCell-object which should be constrained
* @param crystalSystem :: Crystal system which is used for constraints
* @return UnitCell-object with applied constraints
*/
UnitCell PoldiCreatePeaksFromCell::getConstrainedUnitCell(
const UnitCell &unitCell,
const PointGroup::CrystalSystem &crystalSystem) const {
switch (crystalSystem) {
case PointGroup::Cubic:
return UnitCell(unitCell.a(), unitCell.a(), unitCell.a());
case PointGroup::Tetragonal:
return UnitCell(unitCell.a(), unitCell.a(), unitCell.c());
case PointGroup::Orthorhombic:
return UnitCell(unitCell.a(), unitCell.b(), unitCell.c());
case PointGroup::Monoclinic:
return UnitCell(unitCell.a(), unitCell.b(), unitCell.c(), 90.0,
unitCell.beta(), 90.0);
case PointGroup::Hexagonal:
return UnitCell(unitCell.a(), unitCell.a(), unitCell.c(), 90.0, 90.0,
120.0);
case PointGroup::Trigonal:
return UnitCell(unitCell.a(), unitCell.a(), unitCell.a(), unitCell.alpha(),
unitCell.alpha(), unitCell.alpha());
default:
return UnitCell(unitCell);
}
}
示例4: max
/// Returns the largest possible lattice spacing for the given cell.
double
PoldiCreatePeaksFromCell::getLargestDValue(const UnitCell &unitCell) const {
return std::max(std::max(unitCell.a(), unitCell.b()), unitCell.c());
}