本文整理汇总了C++中polyMesh::name方法的典型用法代码示例。如果您正苦于以下问题:C++ polyMesh::name方法的具体用法?C++ polyMesh::name怎么用?C++ polyMesh::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类polyMesh
的用法示例。
在下文中一共展示了polyMesh::name方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sampledPatch
Foam::sampledPatchInternalField::sampledPatchInternalField
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
)
:
sampledPatch(name, mesh, dict),
mappers_(patchIDs().size())
{
const scalar distance = readScalar(dict.lookup("distance"));
forAll(patchIDs(), i)
{
label patchI = patchIDs()[i];
mappers_.set
(
i,
new directMappedPatchBase
(
mesh.boundaryMesh()[patchI],
mesh.name(), // sampleRegion
directMappedPatchBase::NEARESTCELL, // sampleMode
word::null, // samplePatch
-distance // sample inside my domain
)
);
}
示例2:
void Foam::OutputFilterFunctionObject<OutputFilter>::movePoints
(
const polyMesh& mesh
)
{
if (active() && mesh.name() == regionName_)
{
ptr_->movePoints(mesh);
}
}
示例3: decomp
Foam::labelList Foam::ptscotchDecomp::decompose
(
const polyMesh& mesh,
const pointField& points,
const scalarField& pointWeights
)
{
if (points.size() != mesh.nCells())
{
FatalErrorIn
(
"ptscotchDecomp::decompose(const pointField&, const scalarField&)"
)
<< "Can use this decomposition method only for the whole mesh"
<< endl
<< "and supply one coordinate (cellCentre) for every cell." << endl
<< "The number of coordinates " << points.size() << endl
<< "The number of cells in the mesh " << mesh.nCells()
<< exit(FatalError);
}
// // For running sequential ...
// if (Pstream::nProcs() <= 1)
// {
// return scotchDecomp(decompositionDict_, mesh_)
// .decompose(points, pointWeights);
// }
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
CompactListList<label> cellCells;
calcCellCells(mesh, identity(mesh.nCells()), mesh.nCells(), cellCells);
// Decompose using default weights
List<int> finalDecomp;
decomposeZeroDomains
(
mesh.time().path()/mesh.name(),
cellCells.m(),
cellCells.offsets(),
pointWeights,
finalDecomp
);
// Copy back to labelList
labelList decomp(finalDecomp.size());
forAll(decomp, i)
{
decomp[i] = finalDecomp[i];
}
return decomp;
}
示例4: fName
void Foam::meshToMeshNew::writeConnectivity
(
const polyMesh& src,
const polyMesh& tgt,
const labelListList& srcToTargetAddr
) const
{
Pout<< "Source size = " << src.nCells() << endl;
Pout<< "Target size = " << tgt.nCells() << endl;
word fName("addressing_" + src.name() + "_to_" + tgt.name());
if (Pstream::parRun())
{
fName = fName + "_proc" + Foam::name(Pstream::myProcNo());
}
OFstream os(src.time().path()/fName + ".obj");
label vertI = 0;
forAll(srcToTargetAddr, i)
{
const labelList& tgtAddress = srcToTargetAddr[i];
forAll(tgtAddress, j)
{
label tgtI = tgtAddress[j];
const vector& c0 = src.cellCentres()[i];
const cell& c = tgt.cells()[tgtI];
const pointField pts(c.points(tgt.faces(), tgt.points()));
forAll(pts, j)
{
const point& p = pts[j];
os << "v " << p.x() << ' ' << p.y() << ' ' << p.z() << nl;
vertI++;
os << "v " << c0.x() << ' ' << c0.y() << ' ' << c0.z()
<< nl;
vertI++;
os << "l " << vertI - 1 << ' ' << vertI << nl;
}
}
}
示例5: fineDistribution
Foam::labelList Foam::ptscotchDecomp::decompose
(
const polyMesh& mesh,
const labelList& agglom,
const pointField& agglomPoints,
const scalarField& pointWeights
)
{
if (agglom.size() != mesh.nCells())
{
FatalErrorIn
(
"ptscotchDecomp::decompose(const labelList&, const pointField&)"
) << "Size of cell-to-coarse map " << agglom.size()
<< " differs from number of cells in mesh " << mesh.nCells()
<< exit(FatalError);
}
// // For running sequential ...
// if (Pstream::nProcs() <= 1)
// {
// return scotchDecomp(decompositionDict_, mesh)
// .decompose(agglom, agglomPoints, pointWeights);
// }
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
CompactListList<label> cellCells;
calcCellCells(mesh, agglom, agglomPoints.size(), cellCells);
// Decompose using weights
List<int> finalDecomp;
decomposeZeroDomains
(
mesh.time().path()/mesh.name(),
cellCells.m(),
cellCells.offsets(),
pointWeights,
finalDecomp
);
// Rework back into decomposition for original mesh
labelList fineDistribution(agglom.size());
forAll(fineDistribution, i)
{
fineDistribution[i] = finalDecomp[agglom[i]];
}
return fineDistribution;
}
示例6:
Foam::pointMesh::pointMesh(const polyMesh& pMesh)
:
MeshObject<polyMesh, Foam::UpdateableMeshObject, pointMesh>(pMesh),
GeoMesh<polyMesh>(pMesh),
boundary_(*this, pMesh.boundaryMesh())
{
if (debug)
{
Pout<< "pointMesh::pointMesh(const polyMesh&): "
<< "Constructing from polyMesh " << pMesh.name()
<< endl;
}
// Calculate the geometry for the patches (transformation tensors etc.)
boundary_.calcGeometry();
}
示例7: exit
Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
(
const polyMesh& mesh,
const polyPatch& thisPatch
) const
{
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
if (!valid())
{
FatalErrorIn
(
"coupleGroupIdentifier::findOtherPatchID(const polyPatch&) const"
) << "Invalid coupleGroup patch group"
<< " on patch " << thisPatch.name()
<< " in region " << pbm.mesh().name()
<< exit(FatalError);
}
HashTable<labelList, word>::const_iterator fnd =
pbm.groupPatchIDs().find(name());
if (fnd == pbm.groupPatchIDs().end())
{
if (&mesh == &thisPatch.boundaryMesh().mesh())
{
// thisPatch should be in patchGroup
FatalErrorIn
(
"coupleGroupIdentifier::findOtherPatchID"
"(const polyMesh&, const polyPatch&) const"
) << "Patch " << thisPatch.name()
<< " should be in patchGroup " << name()
<< " in region " << pbm.mesh().name()
<< exit(FatalError);
}
return -1;
}
// Mesh has patch group
const labelList& patchIDs = fnd();
if (&mesh == &thisPatch.boundaryMesh().mesh())
{
if (patchIDs.size() > 2 || patchIDs.size() == 0)
{
FatalErrorIn
(
"coupleGroupIdentifier::findOtherPatchID"
"(const polyMesh&, const polyPatch&) const"
) << "Couple patchGroup " << name()
<< " with contents " << patchIDs
<< " not of size < 2"
<< " on patch " << thisPatch.name()
<< " region " << thisPatch.boundaryMesh().mesh().name()
<< exit(FatalError);
return -1;
}
label index = findIndex(patchIDs, thisPatch.index());
if (index == -1)
{
FatalErrorIn
(
"coupleGroupIdentifier::findOtherPatchID"
"(const polyMesh&, const polyPatch&) const"
) << "Couple patchGroup " << name()
<< " with contents " << patchIDs
<< " does not contain patch " << thisPatch.name()
<< " in region " << pbm.mesh().name()
<< exit(FatalError);
return -1;
}
if (patchIDs.size() == 2)
{
// Return the other patch
return patchIDs[1-index];
}
else // size == 1
{
return -1;
}
}
else
{
if (patchIDs.size() != 1)
{
FatalErrorIn
(
"coupleGroupIdentifier::findOtherPatchID"
"(const polyMesh&, const polyPatch&) const"
) << "Couple patchGroup " << name()
<< " with contents " << patchIDs
<< " in region " << mesh.name()
//.........这里部分代码省略.........
示例8: patch
bool Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::interfaceOwner
(
const polyMesh& nbrRegion,
const polyPatch& nbrPatch
) const
{
const fvMesh& myRegion = patch().boundaryMesh().mesh();
if (nbrRegion.name() == myRegion.name())
{
return patch().index() < nbrPatch.index();
}
else
{
const regionProperties& props =
myRegion.objectRegistry::parent().lookupObject<regionProperties>
(
"regionProperties"
);
label myIndex = findIndex(props.fluidRegionNames(), myRegion.name());
if (myIndex == -1)
{
label i = findIndex(props.solidRegionNames(), myRegion.name());
if (i == -1)
{
FatalErrorIn
(
"turbulentTemperatureCoupledBaffleFvPatchScalarField"
"::interfaceOwner(const polyMesh&"
", const polyPatch&)const"
) << "Cannot find region " << myRegion.name()
<< " neither in fluids " << props.fluidRegionNames()
<< " nor in solids " << props.solidRegionNames()
<< exit(FatalError);
}
myIndex = props.fluidRegionNames().size() + i;
}
label nbrIndex = findIndex
(
props.fluidRegionNames(),
nbrRegion.name()
);
if (nbrIndex == -1)
{
label i = findIndex(props.solidRegionNames(), nbrRegion.name());
if (i == -1)
{
FatalErrorIn
(
"coupleManager::interfaceOwner"
"(const polyMesh&, const polyPatch&) const"
) << "Cannot find region " << nbrRegion.name()
<< " neither in fluids " << props.fluidRegionNames()
<< " nor in solids " << props.solidRegionNames()
<< exit(FatalError);
}
nbrIndex = props.fluidRegionNames().size() + i;
}
return myIndex < nbrIndex;
}
}
开发者ID:frankl000,项目名称:OpenFOAM-1.7.x,代码行数:65,代码来源:turbulentTemperatureCoupledBaffleFvPatchScalarField.C