本文整理汇总了C++中openstudio::createIPForce方法的典型用法代码示例。如果您正苦于以下问题:C++ openstudio::createIPForce方法的具体用法?C++ openstudio::createIPForce怎么用?C++ openstudio::createIPForce使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openstudio
的用法示例。
在下文中一共展示了openstudio::createIPForce方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG
TEST_F(UnitsFixture,IPUnit_ArithmeticOperators)
{
LOG(Debug,"IPUnit_ArithmeticOperators");
IPUnit u1;
IPUnit u2 = createIPForce();
IPUnit u3(IPExpnt(1));
u1 *= u3;
testStreamOutput("lb_m",u1);
Unit u4 = u2*u3;
ASSERT_TRUE(u4.system() == UnitSystem::IP);
testStreamOutput("lb_m*lb_f",u4);
u4.cast<IPUnit>().lbfToLbm();
testStreamOutput("lb_m^2*ft/s^2",u4);
Unit u5 = u4/u3;
EXPECT_TRUE(u5.system() == UnitSystem::IP);
EXPECT_TRUE(u5 == u2);
Unit u6 = pow(u5,-6);
EXPECT_TRUE(u6.system() == UnitSystem::IP);
testStreamOutput("s^12/lb_m^6*ft^6",u6);
u6.pow(1,3);
testStreamOutput("s^4/lb_m^2*ft^2",u6);
}
示例2: createIPMass
TEST_F(UnitsFixture,IPUnit_createFunctions)
{
IPUnit u;
u = createIPMass();
EXPECT_EQ(1,u.baseUnitExponent("lb_m"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("lb_m",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createIPLength();
EXPECT_EQ(1,u.baseUnitExponent("ft"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("ft",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createIPTime();
EXPECT_EQ(1,u.baseUnitExponent("s"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("s",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createIPTemperature();
EXPECT_EQ(1,u.baseUnitExponent("R"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("R",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createIPPeople();
EXPECT_EQ(1,u.baseUnitExponent("people"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("people",u.standardString());
EXPECT_EQ("",u.prettyString());
u.pow(-1);
EXPECT_EQ("1/person",u.standardString());
u = createIPCurrency();
EXPECT_EQ(1, u.baseUnitExponent("$"));
EXPECT_EQ(0, u.scale().exponent);
EXPECT_EQ("$", u.standardString());
EXPECT_EQ("", u.prettyString());
u.pow(-1);
EXPECT_EQ("1/$", u.standardString());
u = createIPForce();
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("lb_f",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createIPEnergy();
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("ft*lb_f",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createIPPower();
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("ft*lb_f/s",u.standardString());
EXPECT_EQ("",u.prettyString());
}