本文整理汇总了C++中readLabel函数的典型用法代码示例。如果您正苦于以下问题:C++ readLabel函数的具体用法?C++ readLabel怎么用?C++ readLabel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readLabel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: time_
//- Construct from Time and timeDict
timeFluxData::timeFluxData
(
Time& t,
const dictionary& timeDict
)
:
time_(t),
writeInterval_(readScalar(t.controlDict().lookup("writeInterval"))),
writeIntSteps_(label(writeInterval_/t.deltaT().value() + 0.5)),
mdTime_(1, readScalar(time_.controlDict().lookup("deltaT"))),
averagingTime_(readLabel(timeDict.lookup("nAverages"))),
controlTime_(readLabel(timeDict.lookup("nControls"))),
writeTime_(writeIntSteps_, writeInterval_),
nAvTimeSteps_("nAvTimeSteps_", dimless, 0.0),
nControlSteps_(0.0),
totalNAvSteps_(0),
totalNContSteps_(0),
totalNWrSteps_(0),
controlTimeIndex_(0),
averagingTimeIndex_(0)
// controlTimes_(),
// averagingTimes_()
{
setInitialData();
}
示例2: nHeaderLine_
Foam::Function1Types::CSV<Type>::CSV
(
const word& entryName,
const dictionary& dict
)
:
TableBase<Type>(entryName, dict),
nHeaderLine_(readLabel(dict.lookup("nHeaderLine"))),
refColumn_(readLabel(dict.lookup("refColumn"))),
componentColumns_(dict.lookup("componentColumns")),
separator_(dict.lookupOrDefault<string>("separator", string(","))[0]),
mergeSeparators_(readBool(dict.lookup("mergeSeparators"))),
fName_(dict.lookup("file"))
{
if (componentColumns_.size() != pTraits<Type>::nComponents)
{
FatalErrorInFunction
<< componentColumns_ << " does not have the expected length of "
<< pTraits<Type>::nComponents << endl
<< exit(FatalError);
}
read();
TableBase<Type>::check();
}
示例3: patchIdentifier
Foam::polyPatch::polyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
patchIdentifier(name, dict, index),
primitivePatch
(
faceSubList
(
bm.mesh().faces(),
readLabel(dict.lookup("nFaces")),
readLabel(dict.lookup("startFace"))
),
bm.mesh().points()
),
start_(readLabel(dict.lookup("startFace"))),
boundaryMesh_(bm),
faceCellsPtr_(NULL),
mePtr_(NULL)
{
if
(
patchType != word::null
&& constraintType(patchType)
&& findIndex(inGroups(), patchType) == -1
)
{
inGroups().append(patchType);
}
}
示例4: maxGlobalCells_
Foam::refinementParameters::refinementParameters(const dictionary& dict)
:
maxGlobalCells_(readLabel(dict.lookup("maxGlobalCells"))),
maxLocalCells_(readLabel(dict.lookup("maxLocalCells"))),
minRefineCells_(readLabel(dict.lookup("minRefinementCells"))),
nBufferLayers_(readLabel(dict.lookup("nCellsBetweenLevels"))),
keepPoints_(pointField(1, dict.lookup("locationInMesh"))),
allowFreeStandingZoneFaces_
(
dict.lookupOrDefault<Switch>
(
"allowFreeStandingZoneFaces",
true
)
),
maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
{
scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle")));
if (featAngle < 0 || featAngle > 180)
{
curvature_ = -GREAT;
}
else
{
curvature_ = Foam::cos(featAngle*mathematicalConstant::pi/180.0);
}
}
示例5: error
Foam::IOerror::IOerror(const dictionary& errDict)
:
error(errDict),
ioFileName_(errDict.lookup("ioFileName")),
ioStartLineNumber_(readLabel(errDict.lookup("ioStartLineNumber"))),
ioEndLineNumber_(readLabel(errDict.lookup("ioEndLineNumber")))
{}
示例6: coeffs_
Foam::CSV<Type>::CSV
(
const word& entryName,
const dictionary& dict,
const word& ext
)
:
DataEntry<Type>(entryName),
TableBase<Type>(entryName, dict.subDict(type() + ext)),
coeffs_(dict.subDict(type() + ext)),
nHeaderLine_(readLabel(coeffs_.lookup("nHeaderLine"))),
refColumn_(readLabel(coeffs_.lookup("refColumn"))),
componentColumns_(coeffs_.lookup("componentColumns")),
separator_(coeffs_.lookupOrDefault<string>("separator", string(","))[0]),
mergeSeparators_(readBool(coeffs_.lookup("mergeSeparators"))),
fName_(coeffs_.lookup("fileName"))
{
if (componentColumns_.size() != pTraits<Type>::nComponents)
{
FatalErrorIn("Foam::CSV<Type>::CSV(const word&, Istream&)")
<< componentColumns_ << " does not have the expected length of "
<< pTraits<Type>::nComponents << endl
<< exit(FatalError);
}
read();
TableBase<Type>::check();
}
示例7: geometricSurfacePatch
// Construct from Istream
Foam::surfacePatch::surfacePatch(Istream& is, const label index)
:
geometricSurfacePatch(is, index),
size_(0),
start_(0)
{
size_ = readLabel(is);
start_ = readLabel(is);
}
示例8: faceCells_
Foam::procLduInterface::procLduInterface(Istream& is)
:
faceCells_(is),
coeffs_(is),
myProcNo_(readLabel(is)),
neighbProcNo_(readLabel(is)),
tag_(readLabel(is)),
comm_(readLabel(is))
{}
示例9: injectorType
// Construct from components
Foam::multiHoleInjector::multiHoleInjector
(
const Foam::Time& t,
const Foam::dictionary& dict
)
:
injectorType(t, dict),
propsDict_(dict.subDict(typeName + "Props")),
centerPosition_(propsDict_.lookup("position")),
xyAngle_(readScalar(propsDict_.lookup("xyAngle"))),
zAngle_(readScalar(propsDict_.lookup("zAngle"))),
nHoles_(readLabel(propsDict_.lookup("nHoles"))),
umbrellaAngle_(readScalar(propsDict_.lookup("umbrellaAngle"))),
nozzleTipDiameter_(readScalar(propsDict_.lookup("nozzleTipDiameter"))),
angleSpacing_(propsDict_.lookup("angleSpacing")),
d_(readScalar(propsDict_.lookup("diameter"))),
Cd_(readScalar(propsDict_.lookup("Cd"))),
mass_(readScalar(propsDict_.lookup("mass"))),
nParcels_(readLabel(propsDict_.lookup("nParcels"))),
X_(propsDict_.lookup("X")),
massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
velocityProfile_(massFlowRateProfile_),
injectionPressureProfile_(massFlowRateProfile_),
CdProfile_(massFlowRateProfile_),
TProfile_(propsDict_.lookup("temperatureProfile")),
averageParcelMass_(nHoles_*mass_/nParcels_),
direction_(nHoles_),
position_(nHoles_),
pressureIndependentVelocity_(true),
tangentialInjectionVector1_(nHoles_),
tangentialInjectionVector2_(nHoles_)
{
// check if time entries for soi and eoi match
if (mag(massFlowRateProfile_[0][0]-TProfile_[0][0]) > SMALL)
{
FatalError << "multiHoleInjector::multiHoleInjector(const time& t, const dictionary dict) " << endl
<< " start-times do not match for TemperatureProfile and massFlowRateProfile."
<< abort(FatalError);
}
if (mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]-TProfile_[TProfile_.size()-1][0]) > SMALL)
{
FatalError << "multiHoleInjector::multiHoleInjector(const time& t, const dictionary dict) " << endl
<< " end-times do not match for TemperatureProfile and massFlowRateProfile."
<< abort(FatalError);
}
// convert CA to real time
forAll(massFlowRateProfile_, i)
{
massFlowRateProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]);
velocityProfile_[i][0] = massFlowRateProfile_[i][0];
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
}
示例10: nAverages
void timeFluxData::setTimeData(const dictionary& timeDict)
{
const label nAverages(readLabel(timeDict.lookup("nAverages")));
const label nControls(readLabel(timeDict.lookup("nControls")));
averagingTime_.nSteps() = nAverages;
controlTime_.nSteps() = nControls;
setInitialData();
}
示例11: engineSearch
// Construct from components
engineSearchIB::engineSearchIB
(
const dictionary& dict,
cfdemCloud& sm
)
:
engineSearch(dict.subDict(typeName + "Props"),sm),
propsDict_(dict.subDict(typeName + "Props")),
zSplit_(readLabel(propsDict_.lookup("zSplit"))),
xySplit_(readLabel(propsDict_.lookup("xySplit")))
{}
示例12: origProcOfOther_
Foam::PairCollisionRecord<Type>::PairCollisionRecord(Istream& is)
:
origProcOfOther_(readLabel(is)),
origIdOfOther_(readLabel(is)),
data_(is)
{
// Check state of Istream
is.check
(
"Foam::PairCollisionRecord<Type>::PairCollisionRecord(Foam::Istream&)"
);
}
示例13: tolerance_
Foam::BlockIterativeSolver<Type>::BlockIterativeSolver
(
const word& fieldName,
const BlockLduMatrix<Type>& matrix,
const dictionary& dict
)
:
BlockLduSolver<Type>(fieldName, matrix, dict),
tolerance_(readScalar(this->dict().lookup("tolerance"))),
relTolerance_(readScalar(this->dict().lookup("relTol"))),
minIter_(readLabel(this->dict().lookup("minIter"))),
maxIter_(readLabel(this->dict().lookup("maxIter")))
{}
示例14: trackInterval_
Foam::ParticleTracks<CloudType>::ParticleTracks
(
const dictionary& dict,
CloudType& owner
)
:
CloudFunctionObject<CloudType>(dict, owner, typeName),
trackInterval_(readLabel(this->coeffDict().lookup("trackInterval"))),
maxSamples_(readLabel(this->coeffDict().lookup("maxSamples"))),
resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
faceHitCounter_(),
cloudPtr_(NULL)
{}
示例15: N0
pointField quadrilateralDistribution::evaluate()
{
// Read needed material
label N0( readLabel(pointDict_.lookup("N0")) );
label N1( readLabel(pointDict_.lookup("N1")) );
point xs0( pointDict_.lookup("linestart0") );
point xe0( pointDict_.lookup("lineend0") );
point xe1( pointDict_.lookup("lineend1") );
scalar stretch0( pointDict_.lookupOrDefault<scalar>("stretch0", 1.0) );
scalar stretch1( pointDict_.lookupOrDefault<scalar>("stretch1", 1.0) );
// Define the return field
pointField res(N0*N1, xs0);
// Compute the scaling factor
scalar factor0(0.0);
scalar factor1(0.0);
for (int i=1; i < N0; i++)
{
factor0 += Foam::pow( stretch0, static_cast<scalar>(i) );
}
for (int i=1; i < N1; i++)
{
factor1 += Foam::pow( stretch1, static_cast<scalar>(i) );
}
point dx0( (xe0 - xs0)/factor0 );
point dx1( (xe1 - xs0)/factor1 );
// Compute points
for (int j=0; j < N1; j++)
{
if (j != 0)
{
res[j*N0] = res[(j - 1)*N0]
+ Foam::pow( stretch1, static_cast<scalar>(j))*dx1;
}
for (int i=1; i < N0; i++)
{
res[i + j*N0] = res[i - 1 + j*N0]
+ Foam::pow( stretch0, static_cast<scalar>(i) )*dx0;
}
}
return res;
}