STYLE: Code cleanup and add some comments

This commit is contained in:
laurence
2013-01-10 10:50:05 +00:00
parent 51db019bee
commit ff3654956a
9 changed files with 96 additions and 92 deletions

View File

@ -17,7 +17,7 @@ FoamFile
collapseEdgesCoeffs
{
// Edges shorter than this absolute value will be merged
minimumEdgeLength 1e-8;
minimumEdgeLength 1e-6;
// The maximum angle between two edges that share a point attached to
// no other edges
@ -25,7 +25,7 @@ collapseEdgesCoeffs
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face
reductionFactor 0.5;
reductionFactor 0.5;
}
@ -67,14 +67,17 @@ meshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
meshQualityCoeffDict meshQualityDict;
#include "meshQualityDict";
// Maximum number of smoothing iterations for the reductionFactors
maximumSmoothingIterations 2;
// Maximum number of outer iterations is mesh quality checking is enabled
maximumIterations 10;
maximumIterations 10;
// Maximum number of iterations deletion of a point can cause a bad face
// to be constructed before it is forced to not be deleted
maxPointErrorCount 5;
maxPointErrorCount 5;
}

View File

@ -1,5 +1,4 @@
EXE_INC = \
/* -DFULLDEBUG -g -O0 */ \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \

View File

@ -26,12 +26,6 @@ License
#include "patchToPoly2DMesh.H"
#include "PatchTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::patchToPoly2DMesh::flipFaceOrder()
@ -275,12 +269,9 @@ void Foam::patchToPoly2DMesh::createPolyMeshComponents()
addPatchFacesToOwner();
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct from a primitivePatch
Foam::patchToPoly2DMesh::patchToPoly2DMesh
(
const MeshedSurface<face>& patch,
@ -321,13 +312,5 @@ void Foam::patchToPoly2DMesh::createMesh()
}
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -51,6 +51,7 @@ class patchToPoly2DMesh
{
// Private data
// Reference to the meshed surface
const MeshedSurface<face>& patch_;
const wordList& patchNames_;
@ -62,11 +63,16 @@ class patchToPoly2DMesh
const EdgeMap<label>& mapEdgesRegion_;
pointField points_;
faceList faces_;
labelList owner_;
labelList neighbour_;
//- Description of data_
// Private Member Functions
void flipFaceOrder();
void createNeighbours();
@ -79,9 +85,6 @@ class patchToPoly2DMesh
void createPolyMeshComponents();
// Private Member Functions
//- Disallow default bitwise copy construct
patchToPoly2DMesh(const patchToPoly2DMesh&);
@ -110,47 +113,47 @@ public:
// Member Functions
// Access
pointField& points()
{
return points_;
}
faceList& faces()
{
return faces_;
}
pointField& points()
{
return points_;
}
labelList& owner()
{
return owner_;
}
faceList& faces()
{
return faces_;
}
labelList& neighbour()
{
return neighbour_;
}
labelList& owner()
{
return owner_;
}
const wordList& patchNames() const
{
return patchNames_;
}
labelList& neighbour()
{
return neighbour_;
}
const labelList& patchSizes() const
{
return patchSizes_;
}
const wordList& patchNames() const
{
return patchNames_;
}
const labelList& patchSizes() const
{
return patchSizes_;
}
const labelList& patchStarts() const
{
return patchStarts_;
}
const labelList& patchStarts() const
{
return patchStarts_;
}
// Check
// Edit
void createMesh();
// Write
//- Create the mesh
void createMesh();
};

View File

@ -317,12 +317,12 @@ int main(int argc, char *argv[])
}
// Take over refinement levels and write to new time directory.
Pout<< "\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
Info<< "\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
<< nl << endl;
mesh().write();
Pout<< "End\n" << endl;
Info<< "End\n" << endl;
return 0;
}

View File

@ -2,31 +2,31 @@
#define CGAL_PSURF_RINGS_H_
// This file adapted from
// CGAL-3.7/examples/Jet_fitting_3//PolyhedralSurf_rings.h
// Licensed under CGAL-3.7/LICENSE.FREE_USE
// CGAL-4.0/examples/Jet_fitting_3/PolyhedralSurf_rings.h
// Licensed under CGAL-4.0/LICENSE.FREE_USE
// Copyright (c) 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
// Utrecht University (The Netherlands), ETH Zurich (Switzerland), Freie
// Universitaet Berlin (Germany), INRIA Sophia-Antipolis (France),
// Martin-Luther-University Halle-Wittenberg (Germany), Max-Planck-Institute
// Saarbruecken (Germany), RISC Linz (Austria), and Tel-Aviv University
// (Israel). All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <cassert>

View File

@ -25,7 +25,8 @@ Class
Foam::dynamicIndexedOctree
Description
Non-pointer based hierarchical recursive searching
Non-pointer based hierarchical recursive searching.
Storage is dynamic, so elements can be deleted.
SourceFiles
dynamicIndexedOctree.C
@ -451,6 +452,7 @@ public:
);
}
// Member Functions
// Access
@ -656,6 +658,7 @@ public:
label removeIndex(const label nodIndex, const label index);
// Write
//- Print tree. Either print all indices (printContent = true) or
@ -671,6 +674,7 @@ public:
void writeTreeInfo() const;
// IOstream Operators
friend Ostream& operator<< <Type>

View File

@ -25,6 +25,10 @@ Class
Foam::polyMeshFilter
Description
Filter the edges and faces of a polyMesh whilst satisfying the given mesh
quality criteria.
Works on a copy of the mesh.
SourceFiles
polyMeshFilter.C
@ -102,10 +106,10 @@ class polyMeshFilter
// faces
const scalar faceReductionFactor_;
//-
//- Maximum number of times a deleted point can be associated with the
// creation of a bad face it is forced to be kept.
const label maxPointErrorCount_;
//- The minimum edge length for each edge
scalarField minEdgeLen_;
@ -225,6 +229,7 @@ public:
//- Filter edges only.
label filterEdges(const label nOriginalBadFaces);
//- Filter all faces that are in the face zone indirectPatchFaces
label filterIndirectPatchFaces();
};

View File

@ -61,7 +61,7 @@ class face;
class edge;
/*---------------------------------------------------------------------------*\
Class edgeCollapser Declaration
Class edgeCollapser Declaration
\*---------------------------------------------------------------------------*/
class edgeCollapser
@ -84,12 +84,18 @@ private:
//- Reference to mesh
const polyMesh& mesh_;
//- Controls collapse of a face to an edge
const scalar guardFraction_;
//- Only collapse face to a point if high aspect ratio
const scalar maxCollapseFaceToPointSideLengthCoeff_;
//- Allow a face to be collapsed to a point early, before the test
// to collapse to an edge
const Switch allowEarlyCollapseToPoint_;
//- Fraction of maxCollapseFaceToPointSideLengthCoeff_ to use when
// allowEarlyCollapseToPoint_ is on
const scalar allowEarlyCollapseCoeff_;
@ -266,8 +272,8 @@ public:
const dictionary& meshQualityDict
);
// Check mesh and mark points on faces in error
// Returns boolList with points in error set
//- Check mesh and mark points on faces in error
// Returns boolList with points in error set
static label checkMeshQuality
(
const polyMesh& mesh,
@ -300,7 +306,7 @@ public:
polyTopoChange& meshMod
) const;
// Mark (in collapseEdge) any edges to collapse
//- Mark (in collapseEdge) any edges to collapse
label markSmallEdges
(
const scalarField& minEdgeLen,
@ -309,7 +315,7 @@ public:
Map<point>& collapsePointToLocation
) const;
// Mark (in collapseEdge) any edges to merge
//- Mark (in collapseEdge) any edges to merge
label markMergeEdges
(
const scalar maxCos,
@ -332,6 +338,7 @@ public:
Map<point>& collapsePointToLocation
) const;
//- Marks edges in the faceZone indirectPatchFaces for collapse
void markIndirectPatchFaces
(
PackedBoolList& collapseEdge,