mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
consistency update
- OSspecific: chmod() -> chMod(), even although it's not used anywhere - ListOps get subset() and inplaceSubset() templated on BoolListType - added UList<bool>::operator[](..) const specialization. Returns false (actually pTraits<bool>::zero) for out-of-range elements. This lets us use List<bool> with lazy evaluation and no noticeable change in performance. - use rcIndex() and fcIndex() wherever possible. Could check if branching or modulus is faster for fcIndex(). - UList and FixedList get 'const T* cdata() const' and 'T* data()' members. Similar to the STL front() and std::string::data() methods, they return a pointer to the first element without needing to write '&myList[0]', recast begin() or violate const-ness.
This commit is contained in:
@ -72,24 +72,11 @@ bool Foam::meshCutter::isIn
|
||||
return false;
|
||||
}
|
||||
|
||||
label nextIndex = (index + 1) % cuts.size();
|
||||
|
||||
if (cuts[nextIndex] == twoCuts[1])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
label prevIndex = (index == 0 ? cuts.size()-1 : index - 1);
|
||||
|
||||
if (cuts[prevIndex] == twoCuts[1])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
cuts[cuts.fcIndex(index)] == twoCuts[1]
|
||||
|| cuts[cuts.rcIndex(index)] == twoCuts[1]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -459,7 +446,7 @@ Foam::face Foam::meshCutter::addEdgeCutsToFace(const label faceI) const
|
||||
newFace[newFp++] = f[fp];
|
||||
|
||||
// Check if edge has been cut.
|
||||
label fp1 = (fp + 1) % f.size();
|
||||
label fp1 = f.fcIndex(fp);
|
||||
|
||||
HashTable<label, edge, Hash<edge> >::const_iterator fnd =
|
||||
addedPoints_.find(edge(f[fp], f[fp1]));
|
||||
@ -511,7 +498,7 @@ Foam::face Foam::meshCutter::loopToFace
|
||||
|
||||
newFace[newFaceI++] = vertI;
|
||||
|
||||
label nextCut = loop[(fp+1) % loop.size()];
|
||||
label nextCut = loop[loop.fcIndex(fp)];
|
||||
|
||||
if (!isEdge(nextCut))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user