diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C index 27cc47f823..18109761a5 100644 --- a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C +++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C @@ -466,8 +466,8 @@ int main(int argc, char *argv[]) labelListList pointPoints; autoPtr meshDistributor = buildMap(mesh, pointPoints); - triadField alignments = buildAlignmentField(mesh); - pointField points = buildPointField(mesh); + triadField alignments(buildAlignmentField(mesh)); + pointField points(buildPointField(mesh)); mesh.printInfo(Info); diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H index 124f4b39dc..fcc5d8c2ba 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H @@ -168,7 +168,8 @@ public: ); //- Inserts points into the triangulation if the point is within - // the circumsphere of another cell + // the circumsphere of another cell. Returns HashSet of failed + // point insertions template labelPairHashSet rangeInsertReferredWithInfo ( diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C index a6b47f4ab0..7238f270bb 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C @@ -585,7 +585,7 @@ Foam::label Foam::cellShapeControl::refineMesh const autoPtr& decomposition ) { - const pointField cellCentres = shapeControlMesh_.cellCentres(); + const pointField cellCentres(shapeControlMesh_.cellCentres()); Info<< " Created cell centres" << endl; @@ -682,7 +682,7 @@ Foam::label Foam::cellShapeControl::refineMesh ) ); verts.last().targetCellSize() = lastCellSize; - verts.last().alignment() = tensor::I; + verts.last().alignment() = triad::unset; } } @@ -704,8 +704,8 @@ void Foam::cellShapeControl::smoothMesh() pointPoints ); - triadField alignments = buildAlignmentField(shapeControlMesh_); - pointField points = buildPointField(shapeControlMesh_); + triadField alignments(buildAlignmentField(shapeControlMesh_)); + pointField points(buildPointField(shapeControlMesh_)); // Setup the sizes and alignments on each point triadField fixedAlignments(shapeControlMesh_.vertexCount(), triad::unset); @@ -721,12 +721,7 @@ void Foam::cellShapeControl::smoothMesh() { const tensor& alignment = vit->alignment(); - fixedAlignments[vit->index()] = triad - ( - alignment.x(), - alignment.y(), - alignment.z() - ); + fixedAlignments[vit->index()] = alignment; } } @@ -881,12 +876,7 @@ void Foam::cellShapeControl::smoothMesh() { if (vit->real()) { - vit->alignment() = tensor - ( - alignments[vit->index()].x(), - alignments[vit->index()].y(), - alignments[vit->index()].z() - ); + vit->alignment() = alignments[vit->index()]; } } @@ -911,9 +901,7 @@ void Foam::cellShapeControl::smoothMesh() { if (vit->referred()) { - const triad& t = alignments[referredPoints[referredI++]]; - - vit->alignment() = tensor(t.x(), t.y(), t.z()); + vit->alignment() = alignments[referredPoints[referredI++]]; } } } diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C index bdcbf5a885..ae57bbb087 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C @@ -684,7 +684,7 @@ void Foam::cellShapeControlMesh::insertBoundingPoints(const boundBox& bb) boundBox bbInflate = bb; bbInflate.inflate(10); - pointField pts = bbInflate.points(); + pointField pts(bbInflate.points()); forAll(pts, pI) { diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index e8f09cf5f1..4a73b4a7c5 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -263,8 +263,6 @@ Foam::triSurfaceScalarField Foam::automatic::load() surfaceCellSize.write(); - debug = 1; - if (debug) { faceList faces(surface_.size()); diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index d2aa6a8027..5eb2c01f5f 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -212,9 +212,8 @@ void Foam::conformalVoronoiMesh::checkDuals() typedef CGAL::Exact_predicates_exact_constructions_kernel EK2; typedef CGAL::Regular_triangulation_euclidean_traits_3 EK; - typedef CGAL::Cartesian_converter To_exact; - typedef CGAL::Cartesian_converter - Back_from_exact; + typedef CGAL::Cartesian_converter To_exact; + typedef CGAL::Cartesian_converter Back_from_exact; // PackedBoolList bPoints(number_of_finite_cells()); @@ -392,13 +391,13 @@ void Foam::conformalVoronoiMesh::checkDuals() CGAL::Gmpq z(CGAL::to_double(masterPoint.z())); std::cout<< "master = " << x << " " << y << " " << z - << endl; + << std::endl; CGAL::Gmpq xs(CGAL::to_double(closestPoint.x())); CGAL::Gmpq ys(CGAL::to_double(closestPoint.y())); CGAL::Gmpq zs(CGAL::to_double(closestPoint.z())); std::cout<< "slave = " << xs << " " << ys << " " << zs - << endl; + << std::endl; } } else diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H index 02d37c1b05..ea9e4db6d4 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H @@ -142,7 +142,7 @@ inline int CGAL::indexedVertex::index() const template -inline typename CGAL::indexedVertex::vertexType& +inline Foam::indexedVertexEnum::vertexType& CGAL::indexedVertex::type() { return type_; @@ -150,7 +150,7 @@ CGAL::indexedVertex::type() template -inline typename CGAL::indexedVertex::vertexType +inline Foam::indexedVertexEnum::vertexType CGAL::indexedVertex::type() const { return type_; diff --git a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H index d9e5736ca2..cbf6466d26 100644 --- a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H +++ b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,6 @@ SourceFiles #define symmTensor_H #include "SymmTensor.H" -#include "vector.H" #include "contiguous.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Tensor/Tensor.H b/src/OpenFOAM/primitives/Tensor/Tensor.H index 8b3c1d9a9d..94b567d532 100644 --- a/src/OpenFOAM/primitives/Tensor/Tensor.H +++ b/src/OpenFOAM/primitives/Tensor/Tensor.H @@ -103,6 +103,9 @@ public: //- Construct given SymmTensor inline Tensor(const SymmTensor&); + //- Construct given triad + inline Tensor(const Vector >&); + //- Construct given the three vector components inline Tensor ( @@ -165,6 +168,9 @@ public: //- Assign to a SymmTensor inline void operator=(const SymmTensor&); + + //- Assign to a triad + inline void operator=(const Vector >&); }; diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H index 237bb6ceb3..416507e6b7 100644 --- a/src/OpenFOAM/primitives/Tensor/TensorI.H +++ b/src/OpenFOAM/primitives/Tensor/TensorI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,6 +66,24 @@ inline Tensor::Tensor(const SymmTensor& st) } +//- Construct given triad +template +inline Tensor::Tensor(const Vector >& tr) +{ + this->v_[XX] = tr.x().x(); + this->v_[XY] = tr.x().y(); + this->v_[XZ] = tr.x().z(); + + this->v_[YX] = tr.y().x(); + this->v_[YY] = tr.y().y(); + this->v_[YZ] = tr.y().z(); + + this->v_[ZX] = tr.z().x(); + this->v_[ZY] = tr.z().y(); + this->v_[ZZ] = tr.z().z(); +} + + //- Construct given the three vector components template inline Tensor::Tensor @@ -272,6 +290,23 @@ inline void Tensor::operator=(const SymmTensor& st) } +template +inline void Tensor::operator=(const Vector >& tr) +{ + this->v_[XX] = tr.x().x(); + this->v_[XY] = tr.x().y(); + this->v_[XZ] = tr.x().z(); + + this->v_[YX] = tr.y().x(); + this->v_[YY] = tr.y().y(); + this->v_[YZ] = tr.y().z(); + + this->v_[ZX] = tr.z().x(); + this->v_[ZY] = tr.z().y(); + this->v_[ZZ] = tr.z().z(); +} + + // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // //- Hodge Dual operator (tensor -> vector) diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C index 80218dc776..2382e2c321 100644 --- a/src/OpenFOAM/primitives/triad/triad.C +++ b/src/OpenFOAM/primitives/triad/triad.C @@ -25,7 +25,6 @@ License #include "triad.H" #include "transform.H" -#include "tensor.H" #include "quaternion.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -63,6 +62,14 @@ Foam::triad::triad(const quaternion& q) } +Foam::triad::triad(const tensor& t) +{ + x() = t.x(); + y() = t.y(); + z() = t.z(); +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::triad::orthogonalize() @@ -331,6 +338,16 @@ Foam::triad::operator quaternion() const } +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +void Foam::triad::operator=(const tensor& t) +{ + x() = t.x(); + y() = t.y(); + z() = t.z(); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/primitives/triad/triad.H b/src/OpenFOAM/primitives/triad/triad.H index 624116602e..3915faff50 100644 --- a/src/OpenFOAM/primitives/triad/triad.H +++ b/src/OpenFOAM/primitives/triad/triad.H @@ -40,6 +40,7 @@ SourceFiles #define triad_H #include "vector.H" +#include "tensor.H" #include "contiguous.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +59,6 @@ Ostream& operator<<(Ostream&, const triad&); class quaternion; - /*---------------------------------------------------------------------------*\ Class triad Declaration \*---------------------------------------------------------------------------*/ @@ -87,6 +87,9 @@ public: //- Construct from a quaternion triad(const quaternion& q); + //- Construct from a tensor + triad(const tensor& t); + //- Construct from Istream inline triad(Istream&); @@ -135,6 +138,8 @@ public: inline void operator=(const Vector&); + void operator=(const tensor& t); + //- Add the triad t2 to this triad // without normalizing or orthogonalizing void operator+=(const triad& t2); diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C index 0aebc63a0d..fb93ad0d42 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C @@ -496,7 +496,6 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces) faceFilterFactor_.resize(mesh_.nFaces(), initialFaceLengthFactor_); // Maintain the number of times a point has been part of a bad face - // labelList pointErrorCount(mesh_.nPoints(), 0); // Main loop diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C index 7b1871cd9a..b48d0ee60e 100644 --- a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C +++ b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C @@ -564,8 +564,6 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeaturePoints List& info ) const { - DynamicList dynPointHit; - // Pick up all the feature points that intersect the search sphere labelList elems = pointTree().findSphere ( @@ -573,6 +571,8 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeaturePoints searchRadiusSqr ); + DynamicList dynPointHit(elems.size()); + forAll(elems, elemI) { label index = elems[elemI]; @@ -609,7 +609,7 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeatureEdges sliceStarts[3] = openStart_; sliceStarts[4] = multipleStart_; - DynamicList dynEdgeHit; + DynamicList dynEdgeHit(edgeTrees.size()*3); // Loop over all the feature edge types forAll(edgeTrees, i)