mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
dynamicList update
This commit is contained in:
@ -184,10 +184,6 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
|
||||
// Transfer DynamicLists to straight ones.
|
||||
labelList cutEdges;
|
||||
cutEdges.transfer(allCutEdges);
|
||||
allCutEdges.clear();
|
||||
|
||||
scalarField cutEdgeWeights;
|
||||
cutEdgeWeights.transfer(allCutEdgeWeights);
|
||||
allCutEdgeWeights.clear();
|
||||
@ -199,7 +195,7 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
cutCells.toc(), // cells candidate for cutting
|
||||
labelList(0), // cut vertices
|
||||
cutEdges, // cut edges
|
||||
allCutEdges, // cut edges
|
||||
cutEdgeWeights // weight on cut edges
|
||||
);
|
||||
|
||||
|
||||
@ -35,11 +35,8 @@ Description
|
||||
#include "IOstreams.H"
|
||||
#include "SLPtrList.H"
|
||||
#include "boolList.H"
|
||||
#include "cellList.H"
|
||||
#include "primitiveMesh.H"
|
||||
#include "cyclicFvPatch.H"
|
||||
#include "fvPatchList.H"
|
||||
#include "DynamicList.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ License
|
||||
#include "OSspecific.H"
|
||||
#include "Map.H"
|
||||
#include "globalMeshData.H"
|
||||
|
||||
#include "DynamicList.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -45,7 +45,6 @@ Description
|
||||
#include "IOobjectList.H"
|
||||
#include "boolList.H"
|
||||
#include "stringList.H"
|
||||
#include "DynamicList.H"
|
||||
#include "cellModeller.H"
|
||||
|
||||
#include "floatScalar.H"
|
||||
|
||||
@ -27,9 +27,6 @@ License
|
||||
#include "internalWriter.H"
|
||||
#include "writeFuns.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
|
||||
@ -29,9 +29,6 @@ License
|
||||
#include "Cloud.H"
|
||||
#include "passiveParticle.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
|
||||
@ -78,6 +78,7 @@ void writePatchGeom
|
||||
writeFuns::write(pStream, binary, vertLabels);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -103,6 +103,7 @@ void writePointSet
|
||||
writeFuns::write(pStream, binary, pointIDs);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -33,7 +33,7 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList(Istream& is)
|
||||
:
|
||||
List<T>(is),
|
||||
nextFree_(List<T>::size())
|
||||
allocSize_(List<T>::size())
|
||||
{}
|
||||
|
||||
|
||||
@ -44,9 +44,6 @@ Foam::Ostream& Foam::operator<<
|
||||
const Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>& DL
|
||||
)
|
||||
{
|
||||
const_cast<DynamicList<T, SizeInc, SizeMult, SizeDiv>&>(DL)
|
||||
.setSize(DL.nextFree_);
|
||||
|
||||
os << static_cast<const List<T>&>(DL);
|
||||
return os;
|
||||
}
|
||||
@ -60,7 +57,7 @@ Foam::Istream& Foam::operator>>
|
||||
)
|
||||
{
|
||||
is >> static_cast<List<T>&>(DL);
|
||||
DL.nextFree_ = DL.List<T>::size();
|
||||
DL.allocSize_ = DL.List<T>::size();
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
@ -81,24 +81,29 @@ class DynamicList
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Number of next free element
|
||||
label nextFree_;
|
||||
//- Allocated size for underlying List.
|
||||
label allocSize_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Related types
|
||||
|
||||
//- Declare friendship with the List class
|
||||
friend class List<T>;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
inline DynamicList();
|
||||
|
||||
//- Construct given size
|
||||
//- Construct given size.
|
||||
explicit inline DynamicList(const label);
|
||||
|
||||
//- Construct from UList. nextFree_ set to size().
|
||||
//- Construct from UList. Size set to UList size.
|
||||
explicit inline DynamicList(const UList<T>&);
|
||||
|
||||
//- Construct from Istream. nextFree_ set to size().
|
||||
//- Construct from Istream. Size set to size of read list.
|
||||
explicit DynamicList(Istream&);
|
||||
|
||||
|
||||
@ -106,22 +111,24 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Size of the active part of the list.
|
||||
// Direct over-ride of list size member function
|
||||
inline label size() const;
|
||||
//- Size of the underlying storage.
|
||||
inline label allocSize() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Reset size of List.
|
||||
void setSize(const label);
|
||||
inline void setSize(const label);
|
||||
|
||||
//- Reset size of List and value for new elements.
|
||||
void setSize(const label, const T&);
|
||||
inline void setSize(const label, const T&);
|
||||
|
||||
//- Clear the list, i.e. set next free to zero.
|
||||
//- Clear the list, i.e. set the size to zero.
|
||||
// Allocated size does not change
|
||||
void clear();
|
||||
inline void clear();
|
||||
|
||||
//- Clear the list and delete storage.
|
||||
inline void clearStorage();
|
||||
|
||||
//- Shrink the List<T> to the number of elements used
|
||||
inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& shrink();
|
||||
@ -130,11 +137,11 @@ public:
|
||||
// and annull the argument list. Is same as List::transfer except
|
||||
// checks that you're not changing the underlying list to something
|
||||
// smaller than nextFree_.
|
||||
void transfer(List<T>&);
|
||||
inline void transfer(List<T>&);
|
||||
|
||||
//- Transfer the contents of the argument DynamicList into this
|
||||
// DynamicList and annull the argument list.
|
||||
void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
|
||||
inline void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
|
||||
|
||||
|
||||
// Member Operators
|
||||
@ -152,9 +159,15 @@ public:
|
||||
//- Assignment of all entries to the given value
|
||||
inline void operator=(const T&);
|
||||
|
||||
//- Assignment to List<T>
|
||||
//- Assignment from List<T>
|
||||
inline void operator=(const List<T>&);
|
||||
|
||||
//- Assignment from DynamicList<T>
|
||||
inline void operator=
|
||||
(
|
||||
const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
|
||||
);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
|
||||
@ -31,8 +31,10 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList()
|
||||
:
|
||||
List<T>(SizeInc),
|
||||
nextFree_(0)
|
||||
{}
|
||||
allocSize_(SizeInc)
|
||||
{
|
||||
List<T>::size() = 0;
|
||||
}
|
||||
|
||||
|
||||
//- Construct given size
|
||||
@ -43,8 +45,10 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
|
||||
)
|
||||
:
|
||||
List<T>(s),
|
||||
nextFree_(0)
|
||||
{}
|
||||
allocSize_(s)
|
||||
{
|
||||
List<T>::size() = 0;
|
||||
}
|
||||
|
||||
|
||||
//- Construct given size
|
||||
@ -55,17 +59,17 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
|
||||
)
|
||||
:
|
||||
List<T>(s),
|
||||
nextFree_(s.size())
|
||||
allocSize_(s.size())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline Foam::label Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::size()
|
||||
inline Foam::label Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::allocSize()
|
||||
const
|
||||
{
|
||||
return nextFree_;
|
||||
return allocSize_;
|
||||
}
|
||||
|
||||
|
||||
@ -75,13 +79,14 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
|
||||
const label s
|
||||
)
|
||||
{
|
||||
if (s < nextFree_)
|
||||
if (s < List<T>::size())
|
||||
{
|
||||
nextFree_ = s;
|
||||
List<T>::size() = s;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<T>::setSize(s);
|
||||
allocSize_ = s;
|
||||
List<T>::setSize(allocSize_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,14 +98,14 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
|
||||
const T& t
|
||||
)
|
||||
{
|
||||
if (s < nextFree_)
|
||||
if (s < List<T>::size())
|
||||
{
|
||||
nextFree_ = s;
|
||||
List<T>::size() = s;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<T>::setSize(s, t);
|
||||
nextFree_ = s;
|
||||
allocSize_ = s;
|
||||
List<T>::setSize(allocSize_, t);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +113,16 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::clear()
|
||||
{
|
||||
nextFree_ = 0;
|
||||
List<T>::size() = 0;
|
||||
}
|
||||
|
||||
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::clearStorage()
|
||||
{
|
||||
List<T>::size() = allocSize_; // make List<T> consistent
|
||||
List<T>::clear();
|
||||
allocSize_ = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +130,8 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
|
||||
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::shrink()
|
||||
{
|
||||
List<T>::setSize(nextFree_);
|
||||
allocSize_ = List<T>::size();
|
||||
List<T>::setSize(allocSize_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -125,20 +140,20 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline void
|
||||
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer(List<T>& l)
|
||||
{
|
||||
if (l.size() < nextFree_)
|
||||
if (l.size() < List<T>::size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void DynamicList<T, SizeInc, SizeMult"
|
||||
", SizeDiv>::transfer(List<T>&)"
|
||||
) << "Cannot replace the underlying storage of this DynamicList"
|
||||
<< " of which " << nextFree_ << " elements are used" << nl
|
||||
<< " of which " << List<T>::size() << " elements are used" << nl
|
||||
<< "with a List of size " << l.size() << abort(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
allocSize_ = l.size();
|
||||
List<T>::transfer(l); // take over storage
|
||||
l.clear(); // set nextFree of l to 0
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,40 +165,40 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
|
||||
DynamicList<T, SizeInc, SizeMult, SizeDiv>& l
|
||||
)
|
||||
{
|
||||
allocSize_ = l.allocSize();
|
||||
List<T>::transfer(l); // take over storage
|
||||
nextFree_ = l.size(); // take over used size
|
||||
l.clear(); // set nextFree of l to 0
|
||||
l.allocSize_ = 0;
|
||||
}
|
||||
|
||||
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
|
||||
(
|
||||
const T& e
|
||||
)
|
||||
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append(const T& e)
|
||||
{
|
||||
nextFree_++;
|
||||
// Work on copy free index since gets overwritten by setSize
|
||||
label nextFree = List<T>::size();
|
||||
|
||||
if (nextFree_ > List<T>::size())
|
||||
nextFree++;
|
||||
|
||||
if (nextFree > allocSize_)
|
||||
{
|
||||
List<T>::setSize
|
||||
allocSize_ = max
|
||||
(
|
||||
max
|
||||
(
|
||||
nextFree_,
|
||||
label(SizeMult*List<T>::size()/SizeDiv + SizeInc)
|
||||
)
|
||||
nextFree,
|
||||
label(SizeMult*allocSize_/SizeDiv + SizeInc)
|
||||
);
|
||||
List<T>::setSize(allocSize_);
|
||||
}
|
||||
|
||||
this->operator[](nextFree_ - 1) = e;
|
||||
this->operator[](nextFree - 1) = e;
|
||||
|
||||
List<T>::size() = nextFree;
|
||||
}
|
||||
|
||||
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove()
|
||||
{
|
||||
if (nextFree_ == 0)
|
||||
if (List<T>::size() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -191,7 +206,7 @@ inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove()
|
||||
) << "List is empty" << abort(FatalError);
|
||||
}
|
||||
|
||||
return List<T>::operator[](--nextFree_);
|
||||
return List<T>::operator[](--List<T>::size());
|
||||
}
|
||||
|
||||
|
||||
@ -203,20 +218,22 @@ inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator()
|
||||
const label i
|
||||
)
|
||||
{
|
||||
nextFree_ = max(nextFree_, i + 1);
|
||||
label nextFree = List<T>::size();
|
||||
|
||||
if (nextFree_ > List<T>::size())
|
||||
nextFree = max(nextFree, i + 1);
|
||||
|
||||
if (nextFree > allocSize_)
|
||||
{
|
||||
List<T>::setSize
|
||||
allocSize_ = max
|
||||
(
|
||||
max
|
||||
(
|
||||
nextFree_,
|
||||
label(SizeMult*List<T>::size()/SizeDiv + SizeInc)
|
||||
)
|
||||
nextFree,
|
||||
label(SizeMult*allocSize_/SizeDiv + SizeInc)
|
||||
);
|
||||
List<T>::setSize(allocSize_);
|
||||
}
|
||||
|
||||
List<T>::size() = nextFree;
|
||||
|
||||
return this->operator[](i);
|
||||
}
|
||||
|
||||
@ -228,7 +245,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
)
|
||||
{
|
||||
List<T>::operator=(t);
|
||||
nextFree_ = List<T>::size();
|
||||
allocSize_ = List<T>::size();
|
||||
}
|
||||
|
||||
|
||||
@ -239,7 +256,18 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
)
|
||||
{
|
||||
List<T>::operator=(l);
|
||||
nextFree_ = l.size();
|
||||
allocSize_ = List<T>::size();
|
||||
}
|
||||
|
||||
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
(
|
||||
const DynamicList<T, SizeInc, SizeMult, SizeDiv>& l
|
||||
)
|
||||
{
|
||||
List<T>::operator=(l);
|
||||
allocSize_ = l.allocSize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -420,6 +420,23 @@ void List<T>::transfer(List<T>& a)
|
||||
}
|
||||
|
||||
|
||||
// Transfer the contents of the argument DynamicList into this List
|
||||
// and anull the argument list
|
||||
template<class T>
|
||||
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
void List<T>::transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>& a)
|
||||
{
|
||||
if (this->v_) delete[] this->v_;
|
||||
|
||||
this->size_ = a.size_;
|
||||
this->v_ = a.v_;
|
||||
|
||||
a.size_ = 0;
|
||||
a.allocSize_ = 0;
|
||||
a.v_ = 0;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
void sort(List<T>& a)
|
||||
{
|
||||
|
||||
@ -61,6 +61,8 @@ template<class T> Istream& operator>>(Istream&, List<T>&);
|
||||
template<class T, label Size> class FixedList;
|
||||
template<class T> class PtrList;
|
||||
template<class T> class SLList;
|
||||
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
class DynamicList;
|
||||
template<class T> class IndirectList;
|
||||
template<class T> class BiIndirectList;
|
||||
|
||||
@ -156,6 +158,11 @@ public:
|
||||
// and annull the argument list.
|
||||
void transfer(List<T>&);
|
||||
|
||||
//- Transfer the contents of the argument List into this List
|
||||
// and annull the argument list.
|
||||
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
||||
void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
|
||||
|
||||
//- Return subscript-checked element of UList.
|
||||
inline T& newElmt(const label);
|
||||
|
||||
|
||||
@ -397,13 +397,11 @@ void Foam::globalMeshData::calcSharedEdges() const
|
||||
sharedEdgeLabelsPtr_ = new labelList();
|
||||
labelList& sharedEdgeLabels = *sharedEdgeLabelsPtr_;
|
||||
sharedEdgeLabels.transfer(dynSharedEdgeLabels);
|
||||
dynSharedEdgeLabels.clear();
|
||||
|
||||
dynSharedEdgeAddr.shrink();
|
||||
sharedEdgeAddrPtr_ = new labelList();
|
||||
labelList& sharedEdgeAddr = *sharedEdgeAddrPtr_;
|
||||
sharedEdgeAddr.transfer(dynSharedEdgeAddr);
|
||||
dynSharedEdgeAddr.clear();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
@ -102,8 +102,9 @@ void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::markZone
|
||||
break;
|
||||
}
|
||||
|
||||
changedFaces.transfer(newChangedFaces.shrink());
|
||||
newChangedFaces.clear();
|
||||
// New dynamiclist: can leave dynamicList unshrunk
|
||||
//changedFaces.transfer(newChangedFaces.shrink());
|
||||
changedFaces.transfer(newChangedFaces);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -441,11 +441,10 @@ void primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
forAll(pe, pointI)
|
||||
{
|
||||
DynamicList<label>& pEdges = pe[pointI];
|
||||
inplaceRenumber(oldToNew, pEdges);
|
||||
pEdges.shrink();
|
||||
inplaceRenumber(oldToNew, pEdges);
|
||||
pointEdges[pointI].transfer(pEdges);
|
||||
Foam::sort(pointEdges[pointI]);
|
||||
pEdges.clear();
|
||||
}
|
||||
|
||||
// faceEdges
|
||||
|
||||
@ -29,7 +29,6 @@ License
|
||||
#include "polyMesh.H"
|
||||
#include "cellModeller.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "DynamicList.H"
|
||||
#include "plane.H"
|
||||
#include "ListOps.H"
|
||||
#include "meshTools.H"
|
||||
|
||||
@ -40,7 +40,6 @@ SourceFiles
|
||||
#include "boolList.H"
|
||||
#include "labelList.H"
|
||||
#include "typeInfo.H"
|
||||
#include "DynamicList.H"
|
||||
#include "Map.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -113,10 +113,8 @@ SourceFiles
|
||||
#define meshCutter_H
|
||||
|
||||
#include "edgeVertex.H"
|
||||
#include "boolList.H"
|
||||
#include "labelList.H"
|
||||
#include "typeInfo.H"
|
||||
#include "DynamicList.H"
|
||||
#include "Map.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -26,12 +26,10 @@ License
|
||||
|
||||
#include "refinementIterator.H"
|
||||
#include "polyMesh.H"
|
||||
#include "polyTopoChanger.H"
|
||||
#include "Time.H"
|
||||
#include "refineCell.H"
|
||||
#include "undoableMeshCutter.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "DynamicList.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "cellCuts.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
@ -595,6 +595,7 @@ void Foam::edgeCollapser::updateMesh(const mapPolyMesh& map)
|
||||
{
|
||||
pointRegion_.setSize(mesh_.nPoints());
|
||||
pointRegion_ = -1;
|
||||
// Reset count, do not remove underlying storage
|
||||
pointRegionMaster_.clear();
|
||||
freeRegions_.clear();
|
||||
}
|
||||
|
||||
@ -54,7 +54,6 @@ SourceFiles
|
||||
#define faceCollapser_H
|
||||
|
||||
#include "labelList.H"
|
||||
#include "DynamicList.H"
|
||||
#include "point.H"
|
||||
#include "Map.H"
|
||||
#include "labelHashSet.H"
|
||||
|
||||
@ -96,13 +96,5 @@ void Foam::polyTopoChange::renumberKey
|
||||
elems.transfer(newElems);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -156,7 +156,7 @@ label edgeMesh::regions(labelList& edgeRegion) const
|
||||
}
|
||||
}
|
||||
|
||||
edgesToVisit.transfer(newEdgesToVisit.shrink());
|
||||
edgesToVisit.transfer(newEdgesToVisit);
|
||||
}
|
||||
|
||||
currentRegion++;
|
||||
|
||||
@ -371,7 +371,7 @@ void Foam::cellFeatures::calcSuperFaces() const
|
||||
{
|
||||
superFace.shrink();
|
||||
|
||||
faces[superFaceI] = face(superFace);
|
||||
faces[superFaceI].transfer(superFace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -921,14 +921,7 @@ Foam::List<Foam::pointIndexHit> Foam::meshSearch::intersections
|
||||
|
||||
hits.shrink();
|
||||
|
||||
// Copy into straight list
|
||||
List<pointIndexHit> allHits(hits.size());
|
||||
|
||||
forAll(hits, hitI)
|
||||
{
|
||||
allHits[hitI] = hits[hitI];
|
||||
}
|
||||
return allHits;
|
||||
return hits;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -240,13 +240,10 @@ Foam::distributedTriSurfaceMesh::constructSegments
|
||||
{
|
||||
dynSendMap[procI].shrink();
|
||||
sendMap[procI].transfer(dynSendMap[procI]);
|
||||
dynSendMap[procI].clear();
|
||||
}
|
||||
|
||||
allSegments.transfer(dynAllSegments.shrink());
|
||||
dynAllSegments.clear();
|
||||
allSegmentMap.transfer(dynAllSegmentMap.shrink());
|
||||
dynAllSegmentMap.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -708,15 +705,11 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
|
||||
{
|
||||
dynSendMap[procI].shrink();
|
||||
sendMap[procI].transfer(dynSendMap[procI]);
|
||||
dynSendMap[procI].clear();
|
||||
}
|
||||
|
||||
allCentres.transfer(dynAllCentres.shrink());
|
||||
dynAllCentres.clear();
|
||||
allRadiusSqr.transfer(dynAllRadiusSqr.shrink());
|
||||
dynAllRadiusSqr.clear();
|
||||
allSegmentMap.transfer(dynAllSegmentMap.shrink());
|
||||
dynAllSegmentMap.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -484,7 +484,6 @@ void Foam::searchableBox::findLineAll
|
||||
|
||||
hits.shrink();
|
||||
info[pointI].transfer(hits);
|
||||
hits.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -442,7 +442,6 @@ void Foam::triSurfaceMesh::findLineAll
|
||||
|
||||
hits.shrink();
|
||||
info[pointI].transfer(hits);
|
||||
hits.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -288,11 +288,9 @@ Foam::edgeSurface::edgeSurface
|
||||
|
||||
// Transfer.
|
||||
allEdges.shrink();
|
||||
allEdges.clear();
|
||||
edges_.transfer(allEdges);
|
||||
|
||||
allParentEdges.shrink();
|
||||
allParentEdges.clear();
|
||||
parentEdges_.transfer(allParentEdges);
|
||||
|
||||
forAll(allFaceEdges, faceI)
|
||||
@ -300,7 +298,6 @@ Foam::edgeSurface::edgeSurface
|
||||
DynamicList<label>& allFEdges = allFaceEdges[faceI];
|
||||
|
||||
allFEdges.shrink();
|
||||
allFEdges.clear();
|
||||
faceEdges_[faceI].transfer(allFEdges);
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,6 @@ void Foam::surfaceIntersection::transfer
|
||||
{
|
||||
dList.shrink();
|
||||
lList.transfer(dList);
|
||||
dList.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -199,7 +199,6 @@ void Foam::surfaceFeatures::calcFeatPoints(const List<edgeStatus>& edgeStat)
|
||||
}
|
||||
featurePoints.shrink();
|
||||
featurePoints_.transfer(featurePoints);
|
||||
featurePoints.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,6 @@ SourceFiles
|
||||
#ifndef triSurfaceSearch_H
|
||||
#define triSurfaceSearch_H
|
||||
|
||||
#include "DynamicList.H"
|
||||
#include "pointField.H"
|
||||
#include "boolList.H"
|
||||
#include "pointIndexHit.H"
|
||||
|
||||
@ -300,11 +300,7 @@ Foam::triSurface Foam::triSurfaceTools::doRefine
|
||||
allPoints.transfer(newPoints);
|
||||
newPoints.clear();
|
||||
|
||||
List<labelledTri> allFaces;
|
||||
allFaces.transfer(newFaces);
|
||||
newFaces.clear();
|
||||
|
||||
return triSurface(allFaces, surf.patches(), allPoints);
|
||||
return triSurface(newFaces, surf.patches(), allPoints, true);
|
||||
}
|
||||
|
||||
|
||||
@ -1988,7 +1984,7 @@ Foam::triSurface Foam::triSurfaceTools::greenRefine
|
||||
newFaces.shrink();
|
||||
newPoints.setSize(newPointI);
|
||||
|
||||
return triSurface(newFaces, surf.patches(), newPoints);
|
||||
return triSurface(newFaces, surf.patches(), newPoints, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -154,7 +154,6 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
|
||||
|
||||
dynCuttingPoints.shrink();
|
||||
cutPoints_.transfer(dynCuttingPoints);
|
||||
dynCuttingPoints.clear();
|
||||
|
||||
return edgePoint;
|
||||
}
|
||||
|
||||
@ -25,7 +25,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "midPointSet.H"
|
||||
#include "DynamicList.H"
|
||||
#include "polyMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
@ -25,7 +25,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "midPointAndFaceSet.H"
|
||||
#include "DynamicList.H"
|
||||
#include "polyMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
@ -41,7 +41,6 @@ SourceFiles
|
||||
#include "typeInfo.H"
|
||||
#include "HashPtrTable.H"
|
||||
#include "SLPtrList.H"
|
||||
#include "DynamicList.H"
|
||||
#include "labelList.H"
|
||||
#include "speciesTable.H"
|
||||
#include "atomicWeights.H"
|
||||
|
||||
@ -339,11 +339,7 @@ bool triSurface::readAC(const fileName& ACfileName)
|
||||
allPoints.transfer(points);
|
||||
points.clear();
|
||||
|
||||
List<labelledTri> allFaces;
|
||||
allFaces.transfer(faces);
|
||||
faces.clear();
|
||||
|
||||
*this = triSurface(allFaces, patches, allPoints);
|
||||
*this = triSurface(faces, patches, allPoints, true);
|
||||
|
||||
stitchTriangles(allPoints);
|
||||
|
||||
|
||||
@ -350,7 +350,7 @@ bool triSurface::readNAS(const fileName& OBJfileName)
|
||||
points.clear();
|
||||
|
||||
// Create triSurface
|
||||
*this = triSurface(faces, patches, allPoints);
|
||||
*this = triSurface(faces, patches, allPoints, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -195,14 +195,9 @@ bool triSurface::readOBJ(const fileName& OBJfileName)
|
||||
// Transfer DynamicLists to straight ones.
|
||||
pointField allPoints;
|
||||
allPoints.transfer(points);
|
||||
points.clear();
|
||||
|
||||
List<labelledTri> allFaces;
|
||||
allFaces.transfer(faces);
|
||||
faces.clear();
|
||||
|
||||
// Create triSurface
|
||||
*this = triSurface(allFaces, patches, allPoints);
|
||||
*this = triSurface(faces, patches, allPoints, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user