DynamicList changes.

- setSize() adjusts the addressable length only.
  Changed setSize(label) usage to setCapacity(label) or reserve(label)
  throughout. The final name (capacity vs. storageSize() vs. whatever) can
  easily be decided at a later date.
- added setSize(label, const T&), which may still not be really useful, but
  is at least now meaningful
- made shrink() a bit more legible.
- added append(UList<T>&)
- copying from a UList avoids reallocations where possible

The following bits of code continue to use the DynamicList::setSize(), but
appear to be legitimate (or the corresponding code itself needs rethinking).

  src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C:167: error: within this context
  src/OpenFOAM/lnInclude/faceTemplates.C:44: error: within this context
  src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C:178: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:737: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:741: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:745: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:749: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:754: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:935: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:940: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:1041: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:1046: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2161: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2162: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2201: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2205: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2261: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2262: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2263: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2264: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2265: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3011: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3076: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3244: error: within this context
  src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3371: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:73: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:91: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:73: error: within this context
  src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:91: error: within this context
This commit is contained in:
Mark Olesen
2008-11-24 17:22:37 +01:00
parent b7e349a727
commit 41bbcb6337
25 changed files with 263 additions and 237 deletions

View File

@ -247,7 +247,7 @@ Foam::label Foam::surfaceFeatures::nextFeatEdge
// prevPointI. Marks feature edges visited in featVisited by assigning them
// the current feature line number. Returns cumulative length of edges walked.
// Works in one of two modes:
// - mark : step to edges with featVisited = -1.
// - mark : step to edges with featVisited = -1.
// Mark edges visited with currentFeatI.
// - clear : step to edges with featVisited = currentFeatI
// Mark edges visited with -2 and erase from feature edges.
@ -257,7 +257,7 @@ Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment
const List<edgeStatus>& edgeStat,
const label startEdgeI,
const label startPointI,
const label currentFeatI,
const label currentFeatI,
labelList& featVisited
)
{
@ -360,7 +360,7 @@ Foam::surfaceFeatures::surfaceFeatures
const labelList& featureEdges,
const label externalStart,
const label internalStart
)
)
:
surf_(surf),
featurePoints_(featurePoints),
@ -457,7 +457,7 @@ Foam::labelList Foam::surfaceFeatures::selectFeatureEdges
if (regionEdges)
{
selectedEdges.setSize(selectedEdges.size() + nRegionEdges());
selectedEdges.setCapacity(selectedEdges.size() + nRegionEdges());
for (label i = 0; i < externalStart_; i++)
{
@ -467,7 +467,7 @@ Foam::labelList Foam::surfaceFeatures::selectFeatureEdges
if (externalEdges)
{
selectedEdges.setSize(selectedEdges.size() + nExternalEdges());
selectedEdges.setCapacity(selectedEdges.size() + nExternalEdges());
for (label i = externalStart_; i < internalStart_; i++)
{
@ -477,7 +477,7 @@ Foam::labelList Foam::surfaceFeatures::selectFeatureEdges
if (internalEdges)
{
selectedEdges.setSize(selectedEdges.size() + nInternalEdges());
selectedEdges.setCapacity(selectedEdges.size() + nInternalEdges());
for (label i = internalStart_; i < featureEdges_.size(); i++)
{
@ -530,8 +530,8 @@ void Foam::surfaceFeatures::findFeatures(const scalar includedAngle)
// Check if convex or concave by looking at angle
// between face centres and normal
vector f0Tof1 =
surf_[face1].centre(points)
vector f0Tof1 =
surf_[face1].centre(points)
- surf_[face0].centre(points);
if ((f0Tof1 & faceNormals[face0]) > 0.0)
@ -683,11 +683,11 @@ void Foam::surfaceFeatures::writeDict(Ostream& writeFile) const
{
dictionary featInfoDict;
featInfoDict.add("externalStart", externalStart_);
featInfoDict.add("externalStart", externalStart_);
featInfoDict.add("internalStart", internalStart_);
featInfoDict.add("featureEdges", featureEdges_);
featInfoDict.add("featurePoints", featurePoints_);
featInfoDict.write(writeFile);
}
@ -1152,7 +1152,7 @@ void Foam::surfaceFeatures::nearestSurfEdge
(
const labelList& selectedEdges,
const pointField& samples,
const vector& searchSpan, // Search span
const vector& searchSpan, // Search span
labelList& edgeLabel,
labelList& edgeEndPoint,
pointField& edgePoint
@ -1163,7 +1163,7 @@ void Foam::surfaceFeatures::nearestSurfEdge
edgePoint.setSize(samples.size());
const pointField& localPoints = surf_.localPoints();
octree<octreeDataEdges> ppTree
(
treeBoundBox(localPoints), // overall search domain
@ -1232,7 +1232,7 @@ void Foam::surfaceFeatures::nearestSurfEdge
const labelList& selectedSampleEdges,
const pointField& samplePoints,
const vector& searchSpan, // Search span
const vector& searchSpan, // Search span
labelList& edgeLabel, // label of surface edge or -1
pointField& pointOnEdge, // point on above edge
pointField& pointOnFeature // point on sample edge
@ -1242,7 +1242,6 @@ void Foam::surfaceFeatures::nearestSurfEdge
pointOnEdge.setSize(selectedSampleEdges.size());
pointOnFeature.setSize(selectedSampleEdges.size());
octree<octreeDataEdges> ppTree
(