本文整理汇总了C++中IOobject::readOpt方法的典型用法代码示例。如果您正苦于以下问题:C++ IOobject::readOpt方法的具体用法?C++ IOobject::readOpt怎么用?C++ IOobject::readOpt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOobject
的用法示例。
在下文中一共展示了IOobject::readOpt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Foam::IOobject Foam::fv::IOoptionList::createIOobject
(
const fvMesh& mesh
) const
{
IOobject io
(
"fvOptions",
mesh.time().system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.headerOk())
{
Info<< "Creating fintite volume options from " << io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
}
else
{
Info<< "No finite volume options present" << nl << endl;
io.readOpt() = IOobject::NO_READ;
return io;
}
}
示例2: regIOobject
Foam::IOList<T>::IOList(const IOobject& io)
:
regIOobject(io)
{
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOList::IOList(const IOobject&)")
<< "IOList " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOList does not support automatic rereading."
<< endl;
}
if
(
(
io.readOpt() == IOobject::MUST_READ
|| io.readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
示例3: searchableSurface
Foam::binaryOperationSearchableSurface::binaryOperationSearchableSurface
(
const IOobject& io,
const dictionary& dict
)
:
searchableSurface(io),
aName_(dict.lookupOrDefault<word>("aName","A")),
bName_(dict.lookupOrDefault<word>("bName","B")),
a_(
searchableSurface::New
(
word(dict.subDict("a").lookup("type")),
IOobject(
name()+"_"+word(dict.lookup("type"))+"_"+aName_,
io.instance(),
io.db(),
io.readOpt(),
io.writeOpt()
),
dict.subDict("a")
)
),
b_(
searchableSurface::New
(
word(dict.subDict("b").lookup("type")),
IOobject(
name()+"_"+word(dict.lookup("type"))+"_"+bName_,
io.instance(),
io.db(),
io.readOpt(),
io.writeOpt()
),
dict.subDict("b")
)
),
nrARegions_(
a().regions().size()
),
nrBRegions_(
b().regions().size()
)
{
if(aName_==bName_) {
FatalErrorIn("binaryOperationSearchableSurface::binaryOperationSearchableSurface")
<< "'aName' and 'bName' have the same value " << aName_
<< " for " << name()
<< endl
<< exit(FatalError);
}
if(regions().size()!=size()) {
FatalErrorIn("binaryOperationSearchableSurface::binaryOperationSearchableSurface")
<< "Number of regions " << regions().size() << " not equal to size "
<< size() << nl << "Regions: " << regions()
<< endl
<< exit(FatalError);
}
}
示例4:
Foam::IOobject Foam::IOporosityModelList::createIOobject
(
const fvMesh& mesh
) const
{
IOobject io
(
"porosityProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.typeHeaderOk<IOdictionary>(true))
{
Info<< "Creating porosity model list from " << io.name() << nl << endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
}
else
{
Info<< "No porosity models present" << nl << endl;
io.readOpt() = IOobject::NO_READ;
return io;
}
}
示例5: regIOobject
Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
:
regIOobject(io)
{
// Temporary warning
if (debug && io.readOpt() == IOobject::MUST_READ)
{
WarningIn
(
"IOdictionary::IOdictionary(const IOobject& const dictionary&)"
) << "Dictionary " << name()
<< " constructed with IOobject::MUST_READ"
" instead of IOobject::MUST_READ_IF_MODIFIED." << nl
<< "Use MUST_READ_IF_MODIFIED if you need automatic rereading."
<< endl;
}
// Everyone check or just master
bool masterOnly =
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster;
// Check if header is ok for READ_IF_PRESENT
bool isHeaderOk = false;
if (io.readOpt() == IOobject::READ_IF_PRESENT)
{
if (masterOnly)
{
if (Pstream::master())
{
isHeaderOk = headerOk();
}
Pstream::scatter(isHeaderOk);
}
else
{
isHeaderOk = headerOk();
}
}
if
(
(
io.readOpt() == IOobject::MUST_READ
|| io.readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
|| isHeaderOk
)
{
readFile(masterOnly);
}
else
{
dictionary::operator=(dict);
}
dictionary::name() = IOobject::objectPath();
}
示例6:
Foam::IOobject Foam::IOMRFZoneList::createIOobject
(
const fvMesh& mesh
) const
{
IOobject io
(
"MRFProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.headerOk())
{
Info<< "Creating MRF zone list from " << io.name() << endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
}
else
{
Info<< "No MRF models present" << nl << endl;
io.readOpt() = IOobject::NO_READ;
return io;
}
}
示例7: regIOobject
Foam::IOList<T>::IOList(const IOobject& io)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
示例8: regIOobject
Foam::featureEdgeMesh::featureEdgeMesh(const IOobject& io)
:
regIOobject(io),
edgeMesh(pointField(0), edgeList(0))
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
示例9: regIOobject
Foam::IOPtrList<T>::IOPtrList(const IOobject& io)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
PtrList<T>::read(readStream(typeName), INew<T>());
close();
}
}
示例10: regIOobject
IOPatchToPatchInterpolation<FromPatch, ToPatch>::IOPatchToPatchInterpolation
(
const IOobject& io,
const FromPatch& fromPatch,
const ToPatch& toPatch,
intersection::algorithm alg,
const intersection::direction dir
)
:
regIOobject(io),
PatchToPatchInterpolation<FromPatch, ToPatch>(fromPatch, toPatch, alg, dir)
{
if (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
{
Istream& is = readStream(typeName);
labelList* paPtr = new labelList(is);
FieldField<Field, scalar>* pwPtr = new FieldField<Field, scalar>(is);
scalarField* pdPtr = new scalarField(is);
labelList* faPtr = new labelList(is);
FieldField<Field, scalar>* fwPtr = new FieldField<Field, scalar>(is);
scalarField* fdPtr = new scalarField(is);
Info << "Setting weights from file" << endl;
this->setWeights(paPtr, pwPtr, pdPtr, faPtr, fwPtr, fdPtr);
}
}
示例11: regIOobject
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const INew& inewt)
:
regIOobject(io)
{
if
(
(
io.readOpt() == IOobject::MUST_READ
|| io.readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
PtrList<T>::read(readStream(typeName), inewt);
close();
}
}
示例12: regIOobject
Foam::IOEquationReader::IOEquationReader
(
const IOobject& io,
const bool showDataSourceInfo
)
:
regIOobject(io),
showDataSourceInfo_(showDataSourceInfo)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
示例13: regIOobject
Foam::IOField<Type>::IOField(const IOobject& io)
:
regIOobject(io)
{
// Check for MUST_READ_IF_MODIFIED
warnNoRereading<IOField<Type>>();
if
(
(
io.readOpt() == IOobject::MUST_READ
|| io.readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readStream(typeName) >> *this;
close();
}
示例14: regIOobject
Foam::IOReferencer<Type>::IOReferencer
(
const IOobject& io
)
:
regIOobject(io),
typePtr_(NULL)
{
if
(
io.readOpt() != IOobject::NO_READ
|| io.writeOpt() != IOobject::NO_WRITE
)
{
FatalErrorIn("IOReferencer<Type>::IOReferencer")
<< "IOReferencer can only be NO_READ, NO_WRITE."
<< abort(FatalError);
}
}
示例15: pts
Foam::binaryOperationSearchableSurface::binaryOperationSearchableSurface
(
const IOobject& io,
const dictionary& dict
)
:
searchableSurface(io),
aName_(dict.lookupOrDefault<word>("aName","A")),
bName_(dict.lookupOrDefault<word>("bName","B")),
a_(
searchableSurface::New
(
word(dict.subDict("a").lookup("type")),
IOobject(
name()+"_"+word(dict.lookup("type"))+"_"+aName_,
io.instance(),
io.db(),
io.readOpt(),
io.writeOpt()
),
dict.subDict("a")
)
),
b_(
searchableSurface::New
(
word(dict.subDict("b").lookup("type")),
IOobject(
name()+"_"+word(dict.lookup("type"))+"_"+bName_,
io.instance(),
io.db(),
io.readOpt(),
io.writeOpt()
),
dict.subDict("b")
)
),
nrARegions_(
a().regions().size()
),
nrBRegions_(
b().regions().size()
)
{
if(aName_==bName_) {
FatalErrorIn("binaryOperationSearchableSurface::binaryOperationSearchableSurface")
<< "'aName' and 'bName' have the same value " << aName_
<< " for " << name()
<< endl
<< exit(FatalError);
}
if(regions().size()!=size()) {
FatalErrorIn("binaryOperationSearchableSurface::binaryOperationSearchableSurface")
<< "Number of regions " << regions().size() << " not equal to size "
<< size() << nl << "Regions: " << regions()
<< endl
<< exit(FatalError);
}
#ifdef FOAM_SEARCHABLE_SURF_HAS_BOUND_METHOD
pointField pts(4);
pts[0]=a().bounds().min();
pts[1]=a().bounds().max();
pts[2]=b().bounds().min();
pts[3]=b().bounds().max();
bounds()=boundBox(pts);
#endif
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-swak4Foam-dev,代码行数:69,代码来源:binaryOperationSearchableSurface.C