/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "conformalVoronoiMesh.H" #include "initialPointsMethod.H" #include "relaxationModel.H" #include "faceAreaWeightModel.H" #include "meshSearch.H" #include "vectorTools.H" #include "IOmanip.H" #include "indexedCellChecks.H" #include "controlMeshRefinement.H" #include "smoothAlignmentSolver.H" #include "OBJstream.H" #include "indexedVertexOps.H" #include "DelaunayMeshTools.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(conformalVoronoiMesh, 0); } const Foam::Enum < Foam::conformalVoronoiMesh::dualMeshPointType > Foam::conformalVoronoiMesh::dualMeshPointTypeNames_ ({ { dualMeshPointType::internal, "internal" }, { dualMeshPointType::surface, "surface" }, { dualMeshPointType::featureEdge, "featureEdge" }, { dualMeshPointType::featurePoint, "featurePoint" }, { dualMeshPointType::constrained, "constrained" }, }); // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // void Foam::conformalVoronoiMesh::cellSizeMeshOverlapsBackground() const { const cellShapeControlMesh& cellSizeMesh = cellShapeControl_.shapeControlMesh(); DynamicList pts(number_of_vertices()); for ( Delaunay::Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit ) { if (vit->internalOrBoundaryPoint() && !vit->referred()) { pts.append(topoint(vit->point())); } } boundBox bb(pts); boundBox cellSizeMeshBb = cellSizeMesh.bounds(); bool fullyContained = true; if (!cellSizeMeshBb.contains(bb)) { Pout<< "Triangulation not fully contained in cell size mesh." << endl; Pout<< "Cell Size Mesh Bounds = " << cellSizeMesh.bounds() << endl; Pout<< "foamyHexMesh Bounds = " << bb << endl; fullyContained = false; } reduce(fullyContained, andOp()); Info<< "Triangulation is " << (fullyContained ? "fully" : "not fully") << " contained in the cell size mesh" << endl; } void Foam::conformalVoronoiMesh::insertInternalPoints ( List& points, bool distribute ) { label nPoints = points.size(); if (Pstream::parRun()) { reduce(nPoints, sumOp