36 template<
class Triangulation>
46 template<
class Triangulation>
58 Info<<
"Reading " << meshName <<
" from " << runTime.timeName() <<
endl;
115 List<Vb> pointsToInsert(pts.size());
117 forAll(pointsToInsert, pI)
124 static_cast<indexedVertexEnum::vertexType>(types[pI]),
131 pointsToInsert.begin(),
132 pointsToInsert.end(),
137 vertexCount_ = Triangulation::number_of_vertices();
144 template<
class Triangulation>
157 template<
class Triangulation>
160 Info<<
"Clearing triangulation" <<
endl;
162 DynamicList<Vb> vertices;
166 Finite_vertices_iterator vit = Triangulation::finite_vertices_begin();
167 vit != Triangulation::finite_vertices_end();
184 vertices.last().fixed() = vit->fixed();
193 insertPoints(vertices,
false);
195 Info<<
"Inserted " << vertexCount() <<
" fixed points" <<
endl;
199 template<
class Triangulation>
202 const List<Vb>& vertices,
206 return rangeInsertWithInfo
216 template<
class Triangulation>
224 return typename Gt::Less_x_3()(*(p.first), *(q.first));
227 template<
class Triangulation>
235 return typename Gt::Less_y_3()(*(p.first), *(q.first));
238 template<
class Triangulation>
246 return typename Gt::Less_z_3()(*(p.first), *(q.first));
249 template<
class Triangulation>
257 template<
class Triangulation>
265 template<
class Triangulation>
274 template<
class Triangulation>
275 template<
class Po
intIterator>
288 const typename Triangulation::Point*,
291 > vectorPairPointIndex;
293 vectorPairPointIndex
points;
296 for (PointIterator it = begin; it != end; ++it)
300 std::make_pair(&(it->point()), count++)
304 std::random_shuffle(points.begin(), points.end());
310 Traits_for_spatial_sort()
315 Map<label> oldToNewIndex(points.size());
319 typename vectorPairPointIndex::const_iterator p = points.begin();
324 const size_t checkInsertion = Triangulation::number_of_vertices();
326 hint = this->
insert(*(p->first), hint);
328 const Vb& vert = *(begin + p->second);
330 if (checkInsertion != Triangulation::number_of_vertices() - 1)
334 Vertex_handle nearV =
335 Triangulation::nearest_vertex(*(p->first));
337 Pout<<
"Failed insertion : " << vert.
info()
338 <<
" nearest : " << nearV->info();
344 hint->index() = getNewVertexIndex();
348 oldToNewIndex.insert(oldIndex, hint->index());
351 hint->type() = vert.
type();
358 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()
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
CGAL::indexedVertex< K > Vb
timeIndices insert(timeIndex, timeDirs[timeI].value())
void reset()
Clear the entire triangulation.
PointFrompoint toPoint(const Foam::point &p)
prefixOSstream Pout(cout,"Pout")
Foam::tensor & alignment()
Foam::InfoProxy< indexedVertex< Gt, Vb > > info() const
Return info proxy.
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.