本文整理汇总了C++中face类的典型用法代码示例。如果您正苦于以下问题:C++ face类的具体用法?C++ face怎么用?C++ face使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了face类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: initOuterNodes
// initialize the nodes of the outer face
// and the corresponding faces
void ComputeTricOrder::initOuterNodes(node v1, node v2){
// set nodes v1 and v2 on the "base"
m_v1 = v1;
m_v2 = v2;
adjEntry firstAdj = m_outerFace->firstAdj();
// set firstAdj, so outerface is on the right
if (m_pEmbedding->rightFace(firstAdj) == m_outerFace)
firstAdj = firstAdj->cyclicSucc();
adjEntry adjRun = firstAdj;
// traverse all nodes of the outer face
do {
node v = adjRun->theNode();
// now traverse the faces f of v
// and increase outv[f] and add v to outerNodes[f]
for(adjEntry adjV : v->adjEntries){
face f = m_pEmbedding->rightFace(adjV);
if (f != m_outerFace){
m_outv[f]++;
m_outerNodes[f].pushBack(v);
}
}
adjRun = adjRun->twin()->cyclicSucc();
} while (adjRun != firstAdj);
}
开发者ID:marvin2k,项目名称:ogdf,代码行数:28,代码来源:TriconnectedShellingOrder.cpp
示例2: forAllConstIter
forAllConstIter(Map<label>, meshFaceMap, iter)
{
label faceI = iter.key();
label localI = iter();
// Replace points with duplicated ones.
const face& fRegion = faceRegions[localI];
const face& f = mesh_.faces()[faceI];
newFace.setSize(f.size());
forAll(f, fp)
{
label pointI = f[fp];
Map<label>::const_iterator iter = meshPointMap.find(pointI);
if (iter != meshPointMap.end())
{
// Point has been duplicated. Find correct one for my
// region.
// Get the regions and added points for this point
const labelList& regions = pointRegions[iter()];
const labelList& dupPoints = duplicates_[iter()];
// Look up index of my region in the regions for this point
label index = findIndex(regions, fRegion[fp]);
// Get the corresponding added point
newFace[fp] = dupPoints[index];
}
else
{
newFace[fp] = pointI;
}
}
开发者ID:,项目名称:,代码行数:35,代码来源:
示例3: findIndex
bool Foam::extrudedMesh::sameOrder(const face& f, const edge& e)
{
label i = findIndex(f, e[0]);
label nextI = (i == f.size()-1 ? 0 : i+1);
return f[nextI] == e[1];
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:8,代码来源:extrudedMesh.C
示例4: vec
// Calculate (normalized) edge vectors.
// edges[i] gives edge between point i+1 and i.
Foam::tmp<Foam::vectorField> Foam::faceTriangulation::calcEdges
(
const face& f,
const pointField& points
)
{
tmp<vectorField> tedges(new vectorField(f.size()));
vectorField& edges = tedges();
forAll(f, i)
{
point thisPt = points[f[i]];
point nextPt = points[f[f.fcIndex(i)]];
vector vec(nextPt - thisPt);
vec /= mag(vec) + VSMALL;
edges[i] = vec;
}
开发者ID:Kiiree,项目名称:OpenFOAM-dev,代码行数:21,代码来源:faceTriangulation.C
示例5: ePrev
// Test face for (almost) convexeness. Allows certain convexity before
// complaining.
// For every two consecutive edges calculate the normal. If it differs too
// much from the average face normal complain.
bool Foam::combineFaces::convexFace
(
const scalar minConcaveCos,
const pointField& points,
const face& f
)
{
// Get outwards pointing normal of f.
vector n = f.normal(points);
n /= mag(n);
// Get edge from f[0] to f[size-1];
vector ePrev(points[f.first()] - points[f.last()]);
scalar magEPrev = mag(ePrev);
ePrev /= magEPrev + VSMALL;
forAll(f, fp0)
{
// Get vertex after fp
label fp1 = f.fcIndex(fp0);
// Normalized vector between two consecutive points
vector e10(points[f[fp1]] - points[f[fp0]]);
scalar magE10 = mag(e10);
e10 /= magE10 + VSMALL;
if (magEPrev > SMALL && magE10 > SMALL)
{
vector edgeNormal = ePrev ^ e10;
if ((edgeNormal & n) < 0)
{
// Concave. Check angle.
if ((ePrev & e10) < minConcaveCos)
{
return false;
}
}
}
ePrev = e10;
magEPrev = magE10;
}
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:47,代码来源:combineFaces.C
示例6: theta
void Foam::pointMVCWeight::calcWeights
(
const Map<label>& toLocal,
const face& f,
const DynamicList<point>& u,
const scalarField& dist,
scalarField& weights
) const
{
weights.setSize(toLocal.size());
weights = 0.0;
scalarField theta(f.size());
// recompute theta, the theta computed previously are not robust
forAll(f, j)
{
label jPlus1 = f.fcIndex(j);
scalar l = mag(u[j] - u[jPlus1]);
theta[j] = 2.0*Foam::asin(l/2.0);
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:21,代码来源:pointMVCWeight.C
示例7: operator
face operator()
(
const face& x,
const label offset
) const
{
face result(x.size());
forAll(x, xI)
{
result[xI] = x[xI] + offset;
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:12,代码来源:sampledSurfaces.C
示例8: obj
void Foam::sweptFaceAreaWeightAMI<SourcePatch, TargetPatch>::writeFaceOBJ
(
const face& f,
const pointField& ps,
const string& name
) const
{
OFstream obj(typeName + "_" + name + ".obj");
for (label i = 0; i < f.size(); ++ i)
{
const vector& x = ps[f[i]];
obj << "v " << x.x() << ' ' << x.y() << ' ' << x.z() << endl;
}
obj << 'f';
for (label i = 0; i < f.size(); ++ i)
{
obj << ' ' << i + 1;
}
obj << endl;
}
开发者ID:mattijsjanssens,项目名称:mattijs-extensions,代码行数:22,代码来源:sweptFaceAreaWeightAMI.C
示例9: bb
Foam::treeBoundBox Foam::treeDataPrimitivePatch<PatchType>::calcBb
(
const pointField& points,
const face& f
)
{
treeBoundBox bb(points[f[0]], points[f[0]]);
for (label fp = 1; fp < f.size(); fp++)
{
const point& p = points[f[fp]];
bb.min() = min(bb.min(), p);
bb.max() = max(bb.max(), p);
}
return bb;
}
开发者ID:EricAlex,项目名称:OpenFOAM-dev,代码行数:17,代码来源:treeDataPrimitivePatch.C
示例10: initOuterEdges
// initialize the edges of the external face
// and the corresponding faces
void ComputeTricOrder::initOuterEdges()
{
adjEntry firstAdj = m_outerFace->firstAdj();
// set firstAdj, so outerface is on the right
if (m_pEmbedding->rightFace(firstAdj) == m_outerFace)
firstAdj = firstAdj->cyclicSucc();
adjEntry adjRun = firstAdj;
// traverse all edges of the outer face
do {
edge e = adjRun->theEdge();
face f = m_pEmbedding->rightFace(adjRun);
// verify that actual edge is not edge (v1,v2)
if (!((e->source() == m_v1 && e->target() == m_v2) || ((e->source() == m_v2 && e->target() == m_v1)))){
m_oute[f]++;
m_outerEdges[f].pushBack(e);
}
adjRun = adjRun->twin()->cyclicSucc();
} while (adjRun != firstAdj);
}
开发者ID:marvin2k,项目名称:ogdf,代码行数:21,代码来源:TriconnectedShellingOrder.cpp
示例11: while
void FixEdgeInserterCore::insertEdgesIntoDualAfterRemove(const CombinatorialEmbedding &E, face f)
{
node vRight = m_nodeOf[f];
adjEntry adj1 = f->firstAdj(), adj = adj1;
do {
if(m_pForbidden && (*m_pForbidden)[m_pr.original(adj->theEdge())] == true)
continue;
node vLeft = m_nodeOf[E.leftFace(adj)];
edge eLR = m_dual.newEdge(vLeft,vRight);
m_primalAdj[eLR] = adj;
edge eRL = m_dual.newEdge(vRight,vLeft);
m_primalAdj[eRL] = adj->twin();
}
while((adj = adj->faceCycleSucc()) != adj1);
}
开发者ID:lncosie,项目名称:ogdf,代码行数:19,代码来源:FixEdgeInserterCore.cpp
示例12: name
void Foam::faceCracker::detachFaceCracker
(
polyTopoChange& ref
) const
{
if (debug)
{
Pout<< "void faceCracker::detachFaceCracker("
<< "polyTopoChange& ref) const "
<< " for object " << name() << " : "
<< "Detaching faces" << endl;
}
const polyMesh& mesh = topoChanger().mesh();
const faceZoneMesh& zoneMesh = mesh.faceZones();
const primitiveFacePatch& masterFaceLayer =
zoneMesh[crackZoneID_.index()]();
const pointField& points = mesh.points();
const labelListList& meshEdgeFaces = mesh.edgeFaces();
const labelList& mp = masterFaceLayer.meshPoints();
const edgeList& zoneLocalEdges = masterFaceLayer.edges();
const labelList& meshEdges = zoneMesh[crackZoneID_.index()].meshEdges();
// Create the points
labelList addedPoints(mp.size(), -1);
// Go through boundary edges of the master patch. If all the faces from
// this patch are internal, mark the points in the addedPoints lookup
// with their original labels to stop duplication
label nIntEdges = masterFaceLayer.nInternalEdges();
for
(
label curEdgeID = nIntEdges;
curEdgeID < meshEdges.size();
curEdgeID++
)
{
const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
bool edgeIsInternal = true;
forAll (curFaces, faceI)
{
if (!mesh.isInternalFace(curFaces[faceI]))
{
// The edge belongs to a boundary face
edgeIsInternal = false;
break;
}
}
if (edgeIsInternal)
{
// Reset the point creation
addedPoints[zoneLocalEdges[curEdgeID].start()] =
mp[zoneLocalEdges[curEdgeID].start()];
addedPoints[zoneLocalEdges[curEdgeID].end()] =
mp[zoneLocalEdges[curEdgeID].end()];
}
}
// Create new points for face zone
forAll (addedPoints, pointI)
{
if (addedPoints[pointI] < 0)
{
addedPoints[pointI] =
ref.setAction
(
polyAddPoint
(
points[mp[pointI]], // point
mp[pointI], // master point
-1, // zone ID
true // supports a cell
)
);
}
}
// Modify faces in the master zone and duplicate for the slave zone
const labelList& mf = zoneMesh[crackZoneID_.index()];
const boolList& mfFlip = zoneMesh[crackZoneID_.index()].flipMap();
const faceList& zoneFaces = masterFaceLayer.localFaces();
const faceList& faces = mesh.faces();
const labelList& own = mesh.faceOwner();
const labelList& nei = mesh.faceNeighbour();
forAll (mf, faceI)
{
const label curFaceID = mf[faceI];
//.........这里部分代码省略.........
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:foam-extend-foam-extend-3.2,代码行数:101,代码来源:detachFaceCracker_firstFixNotRight.C
示例13: forAll
points[pointI] = p;
}
//- read the number of faces
file >> counter;
faceListPMG& faces = meshModifier.facesAccess();
//- read faces from file
faces.setSize(counter);
forAll(faces, faceI)
{
file >> counter;
face f;
f.setSize(counter);
forAll(f, pI)
file >> f[pI];
faces[faceI] = f.reverseFace();
}
//- read the number of cells
file >> counter;
//- read cells from file
cellListPMG& cells = meshModifier.cellsAccess();
cells.setSize(counter);
开发者ID:kel85uk,项目名称:cfMesh,代码行数:29,代码来源:FPMAToMesh.C
示例14: Hasher
inline unsigned Hash<face>::operator()(const face& t, unsigned seed) const
{
return Hasher(t.cdata(),t.size()*sizeof(label), seed);
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:4,代码来源:ideasUnvToFoam.C
示例15: name
void Foam::attachDetach::detachInterface
(
polyTopoChange& ref
) const
{
// Algorithm:
// 1. Create new points for points of the master face zone
// 2. Modify all faces of the master zone, by putting them into the master
// patch (look for orientation) and their renumbered mirror images
// into the slave patch
// 3. Create a point renumbering list, giving a new point index for original
// points in the face patch
// 4. Grab all faces in cells on the master side and renumber them
// using the point renumbering list. Exclude the ones that belong to
// the master face zone
//
// Note on point creation:
// In order to take into account the issues related to partial
// blocking in an attach/detach mesh modifier, special treatment
// is required for the duplication of points on the edge of the
// face zone. Points which are shared only by internal edges need
// not to be duplicated, as this would propagate the discontinuity
// in the mesh beyond the face zone. Therefore, before creating
// the new points, check the external edge loop. For each edge
// check if the edge is internal (i.e. does not belong to a
// patch); if so, exclude both of its points from duplication.
if (debug)
{
Pout<< "void attachDetach::detachInterface("
<< "polyTopoChange& ref) const "
<< " for object " << name() << " : "
<< "Detaching interface" << endl;
}
const polyMesh& mesh = topoChanger().mesh();
const faceZoneMesh& zoneMesh = mesh.faceZones();
const primitiveFacePatch& masterFaceLayer = zoneMesh[faceZoneID_.index()]();
const pointField& points = mesh.points();
const labelListList& meshEdgeFaces = mesh.edgeFaces();
const labelList& mp = masterFaceLayer.meshPoints();
const edgeList& zoneLocalEdges = masterFaceLayer.edges();
const labelList& meshEdges = zoneMesh[faceZoneID_.index()].meshEdges();
// Create the points
labelList addedPoints(mp.size(), -1);
// Go through boundary edges of the master patch. If all the faces from
// this patch are internal, mark the points in the addedPoints lookup
// with their original labels to stop duplication
label nIntEdges = masterFaceLayer.nInternalEdges();
for (label curEdgeID = nIntEdges; curEdgeID < meshEdges.size(); curEdgeID++)
{
const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
bool edgeIsInternal = true;
forAll (curFaces, faceI)
{
if (!mesh.isInternalFace(curFaces[faceI]))
{
// The edge belongs to a boundary face
edgeIsInternal = false;
break;
}
}
if (edgeIsInternal)
{
// Pout<< "Internal edge found: (" << mp[zoneLocalEdges[curEdgeID].start()] << " " << mp[zoneLocalEdges[curEdgeID].end()] << ")" << endl;
// Reset the point creation
addedPoints[zoneLocalEdges[curEdgeID].start()] =
mp[zoneLocalEdges[curEdgeID].start()];
addedPoints[zoneLocalEdges[curEdgeID].end()] =
mp[zoneLocalEdges[curEdgeID].end()];
}
}
// Pout << "addedPoints before point creation: " << addedPoints << endl;
// Create new points for face zone
forAll (addedPoints, pointI)
{
if (addedPoints[pointI] < 0)
{
addedPoints[pointI] =
ref.setAction
(
polyAddPoint
(
points[mp[pointI]], // point
mp[pointI], // master point
-1, // zone ID
true // supports a cell
//.........这里部分代码省略.........
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:101,代码来源:detachInterface.C
注:本文中的face类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论