当前位置: 首页>>代码示例>>C++>>正文


C++ Ostream::good方法代码示例

本文整理汇总了C++中Ostream::good方法的典型用法代码示例。如果您正苦于以下问题:C++ Ostream::good方法的具体用法?C++ Ostream::good怎么用?C++ Ostream::good使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ostream的用法示例。


在下文中一共展示了Ostream::good方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: baseFld

bool Foam::volFieldStreamReconstructor<Type>::decompose
(
    const parUnallocatedFvFieldReconstructor& reconstructor,
    const unallocatedFvMesh& baseMesh,
    const IOobject& baseIO,

    const unallocatedFvMesh& thisMesh,
    const IOobject& thisIO,
    const bool,
    Ostream& os
) const
{
    typedef GeometricField<Type, unallocatedFvPatchField, unallocatedVolMesh>
        GeoField;

    // Read base field
    Info<< "Reading " << baseIO.objectPath() << endl;
    const GeoField baseFld(baseIO, baseMesh);

    // Decompose
    tmp<GeoField> tfld(reconstructor.decomposeFvVolumeField(baseFld));

    // Stream
    Pout<< incrIndent;
    os << tfld();
    Pout<< decrIndent;

    return os.good();
}
开发者ID:mattijsjanssens,项目名称:mattijs-extensions,代码行数:29,代码来源:volFieldStreamReconstructor.C

示例2: writeBanner

bool Foam::IOobject::writeHeader(Ostream& os, const word& type) const
{
    if (!os.good())
    {
        Info<< "IOobject::writeHeader(Ostream&) : "
            << "no stream open for write" << nl
            << os.info() << endl;

        return false;
    }

    writeBanner(os)
        << "FoamFile\n{\n"
        << "    version     " << os.version() << ";\n"
        << "    format      " << os.format() << ";\n"
        << "    class       " << type << ";\n";

    if (note().size())
    {
        os  << "    note        " << note() << ";\n";
    }

    os  << "    location    " << instance()/local() << ";\n"
        << "    object      " << name() << ";\n"
        << "}" << nl;

    writeDivider(os) << endl;

    return true;
}
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:30,代码来源:IOobjectWriteHeader.C

示例3:

bool Foam::constSolidThermo::writeData(Ostream& os) const
{
    bool ok = basicSolidThermo::writeData(os);
    os.writeKeyword("rho") << constRho_ << token::END_STATEMENT << nl;
    os.writeKeyword("Cp") << constCp_ << token::END_STATEMENT << nl;
    os.writeKeyword("K") << constK_ << token::END_STATEMENT << nl;
    os.writeKeyword("Hf") << constHf_ << token::END_STATEMENT << nl;
    os.writeKeyword("kappa") << constKappa_ << token::END_STATEMENT << nl;
    os.writeKeyword("sigmaS") << constSigmaS_ << token::END_STATEMENT << nl;
    os.writeKeyword("emissivity") << constEmissivity_ << token::END_STATEMENT
        << nl;
    return ok && os.good();
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:13,代码来源:constSolidThermo.C

示例4: forAllConstIter

bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
{
    os<< cloud_.size() << nl << token::BEGIN_LIST << nl;

    forAllConstIter(typename Cloud<ParticleType>, cloud_, iter)
    {
        os<< static_cast<const Particle<ParticleType>&>(iter()) << nl;
    }

    os<< token::END_LIST << endl;

    return os.good();
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:13,代码来源:IOPosition.C

示例5:

bool IOPatchToPatchInterpolation<FromPatch, ToPatch>::writeData
(
    Ostream& os
) const
{
    os << this->pointAddr() << nl;
    os << this->pointWeights() << nl;
    os << this->pointDistanceToIntersection() << nl;
    os << this->faceAddr() << nl;
    os << this->faceWeights() << nl;
    os << this->faceDistanceToIntersection() << nl;
    return os.good();
}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:13,代码来源:IOPatchToPatchInterpolation.C

示例6:

bool Foam::interpolateSolid::writeData(Ostream& os) const
{

    os.writeKeyword("TValues") << TValues_ << token::END_STATEMENT << nl;
    os.writeKeyword("rhoValues") << rhoValues_ << token::END_STATEMENT << nl;
    os.writeKeyword("cpValues") << cpValues_ << token::END_STATEMENT << nl;
    os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
    os.writeKeyword("emissivityValues") << emissivityValues_ << nl;
    os.writeKeyword("kappaValues") << kappaValues_ << nl;
    os.writeKeyword("sigmaSValues") << sigmaSValues_
        << token::END_STATEMENT << nl;

    return os.good();
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-2.0.x,代码行数:14,代码来源:interpolateSolid.C

示例7:

bool Foam::passiveParticleStreamReconstructor::decompose
(
    const parUnallocatedFvFieldReconstructor& reconstructor,
    const unallocatedFvMesh& baseMesh,
    const IOobject& baseIO,

    const unallocatedFvMesh& thisMesh,
    const IOobject& thisIO,
    const bool,
    Ostream& os
) const
{
    Pout<< "*** LAGRANGIAN DEcomposing " << baseIO.objectPath() << endl;
    Pout<< "** LAGRANGIAN Decomposed " << baseIO.objectPath() << endl;
    return os.good();
}
开发者ID:mattijsjanssens,项目名称:mattijs-extensions,代码行数:16,代码来源:passiveParticleStreamReconstructor.C

示例8: write

bool JobInfo::write(Ostream& JobInfoFile) const
{
    if (writeJobInfo && Pstream::master())
    {
        if (JobInfoFile.good())
        {
            dictionary::write(JobInfoFile, false);
            return true;
        }
        else
        {
            return false;
        }
    }
    else
    {
        return true;
    }
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:19,代码来源:JobInfo.C

示例9: forAllConstIter

bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
{
    os<< cloud_.size() << nl << token::BEGIN_LIST << nl;

    forAllConstIter(typename Cloud<ParticleType>, cloud_, iter)
    {
        // Prevent writing additional fields
        static_cast<const Particle<ParticleType>&>(iter()).write
        (
            os,
            false
        );
        os  << nl;
    }

    os<< token::END_LIST << endl;

    return os.good();
}
开发者ID:Ingenierias2003,项目名称:OpenFOAM-1.7.x,代码行数:19,代码来源:IOPosition.C

示例10:

bool Foam::JobInfo::write(Ostream& os) const
{
    if (writeJobInfo && Pstream::master())
    {
        if (os.good())
        {
            dictionary::write(os, false);
            return true;
        }
        else
        {
            return false;
        }
    }
    else
    {
        return true;
    }
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:19,代码来源:JobInfo.C

示例11: dimensions

bool DimensionedField<Type, GeoMesh>::writeData
(
    Ostream& os,
    const word& fieldDictEntry
) const
{
    os.writeKeyword("dimensions") << dimensions() << token::END_STATEMENT
        << nl << nl;

    Field<Type>::writeEntry(fieldDictEntry, os);

    // Check state of Ostream
    os.check
    (
        "bool DimensionedField<Type, GeoMesh>::writeData"
        "(Ostream& os, const word& fieldDictEntry) const"
    );

    return (os.good());
}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:20,代码来源:DimensionedFieldIO.C

示例12:

bool Foam::sixDOFqODE::writeData(Ostream& os) const
{
    os << *this;
    return os.good();
}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:5,代码来源:sixDOFqODE.C

示例13: if


//.........这里部分代码省略.........
            new cloud
            (
                procMesh.thisDb(),
                "kinematicCloud"
            )
        );

        procFields.set
        (
            proci,
            new unallocatedIOPosition
            (
                IOobject
                (
                    io.name(),
                    io.instance(),
                    io.local(),
                    procClouds[proci],
                    IOobject::MUST_READ,    //IOobject::READ_IF_PRESENT,
                    IOobject::NO_WRITE
                )
            )
        );

        Pout<< decrIndent;
    }

    unallocatedIOPosition particles
    (
        IOobject
        (
            io.name(),
            io.instance(),
            io.local(),
            io.db(),
            IOobject::NO_READ,
            IOobject::NO_WRITE,
            false
        )
    );

    const faceList* facesPtr = nullptr;
    if (isA<polyMesh>(io.db().parent()))
    {
        facesPtr = &dynamic_cast<const polyMesh&>(io.db().parent()).faces();
    }

    forAll(procFields, proci)
    {
        const unallocatedIOPosition& procCloud = procFields[proci];
        const labelList& cellMap = reconstructor.cellProcAddressing()[proci];
        const labelList& faceMap = reconstructor.faceProcAddressing()[proci];

        forAllConstIter(typename IDLList<basicParticle>, procCloud, iter)
        {
            const basicParticle& p = iter();

            const label mappedCell = cellMap[p.cell()];

            const label mapi = faceMap[p.tetFace()];

            label mappedTetFace = -1;
            label tetPti = p.tetPt();
            if (mapi == 0)
            {
                FatalErrorInFunction << "problem" << exit(FatalError);
            }
            else if (mapi > 0)
            {
                mappedTetFace = mapi - 1;
            }
            else
            {
                mappedTetFace = -mapi - 1;

                if (facesPtr)
                {
                    // Flipping face

                    const face& f = (*facesPtr)[mappedTetFace];
                    tetPti = f.size() - 1 - tetPti;
                }
            }

            particles.append
            (
                new basicParticle
                (
                    p,
                    mappedCell,
                    mappedTetFace,
                    tetPti
                )
            );
        }
    }
    particles.writeData(os);

    return os.good();
}
开发者ID:mattijsjanssens,项目名称:mattijs-extensions,代码行数:101,代码来源:passiveParticleStreamReconstructor.C

示例14:

// writeData member function required by regIOobject
bool Foam::surfacePatchIOList::writeData(Ostream& os) const
{
    os  << *this;
    return os.good();
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:6,代码来源:surfacePatchIOList.C

示例15:

bool Foam::IOReferencer<Type>::writeData(Ostream& os) const
{
    // do nothing
    return os.good();
}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:5,代码来源:IOReferencer.C


注:本文中的Ostream::good方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。