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


C++ IOobject::name方法代码示例

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


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

示例1: dict

void replaceBoundaryType
(
    const fvMesh& mesh,
    const word& fieldName,
    const word& boundaryType,
    const string& boundaryValue
)
{
    IOobject header
    (
        fieldName,
        mesh.time().timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
    );

    if (!header.headerOk())
    {
        return;
    }

    Info<< "Updating boundary types for field " << header.name() << endl;

    const word oldTypeName = IOdictionary::typeName;
    const_cast<word&>(IOdictionary::typeName) = word::null;

    IOdictionary dict(header);

    const_cast<word&>(IOdictionary::typeName) = oldTypeName;
    const_cast<word&>(dict.type()) = dict.headerClassName();

    // Make a backup of the old file
    if (mvBak(dict.objectPath(), "old"))
    {
        Info<< "    Backup original file to "
            << (dict.objectPath() + ".old") << endl;
    }

    // Loop through boundary patches and update
    const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
    dictionary& boundaryDict = dict.subDict("boundaryField");
    forAll(bMesh, patchI)
    {
        if (isA<wallPolyPatch>(bMesh[patchI]))
        {
            word patchName = bMesh[patchI].name();
            dictionary& oldPatch = boundaryDict.subDict(patchName);

            dictionary newPatch(dictionary::null);
            newPatch.add("type", boundaryType);
            newPatch.add("value", ("uniform " + boundaryValue).c_str());

            oldPatch = newPatch;
        }
    }

    Info<< "    writing updated " << dict.name() << nl << endl;
    dict.regIOobject::write();
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:60,代码来源:applyWallFunctionBoundaryConditions.C

示例2: surfaceRegistry

Foam::surfMesh::surfMesh(const IOobject& io, const word& surfName)
:
    surfaceRegistry(io.db(), (surfName.size() ? surfName : io.name())),
    Allocator
    (
        IOobject
        (
            "points",
            time().findInstance(meshDir(), "points"),
            meshSubDir,
            *this,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        ),
        IOobject
        (
            "faces",
            time().findInstance(meshDir(), "faces"),
            meshSubDir,
            *this,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        ),
        IOobject
        (
            "surfZones",
            time().findInstance(meshDir(), "surfZones"),
            meshSubDir,
            *this,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        )
    ),
    MeshReference(this->storedIOFaces(), this->storedIOPoints())
{}
开发者ID:Cescfangs,项目名称:OpenFOAM-1.7.x,代码行数:35,代码来源:surfMesh.C

示例3: forAll

Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
Foam::fvFieldReconstructor::reconstructFvVolumeField
(
    const IOobject& fieldIoObject
)
{
    // Read the field for all the processors
    PtrList<GeometricField<Type, fvPatchField, volMesh> > procFields
    (
        procMeshes_.size()
    );

    forAll (procMeshes_, procI)
    {
        procFields.set
        (
            procI,
            new GeometricField<Type, fvPatchField, volMesh>
            (
                IOobject
                (
                    fieldIoObject.name(),
                    procMeshes_[procI].time().timeName(),
                    procMeshes_[procI],
                    IOobject::MUST_READ,
                    IOobject::NO_WRITE
                ),
                procMeshes_[procI]
            )
        );
    }
开发者ID:Brzous,项目名称:WindFOAM,代码行数:31,代码来源:fvFieldReconstructorReconstructFields.C

示例4:

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;
    }
}
开发者ID:mattijsjanssens,项目名称:OpenFOAM-dev,代码行数:29,代码来源:IOMRFZoneList.C

示例5: forAll

tmp<GeometricField<Type, tetPolyPatchField, tetPointMesh> >
tetPointFieldReconstructor::reconstructTetPointField
(
    const IOobject& fieldIoObject
)
{
    // Read the field for all the processors
    PtrList<GeometricField<Type, tetPolyPatchField, tetPointMesh> > procFields
    (
        procMeshes_.size()
    );

    forAll (procMeshes_, procI)
    {
        procFields.set
        (
            procI,
            new GeometricField<Type, tetPolyPatchField, tetPointMesh>
            (
                IOobject
                (
                    fieldIoObject.name(),
                    procMeshes_[procI]().time().timeName(),
                    procMeshes_[procI](),
                    IOobject::MUST_READ,
                    IOobject::NO_WRITE
                ),
                procMeshes_[procI]
            )
        );
    }
开发者ID:GoldenMan123,项目名称:openfoam-extend-foam-extend-3.1,代码行数:31,代码来源:tetPointFieldReconstructorReconstructFields.C

示例6: forAll

Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> >
Foam::fvFieldReconstructor::reconstructFvVolumeInternalField
(
    const IOobject& fieldIoObject
) const
{
    // Read the field for all the processors
    PtrList<DimensionedField<Type, volMesh> > procFields
    (
        procMeshes_.size()
    );

    forAll(procMeshes_, procI)
    {
        procFields.set
        (
            procI,
            new DimensionedField<Type, volMesh>
            (
                IOobject
                (
                    fieldIoObject.name(),
                    procMeshes_[procI].time().timeName(),
                    procMeshes_[procI],
                    IOobject::MUST_READ,
                    IOobject::NO_WRITE
                ),
                procMeshes_[procI]
            )
        );
    }
开发者ID:0184561,项目名称:OpenFOAM-2.1.x,代码行数:31,代码来源:fvFieldReconstructorReconstructFields.C

示例7: forAll

Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
{
    // Read the field for all the processors
    PtrList<GeometricField<Type, pointPatchField, pointMesh>> procFields
    (
        procMeshes_.size()
    );

    forAll(procMeshes_, proci)
    {
        procFields.set
        (
            proci,
            new GeometricField<Type, pointPatchField, pointMesh>
            (
                IOobject
                (
                    fieldIoObject.name(),
                    procMeshes_[proci]().time().timeName(),
                    procMeshes_[proci](),
                    IOobject::MUST_READ,
                    IOobject::NO_WRITE
                ),
                procMeshes_[proci]
            )
        );
    }
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:28,代码来源:pointFieldReconstructorReconstructFields.C

示例8:

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;
    }
}
开发者ID:petebachant,项目名称:OpenFOAM-dev,代码行数:29,代码来源:IOporosityModelList.C

示例9:

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;
    }
}
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:30,代码来源:fvIOoptionList.C

示例10: field

void Foam::calcTypes::minMaxMag::writeMinMaxMagField
(
    const IOobject& header,
    const fvMesh& mesh,
    bool& processed
)
{
    typedef GeometricField<Type, fvPatchField, volMesh> fieldType;

    if (header.headerClassName() == fieldType::typeName)
    {
        Info<< "    Reading " << header.name() << endl;
        fieldType field(header, mesh);

        Info<< "    Calculating min" << header.name() << ": " << Foam::gMin(Foam::mag(field)()) << endl;
        Info<< "    Calculating max" << header.name() << ": " << Foam::gMax(Foam::mag(field)()) << endl;

        processed = true;
    }
}
开发者ID:Kiiree,项目名称:CONSELFcae-dev,代码行数:20,代码来源:writeMinMaxMagField.C

示例11: tfld

Foam::tmp<GeoField> Foam::uniformInterpolate
(
    const IOobject& fieldIO,
    const word& fieldName,
    const wordList& times,
    const scalarField& weights,
    const objectRegistry& fieldsCache
)
{
    // Look up the first field
    const objectRegistry& time0Fields = fieldsCache.lookupObject
    <
        const objectRegistry
    >
    (
        times[0]
    );
    const GeoField& field0 = time0Fields.lookupObject
    <
        const GeoField
    >
    (
        fieldName
    );


    // Interpolate
    tmp<GeoField> tfld(GeoField::New(fieldIO.name(), weights[0]*field0));
    GeoField& fld = tfld.ref();

    for (label i = 1; i < times.size(); ++i)
    {
        const objectRegistry& timeIFields = fieldsCache.lookupObject
        <
            const objectRegistry
        >
        (
            times[i]
        );
        const GeoField& fieldi = timeIFields.lookupObject
        <
            const GeoField
        >
        (
            fieldName
        );

        fld += weights[i]*fieldi;
    }

    return tfld;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:52,代码来源:uniformInterpolate.C

示例12: field

void Foam::calcTypes::domainIntegrate::calcDomainIntegrate
(
    const IOobject& header,
    const fvMesh& mesh,
    bool& processed
)
{
    typedef GeometricField<Type, fvPatchField, volMesh> fieldType;

    if (header.headerClassName() == fieldType::typeName)
    {
        Info<< "    Reading " << header.name() << endl;
        fieldType field(header, mesh);

        Info<< "    Calculating domain integral for field "
            << header.name() << nl
            << "    " << fvc::domainIntegrate(field)
            << endl;

        processed = true;
    }
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:foam-extend-foam-extend-3.2,代码行数:22,代码来源:calcDomainIntegrate.C

示例13: field

void printIntegrate
(
    const fvMesh& mesh,
    const IOobject& fieldHeader,
    const label patchI,
    bool& done
)
{
    if (!done && fieldHeader.headerClassName() == FieldType::typeName)
    {
        Info<< "    Reading " << fieldHeader.headerClassName() << " "
            << fieldHeader.name() << endl;

        FieldType field(fieldHeader, mesh);

        Info<< "    Integral of " << fieldHeader.name()
            << " over vector area of patch "
            << mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
            << gSum
               (
                   mesh.Sf().boundaryField()[patchI]
                  *field.boundaryField()[patchI]
               )
            << nl;

        Info<< "    Integral of " << fieldHeader.name()
            << " over area magnitude of patch "
            << mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
            << gSum
               (
                   mesh.magSf().boundaryField()[patchI]
                  *field.boundaryField()[patchI]
               )
            << nl;

        done = true;
    }
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:38,代码来源:patchIntegrate.C

示例14: field

void printIntegrate
(
    const fvMesh& mesh,
    const IOobject& fieldHeader,
    bool& done
)
{
    if (!done && fieldHeader.headerClassName() == FieldType::typeName)
    {
        Info<< "    Reading " << fieldHeader.headerClassName() << " "
            << fieldHeader.name() << endl;

        FieldType field(fieldHeader, mesh);

        Info<< "    Integral of " << fieldHeader.name()
            << " over full fluid volume = "
            << gSum(mesh.V()*field.internalField()) << " "
            << field.dimensions()*dimVolume
            << nl;

        done = true;
    }
}
开发者ID:lento234,项目名称:OF-2.3.x,代码行数:23,代码来源:fieldIntegrate.C

示例15: field

void Foam::calcTypes::average::writeAverageField
(
    const IOobject& header,
    const fvMesh& mesh,
    bool& processed
)
{
    typedef GeometricField<Type, fvPatchField, volMesh> fieldType;

    if (header.headerClassName() == fieldType::typeName)
    {
        Info<< "    Reading " << header.name() << endl;
        fieldType field(header, mesh);

        dimensioned<Type> avg ("avg", field.dimensions(), pTraits<Type>::zero);
        
        avg = field.weightedAverage(mesh.V());;

        Info<< "    Calculating average(" << header.name() << "): " << avg << endl;

        processed = true;
    }
}
开发者ID:Kiiree,项目名称:CONSELFcae-dev,代码行数:23,代码来源:writeAverageField.C


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