Commit f7d3578e authored by Franjo's avatar Franjo
Browse files

Alowing for large number of additional layers

parent e1665232
......@@ -65,7 +65,7 @@ class meshOctreeAutomaticRefinement
//- use DATA boxes
bool useDATABoxes_;
//- a flag for activating paired refinement
bool hexRefinement_;
......@@ -99,18 +99,18 @@ class meshOctreeAutomaticRefinement
void setMaxRefLevel();
//- refine selected boxes
void refineSelectedBoxes(List<direction>&, labelLongList&);
void refineSelectedBoxes(labelList&, labelLongList&);
//- refine DATA boxes based on curvature
bool curvatureRefinement();
bool refineBasedOnCurvature(List<direction>&, const labelLongList&);
bool refineBasedOnCurvature(labelList&, const labelLongList&);
//- refine DATA boxes which contain two or more independent parts
//- of the surface in their vicinity
bool proximityRefinement();
bool refineBasedOnProximityTests
(
List<direction>&,
labelList&,
const labelLongList&
);
......@@ -118,14 +118,14 @@ class meshOctreeAutomaticRefinement
//- edges, etc.
bool refineBasedOnContainedPartitions
(
List<direction>&,
labelList&,
const labelLongList&
);
//- refine boxes based on the number of contained surface corners
bool refineBasedOnContainedCorners
(
List<direction>&,
labelList&,
const labelLongList&
);
......@@ -151,7 +151,7 @@ public:
// Destructor
~meshOctreeAutomaticRefinement();
// Member Functions
//- activate hex refinement
void activateHexRefinement();
......
......@@ -78,7 +78,7 @@ void meshOctreeAutomaticRefinement::automaticRefinement()
bool meshOctreeAutomaticRefinement::curvatureRefinement()
{
List<direction> refineBox(octree_.numberOfLeaves(), direction(0));
labelList refineBox(octree_.numberOfLeaves(), direction(0));
labelLongList refinementCandidates;
forAll(refineBox, i)
refinementCandidates.append(i);
......@@ -93,7 +93,7 @@ bool meshOctreeAutomaticRefinement::curvatureRefinement()
bool meshOctreeAutomaticRefinement::proximityRefinement()
{
bool refine(false);
List<direction> refineBox(octree_.numberOfLeaves(), direction(0));
labelList refineBox(octree_.numberOfLeaves(), direction(0));
labelLongList refinementCandidates;
forAll(refineBox, i)
refinementCandidates.append(i);
......@@ -126,7 +126,7 @@ bool meshOctreeAutomaticRefinement::proximityRefinement()
bool meshOctreeAutomaticRefinement::refineBasedOnContainedCorners
(
List<direction>& refineBox,
labelList& refineBox,
const labelLongList& refCandidates
)
{
......@@ -220,7 +220,7 @@ bool meshOctreeAutomaticRefinement::refineBasedOnContainedCorners
bool meshOctreeAutomaticRefinement::refineBasedOnContainedPartitions
(
List<direction>& refineBox,
labelList& refineBox,
const labelLongList& refCandidates
)
{
......@@ -326,7 +326,7 @@ bool meshOctreeAutomaticRefinement::refineBasedOnContainedPartitions
bool meshOctreeAutomaticRefinement::refineBasedOnCurvature
(
List<direction>& refineBox,
labelList& refineBox,
const labelLongList& refCandidates
)
{
......@@ -398,7 +398,7 @@ bool meshOctreeAutomaticRefinement::refineBasedOnCurvature
bool meshOctreeAutomaticRefinement::refineBasedOnProximityTests
(
List<direction>& refineBox,
labelList& refineBox,
const labelLongList& refCandidates
)
{
......@@ -462,7 +462,7 @@ bool meshOctreeAutomaticRefinement::refineBasedOnProximityTests
void meshOctreeAutomaticRefinement::refineSelectedBoxes
(
List<direction>& refineBox,
labelList& refineBox,
labelLongList& refCandidates
)
{
......
......@@ -88,7 +88,7 @@ private:
void refineBoxesIntersectingEdgeMeshes();
//- refine boxes near DATA boxes to get a nice smooth surface
void refineBoxesNearDataBoxes(const direction nLayers = 1);
void refineBoxesNearDataBoxes(const label nLayers = 1);
//- refine boxes of the given flag to the given size
void refineBoxes(const direction refLevel, const direction cubeType);
......
......@@ -71,7 +71,7 @@ void meshOctreeCreator::refineBoundary()
const scalar startIter = omp_get_wtime();
# endif
List<direction> refineCubes(leaves.size(), direction(0));
labelList refineCubes(leaves.size(), 0);
labelList nLayers(leaves.size(), 0);
List<direction> targetLevel(leaves.size(), direction(0));
bool useNLayers(false);
......@@ -296,7 +296,7 @@ void meshOctreeCreator::refineBoxesContainedInObjects()
nMarked = 0;
List<direction> refineCubes(leaves.size(), direction(0));
labelList refineCubes(leaves.size(), 0);
labelList nLayers(leaves.size(), 0);
List<direction> targetRefLevel(leaves.size(), direction(0));
bool useNLayers(false);
......@@ -512,7 +512,7 @@ void meshOctreeCreator::refineBoxesIntersectingSurfaces()
nMarked = 0;
List<direction> refineCubes(leaves.size(), direction(0));
labelList refineCubes(leaves.size(), 0);
labelList nLayers(leaves.size(), 0);
List<direction> targetRefLevel(leaves.size(), direction(0));
bool useNLayers(false);
......@@ -747,7 +747,7 @@ void meshOctreeCreator::refineBoxesIntersectingEdgeMeshes()
nMarked = 0;
List<direction> refineCubes(leaves.size(), direction(0));
labelList refineCubes(leaves.size(), 0);
labelList nLayers(leaves.size(), 0);
List<direction> targetRefLevel(leaves.size(), direction(0));
bool useNLayers(false);
......@@ -884,7 +884,7 @@ void meshOctreeCreator::refineBoxesIntersectingEdgeMeshes()
Info << "Finished refinement of boxes intersecting edge meshes" << endl;
}
void meshOctreeCreator::refineBoxesNearDataBoxes(const direction nLayers)
void meshOctreeCreator::refineBoxesNearDataBoxes(const label nLayers)
{
# ifdef OCTREETiming
const scalar startTime = omp_get_wtime();
......@@ -905,7 +905,7 @@ void meshOctreeCreator::refineBoxesNearDataBoxes(const direction nLayers)
<< " type " << label(leaves[leafI]->cubeType()) << endl;
# endif
List<direction> refineBox(leaves.size(), direction(0));
labelList refineBox(leaves.size(), 0);
labelHashSet transferCoordinates;
LongList<meshOctreeCubeCoordinates> checkCoordinates;
......@@ -1008,7 +1008,7 @@ void meshOctreeCreator::refineBoxesNearDataBoxes(const direction nLayers)
}
}
for(direction i=1;i<nLayers;i++)
for(label i=1;i<nLayers;i++)
{
if( Pstream::parRun() )
{
......@@ -1166,7 +1166,7 @@ void meshOctreeCreator::refineBoxes
const LongList<meshOctreeCube*>& leaves = octreeMod.leavesAccess();
List<direction> refineCubes(leaves.size(), direction(0));
labelList refineCubes(leaves.size(), direction(0));
# ifdef USE_OMP
# pragma omp parallel for if( leaves.size() > 1000 ) \
......
......@@ -54,11 +54,11 @@ class meshOctreeModifier
// Private member functions
//- correct refinement such that it produces 1-irregular octree
void ensureCorrectRegularity(List<direction>& refineBox);
void ensureCorrectRegularity(labelList& refineBox);
//- add additional refinement with the following rule. If a son
//- of a father box is refined, then refine all other sons
bool ensureCorrectRegularitySons(List<direction>& refineBox);
bool ensureCorrectRegularitySons(labelList& refineBox);
// Private copy constructor
//- Disallow default bitwise copy construct
......@@ -126,8 +126,8 @@ public:
//- mark additional layers around the leaves selected for refinement
void markAdditionalLayers
(
List<direction>& refineBox,
const direction nLayers = 1
labelList& refineBox,
const label nLayers = 1
) const;
//- mark additional layers around the leaves selected for refinement
......@@ -135,7 +135,7 @@ public:
//- returns the number of boxes selected for refinement
label markAdditionalLayers
(
List<direction>& refineBox,
labelList& refineBox,
labelList& nLayers,
List<direction>& targetRefLevel
) const;
......@@ -145,7 +145,7 @@ public:
//- sons of the same father, if a single son gets marked for refinement
void refineSelectedBoxes
(
List<direction>& refineBox,
labelList& refineBox,
const bool hexRefinement = false
);
......
......@@ -41,7 +41,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void meshOctreeModifier::ensureCorrectRegularity(List<direction>& refineBox)
void meshOctreeModifier::ensureCorrectRegularity(labelList& refineBox)
{
const FixedList<meshOctreeCubeCoordinates, 26>& rp =
octree_.regularityPositions_;
......@@ -190,7 +190,7 @@ void meshOctreeModifier::ensureCorrectRegularity(List<direction>& refineBox)
while( nMarked != 0 );
}
bool meshOctreeModifier::ensureCorrectRegularitySons(List<direction>& refineBox)
bool meshOctreeModifier::ensureCorrectRegularitySons(labelList& refineBox)
{
const LongList<meshOctreeCube*>& leaves = octree_.leaves_;
......
......@@ -48,8 +48,8 @@ namespace Foam
void meshOctreeModifier::markAdditionalLayers
(
List<direction>& refineBox,
const direction nLayers
labelList& refineBox,
const label nLayers
) const
{
const FixedList<meshOctreeCubeCoordinates, 26>& rp =
......@@ -61,7 +61,7 @@ void meshOctreeModifier::markAdditionalLayers
FixedList<meshOctreeCube*, 26> neighbours;
for(direction i=1;i<=nLayers;++i)
for(label i=1;i<=nLayers;++i)
{
LongList<meshOctreeCubeCoordinates> processorChecks;
......@@ -166,7 +166,7 @@ void meshOctreeModifier::markAdditionalLayers
label meshOctreeModifier::markAdditionalLayers
(
List<direction>& refineBox,
labelList& refineBox,
labelList& nLayers,
List<direction>& targetRefLevel
) const
......@@ -222,7 +222,7 @@ label meshOctreeModifier::markAdditionalLayers
//- mark additional boxes for refinement
for(direction levelI=maxLevel;levelI>0;--levelI)
{
List<direction> markedBoxes(leaves.size(), direction(0));
labelList markedBoxes(leaves.size(), 0);
label counter(0);
# ifdef USE_OMP
......@@ -271,7 +271,7 @@ label meshOctreeModifier::markAdditionalLayers
void meshOctreeModifier::refineSelectedBoxes
(
List<direction>& refineBox,
labelList& refineBox,
const bool hexRefinement
)
{
......
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