예제 #1
0
Foam::autoPtr<Foam::fvPatch> Foam::fvPatch::New
(
    const polyPatch& patch,
    const fvBoundaryMesh& bm
)
{
    if (debug)
    {
        Info<< "fvPatch::New(const polyPatch&, const fvBoundaryMesh&) : "
            << "constructing fvPatch"
            << endl;
    }

    polyPatchConstructorTable::iterator cstrIter =
        polyPatchConstructorTablePtr_->find(patch.type());

    if (cstrIter == polyPatchConstructorTablePtr_->end())
    {
        FatalErrorIn("fvPatch::New(const polyPatch&, const fvBoundaryMesh&)")
            << "Unknown fvPatch type " << patch.type() << ".\n"
            << "Valid fvPatch types are :"
            << polyPatchConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return autoPtr<fvPatch>(cstrIter()(patch, bm));
}
autoPtr<faceTetPolyPatchCellDecomp> faceTetPolyPatchCellDecomp::New
(
    const polyPatch& patch,
    const tetPolyBoundaryMeshCellDecomp& bm
)
{
    if (debug)
    {
        Info<< "faceTetPolyPatchCellDecomp::New(const polyPatch&, "
            << " const tetPolyBoundaryMeshCellDecomp&) : "
            << "constructing faceTetPolyPatchCellDecomp"
            << endl;
    }

    polyPatchConstructorTable::iterator cstrIter =
        polyPatchConstructorTablePtr_->find(patch.type());

    if (cstrIter == polyPatchConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "faceTetPolyPatchCellDecomp::New(const polyPatch&, "
            "const tetPolyBoundaryMeshCellDecomp&) : "
        )   << "Unknown faceTetPolyPatchCellDecomp type "
            << patch.type()
            << ".  Valid faceTetPolyPatchCellDecomp types are :" << endl
            << polyPatchConstructorTablePtr_->toc()
            << exit(FatalError);
    }

    return autoPtr<faceTetPolyPatchCellDecomp>(cstrIter()(patch, bm));
}
예제 #3
0
Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New
(
    const polyPatch& patch,
    const pointBoundaryMesh& bm
)
{
    if (debug)
    {
        InfoInFunction << "Constructing facePointPatch" << endl;
    }

    polyPatchConstructorTable::iterator cstrIter =
        polyPatchConstructorTablePtr_->find(patch.type());

    if (cstrIter == polyPatchConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown facePointPatch type "
            << patch.type()
            << nl << nl
            << "Valid facePointPatch types are :" << endl
            << polyPatchConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return autoPtr<facePointPatch>(cstrIter()(patch, bm));
}
예제 #4
0
Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
{
    // Find the patch name on the list.  If the patch is already there
    // and patch types match, return index
    const word& pType = p.type();
    const word& pName = p.name();

    bool nameFound = false;

    forAll (patchNames_, patchI)
    {
        if (patchNames_[patchI] == pName)
        {
            if (patchTypes_[patchI] == pType)
            {
                // Found name and types match
                return patchI;
            }
            else
            {
                // Found the name, but type is different
                nameFound = true;
            }
        }
    }

    // Patch not found.  Append to the list
    patchTypes_.append(pType);

    if (nameFound)
    {
        // Duplicate name is not allowed.  Create a composite name from the
        // patch name and case name
        const word& caseName = p.boundaryMesh().mesh().time().caseName();

        patchNames_.append(pName + "_" + caseName);

        Info<< "label patchIndex(const polyPatch& p) : "
            << "Patch " << p.index() << " named "
            << pName << " in mesh " << caseName
            << " already exists, but patch types "
            << " do not match.\nCreating a composite name as "
            << patchNames_[patchNames_.size() - 1] << endl;
    }
    else
    {
        patchNames_.append(pName);
    }

    return patchNames_.size() - 1;
}