Commit 97f26fe1 authored by Franjo's avatar Franjo
Browse files

Fixed warnings and removed commented code

parent 3952e184
......@@ -30,7 +30,6 @@ Description
#include "triSurf.H"
#include "triSurfacePatchManipulator.H"
#include "demandDrivenData.H"
#include "objectRegistry.H"
#include "Time.H"
#include "meshOctreeCreator.H"
#include "cartesianMeshExtractor.H"
......@@ -297,39 +296,6 @@ cartesian2DMeshGenerator::cartesian2DMeshGenerator(const Time& time)
generateMesh();
}
/*
cartesian2DMeshGenerator::cartesian2DMeshGenerator
(
const objectRegistry& time,
const volScalarField& localCellSize
)
:
db_(time),
surfacePtr_(NULL),
meshDict_
(
IOobject
(
"meshDict",
db_.time().constant(),
db_,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
octreePtr_(NULL),
mesh_(time)
{
fileName surfaceFile = meshDict_.lookup("surfaceFile");
surfacePtr_ = new triSurface(db_.path()/surfaceFile);
octreePtr_ = new meshOctree(*surfacePtr_);
generateMesh();
}
*/
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
cartesian2DMeshGenerator::~cartesian2DMeshGenerator()
......
......@@ -37,7 +37,6 @@ SourceFiles
#include "polyMeshGen.H"
#include "IOdictionary.H"
//#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -115,9 +114,6 @@ public:
//- Construct from time
cartesian2DMeshGenerator(const Time&);
//- Construct from time and desired cell size
//cartesian2DMeshGenerator(const objectRegistry&, const volScalarField&);
// Destructor
~cartesian2DMeshGenerator();
......
......@@ -314,39 +314,6 @@ cartesianMeshGenerator::cartesianMeshGenerator(const Time& time)
generateMesh();
}
/*
cartesianMeshGenerator::cartesianMeshGenerator
(
const objectRegistry& time,
const volScalarField& localCellSize
)
:
db_(time),
surfacePtr_(NULL),
meshDict_
(
IOobject
(
"meshDict",
db_.time().constant(),
db_,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
octreePtr_(NULL),
mesh_(time)
{
fileName surfaceFile = meshDict_.lookup("surfaceFile");
surfacePtr_ = new triSurface(db_.path()/surfaceFile);
octreePtr_ = new meshOctree(*surfacePtr_);
generateMesh();
}
*/
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
cartesianMeshGenerator::~cartesianMeshGenerator()
......
......@@ -118,9 +118,6 @@ public:
//- Construct from time
cartesianMeshGenerator(const Time&);
//- Construct from time and desired cell size
//cartesianMeshGenerator(const objectRegistry&, const volScalarField&);
// Destructor
~cartesianMeshGenerator();
......
......@@ -306,39 +306,6 @@ tetMeshGenerator::tetMeshGenerator(const Time& time)
generateMesh();
}
/*
tetMeshGenerator::tetMeshGenerator
(
const Time& time,
const volScalarField& localCellSize
)
:
runTime_(time),
surfacePtr_(NULL),
meshDict_
(
IOobject
(
"meshDict",
runTime_.constant(),
runTime_,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
octreePtr_(NULL),
mesh_(time)
{
fileName surfaceFile = meshDict_.lookup("surfaceFile");
surfacePtr_ = new triSurface(runTime_.path()/surfaceFile);
octreePtr_ = new meshOctree(*surfacePtr_);
generateMesh();
}
*/
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
tetMeshGenerator::~tetMeshGenerator()
......
......@@ -56,80 +56,77 @@ class Time;
class tetMeshGenerator
{
// Private data
//- reference to Time
const Time& runTime_;
//- reference to Time
const Time& runTime_;
//- pointer to the surface
const triSurf* surfacePtr_;
//- pointer to the surface
const triSurf* surfacePtr_;
//- IOdictionary containing information about cell sizes, etc..
IOdictionary meshDict_;
//- IOdictionary containing information about cell sizes, etc..
IOdictionary meshDict_;
//- pointer to the octree
meshOctree* octreePtr_;
//- pointer to the octree
meshOctree* octreePtr_;
//- mesh
polyMeshGen mesh_;
//- mesh
polyMeshGen mesh_;
// Private member functions
//- create cartesian mesh
void createTetMesh();
//- create cartesian mesh
void createTetMesh();
//- prepare mesh surface
void surfacePreparation();
//- prepare mesh surface
void surfacePreparation();
//- map mesh to the surface and untangle surface
void mapMeshToSurface();
//- map mesh to the surface and untangle surface
void mapMeshToSurface();
//- capture edges and corners
void mapEdgesAndCorners();
//- capture edges and corners
void mapEdgesAndCorners();
//- optimise surface mesh
void optimiseMeshSurface();
//- optimise surface mesh
void optimiseMeshSurface();
//- add boundary layers
void generateBoudaryLayers();
//- add boundary layers
void generateBoudaryLayers();
//- mesh optimisation
void optimiseFinalMesh();
//- mesh optimisation
void optimiseFinalMesh();
//- refine boundary layers
void refBoundaryLayers();
//- refine boundary layers
void refBoundaryLayers();
//- replace boundaries
void replaceBoundaries();
//- replace boundaries
void replaceBoundaries();
//- renumber the mesh
void renumberMesh();
//- renumber the mesh
void renumberMesh();
//- generate mesh
void generateMesh();
//- generate mesh
void generateMesh();
//- Disallow default bitwise copy construct
tetMeshGenerator ( const tetMeshGenerator& );
//- Disallow default bitwise copy construct
tetMeshGenerator(const tetMeshGenerator&);
//- Disallow default bitwise assignment
void operator= ( const tetMeshGenerator& );
//- Disallow default bitwise assignment
void operator=(const tetMeshGenerator&);
public:
// Constructors
//- Construct from time
tetMeshGenerator ( const Time& );
//- Construct from time and desired cell size
//tetMeshGenerator(const Time&, const volScalarField&);
//- Construct from time
tetMeshGenerator(const Time&);
// Destructor
~tetMeshGenerator();
~tetMeshGenerator();
// Member Functions
//- write the mesh
void writeMesh() const;
//- write the mesh
void writeMesh() const;
};
......
......@@ -838,7 +838,6 @@ void edgeExtractor::distributeBoundaryFaces()
{
const meshSurfaceEngine& mse = this->surfaceEngine();
const labelList& bPoints = mse.boundaryPoints();
const labelList& bp = mse.bp();
const faceList::subList& bFaces = mse.boundaryFaces();
const pointFieldPMG& points = mse.points();
......@@ -925,7 +924,6 @@ bool edgeExtractor::distributeBoundaryFacesNormalAlignment()
const pointFieldPMG& points = mesh_.points();
const meshSurfaceEngine& mse = this->surfaceEngine();
const faceList::subList& bFaces = mse.boundaryFaces();
const labelList& bp = mse.bp();
const VRWGraph& faceEdges = mse.faceEdges();
const VRWGraph& edgeFaces = mse.edgeFaces();
......@@ -2494,7 +2492,6 @@ const triSurf* edgeExtractor::surfaceWithPatches(const label bpI) const
const meshSurfaceEngine& mse = surfaceEngine();
const faceList::subList& bFaces = mse.boundaryFaces();
const VRWGraph& pFaces = mse.pointFaces();
const labelList& bp = mse.bp();
const pointFieldPMG& points = mesh_.points();
//- modifier of the new surface mesh
......
......@@ -19,7 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
Description
......@@ -736,7 +736,7 @@ void edgeExtractor::cornerEvaluator::improveCorners
mo.findNearestPointToPatches(mps, dSqS, p, patches);
scalar bestAlignment(0.0);
label bestEdgeIndex;
label bestEdgeIndex(-1);
forAll(pFaces, pfI)
{
......@@ -1002,7 +1002,6 @@ bool edgeExtractor::checkCorners()
meshSurfacePartitioner mPart(mse, newBoundaryPatches);
//- find corners in the current constelation
typedef std::map<label, DynList<label> > idToDynListMap;
const labelHashSet& corners = mPart.corners();
const VRWGraph& pPatches = mPart.pointPatches();
......@@ -1393,7 +1392,7 @@ bool edgeExtractor::checkCorners()
//- check which group of faces shall change patch in order to make
//- the best fitting edge a feature edge
DynList<labelPair> groupPairs, groupPatches;
labelPair groupsForChanging;
labelPair groupsForChanging(-1, -1);
forAll(pEdges, i)
{
const label beI = pEdges[i];
......@@ -1509,7 +1508,11 @@ bool edgeExtractor::checkCorners()
nei = edgeFaces(beI, 1);
const label posNei = pFaces.containsAtPosition(nei);
if( (posNei < 0) || (faceInGroup[posNei] != faceInGroup[j]) )
if
(
(posNei < 0) ||
(faceInGroup[posNei] != faceInGroup[j])
)
{
if( facePatch_[bfI] != facePatch_[nei] )
{
......@@ -1521,8 +1524,20 @@ bool edgeExtractor::checkCorners()
point mps, mpe;
scalar dSqS, dSqE;
meshOctree_.findNearestPointToPatches(mps, dSqS, ps, patches);
meshOctree_.findNearestPointToPatches(mpe, dSqE, pe, patches);
meshOctree_.findNearestPointToPatches
(
mps,
dSqS,
ps,
patches
);
meshOctree_.findNearestPointToPatches
(
mpe,
dSqE,
pe,
patches
);
vector fv = mpe - mps;
fv /= (mag(fv) + VSMALL);
......@@ -1531,7 +1546,8 @@ bool edgeExtractor::checkCorners()
c = max(-1.0, c);
const scalar angle = acos(c);
Eold += 1.0/magE * (dSqS + dSqE) + magE * angle;
Eold +=
1.0/magE * (dSqS + dSqE) + magE * angle;
}
if( otherPatch != facePatch_[nei] )
{
......@@ -1544,8 +1560,20 @@ bool edgeExtractor::checkCorners()
point mps, mpe;
scalar dSqS, dSqE;
meshOctree_.findNearestPointToPatches(mps, dSqS, ps, patches);
meshOctree_.findNearestPointToPatches(mpe, dSqE, pe, patches);
meshOctree_.findNearestPointToPatches
(
mps,
dSqS,
ps,
patches
);
meshOctree_.findNearestPointToPatches
(
mpe,
dSqE,
pe,
patches
);
vector fv = mpe - mps;
fv /= (mag(fv) + VSMALL);
......@@ -1554,7 +1582,8 @@ bool edgeExtractor::checkCorners()
c = max(-1.0, c);
const scalar angle = acos(c);
Enew += 1.0/magE * (dSqS + dSqE) + magE * angle;
Enew +=
1.0/magE * (dSqS + dSqE) + magE * angle;
}
}
}
......@@ -1573,7 +1602,10 @@ bool edgeExtractor::checkCorners()
if( faceInGroup[j] != gp.first() )
continue;
newPatchForFace.append(labelPair(pFaces[j], otherPatch));
newPatchForFace.append
(
labelPair(pFaces[j], otherPatch)
);
}
}
}
......@@ -1613,7 +1645,11 @@ bool edgeExtractor::checkCorners()
nei = edgeFaces(beI, 1);
const label posNei = pFaces.containsAtPosition(nei);
if( (posNei < 0) || (faceInGroup[posNei] != faceInGroup[j]) )
if
(
(posNei < 0) ||
(faceInGroup[posNei] != faceInGroup[j])
)
{
if( facePatch_[bfI] != facePatch_[nei] )
{
......@@ -1626,8 +1662,20 @@ bool edgeExtractor::checkCorners()
point mps, mpe;
scalar dSqS, dSqE;
meshOctree_.findNearestPointToPatches(mps, dSqS, ps, patches);
meshOctree_.findNearestPointToPatches(mpe, dSqE, pe, patches);
meshOctree_.findNearestPointToPatches
(
mps,
dSqS,
ps,
patches
);
meshOctree_.findNearestPointToPatches
(
mpe,
dSqE,
pe,
patches
);
vector fv = mpe - mps;
fv /= (mag(fv) + VSMALL);
......@@ -1636,7 +1684,8 @@ bool edgeExtractor::checkCorners()
c = max(-1.0, c);
const scalar angle = acos(c);
Eold += 1.0/magE * (dSqS + dSqE) + magE * angle;
Eold +=
1.0/magE * (dSqS + dSqE) + magE * angle;
}
if( otherPatch != facePatch_[nei] )
{
......@@ -1649,8 +1698,20 @@ bool edgeExtractor::checkCorners()
point mps, mpe;
scalar dSqS, dSqE;
meshOctree_.findNearestPointToPatches(mps, dSqS, ps, patches);
meshOctree_.findNearestPointToPatches(mpe, dSqE, pe, patches);
meshOctree_.findNearestPointToPatches
(
mps,
dSqS,
ps,
patches
);
meshOctree_.findNearestPointToPatches
(
mpe,
dSqE,
pe,
patches
);
vector fv = mpe - mps;
fv /= (mag(fv) + VSMALL);
......@@ -1659,7 +1720,8 @@ bool edgeExtractor::checkCorners()
c = max(-1.0, c);
const scalar angle = acos(c);
Enew += 1.0/magE * (dSqS + dSqE) + magE * angle;
Enew +=
1.0/magE * (dSqS + dSqE) + magE * angle;
}
}
}
......@@ -1678,25 +1740,31 @@ bool edgeExtractor::checkCorners()
if( faceInGroup[j] != gp.second() )
continue;
newPatchForFace.append(labelPair(pFaces[j], otherPatch));
newPatchForFace.append
(
labelPair(pFaces[j], otherPatch)
);
}
}
}
}
# ifdef DEBUGEdgeExtractor
Info << "New patches for boundary faces " << newPatchForFace << endl;
Info << "New patches for boundary faces "
<< newPatchForFace << endl;
# endif
}
labelHashSet changedPatch;
for(std::map<label, DynList<labelPair> >::const_iterator it=facesAtCornerNewPatches.begin();it!=facesAtCornerNewPatches.end();++it)
typedef std::map<label, DynList<labelPair> > labelToPairMap;
forAllConstIter(labelToPairMap, facesAtCornerNewPatches, it)
{
const DynList<labelPair>& lp = it->second;
forAll(lp, i)
{
if( changedPatch.found(lp[i].first()) )
FatalError << "Face " << lp[i].first() << " is already modified" << abort(FatalError);
FatalError << "Face " << lp[i].first()
<< " is already modified" << abort(FatalError);
changedPatch.insert(lp[i].first());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment