37 template<
class Triangulation>
47 template<
class Triangulation>
59 Info<<
"Reading " << meshName <<
" from " << runTime.timeName() <<
endl;
116 List<Vb> pointsToInsert(pts.size());
118 forAll(pointsToInsert, pI)
125 static_cast<indexedVertexEnum::vertexType>(types[pI]),
132 pointsToInsert.begin(),
133 pointsToInsert.end(),
138 vertexCount_ = Triangulation::number_of_vertices();
145 template<
class Triangulation>
158 template<
class Triangulation>
161 Info<<
"Clearing triangulation" <<
endl;
167 Finite_vertices_iterator vit = Triangulation::finite_vertices_begin();
168 vit != Triangulation::finite_vertices_end();
185 vertices.last().fixed() = vit->fixed();
194 insertPoints(vertices,
false);
196 Info<<
"Inserted " << vertexCount() <<
" fixed points" <<
endl;
200 template<
class Triangulation>
203 const List<Vb>& vertices,
207 return rangeInsertWithInfo
217 template<
class Triangulation>
225 return typename Gt::Less_x_3()(*(p.first), *(q.first));
228 template<
class Triangulation>
236 return typename Gt::Less_y_3()(*(p.first), *(q.first));
239 template<
class Triangulation>
247 return typename Gt::Less_z_3()(*(p.first), *(q.first));
250 template<
class Triangulation>
258 template<
class Triangulation>
266 template<
class Triangulation>
275 template<
class Triangulation>
276 template<
class Po
intIterator>
289 const typename Triangulation::Point*,
292 > vectorPairPointIndex;
294 vectorPairPointIndex
points;
297 for (PointIterator it = begin; it != end; ++it)
301 std::make_pair(&(it->point()), count++)
305 std::random_shuffle(points.begin(), points.end());
311 Traits_for_spatial_sort()
316 Map<label> oldToNewIndex(points.size());
320 typename vectorPairPointIndex::const_iterator p = points.begin();
325 const size_t checkInsertion = Triangulation::number_of_vertices();
327 hint = this->
insert(*(p->first), hint);
329 const Vb& vert = *(begin + p->second);
331 if (checkInsertion != Triangulation::number_of_vertices() - 1)
335 Vertex_handle nearV =
336 Triangulation::nearest_vertex(*(p->first));
338 Pout<<
"Failed insertion : " << vert.
info()
339 <<
" nearest : " << nearV->info();
345 hint->index() = getNewVertexIndex();
349 oldToNewIndex.insert(oldIndex, hint->index());
352 hint->type() = vert.
type();
359 return oldToNewIndex;
Map< label > rangeInsertWithInfo(PointIterator begin, PointIterator end, bool printErrors=false, bool reIndex=true)
Function inserting points into a triangulation and setting the.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
The vertex and cell classes must have an index defined.
vectorIOField pointIOField
pointIOField is a vectorIOField.
~DelaunayMesh()
Destructor.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Foam::scalar & targetCellSize()
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
pointField vertices(const blockVertexList &bvl)
DelaunayMesh(const Time &runTime)
Construct from components.
CGAL::indexedVertex< K > Vb
void append(const T &)
Append an element at the end of the list.
void reset()
Clear the entire triangulation.
PointFrompoint toPoint(const Foam::point &p)
Foam::InfoProxy< indexedVertex< Gt, Vb > > info() const
Return info proxy.
Foam::tensor & alignment()
prefixOSstream Pout(cout, "Pout")
Map< label > insertPoints(const List< Vb > &vertices, const bool reIndex)
Insert the list of vertices (calls rangeInsertWithInfo)
IOField< label > labelIOField
labelField with IO.
A HashTable to objects of type <T> with a label key.