Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
integration-cfmesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Community
integration-cfmesh
Commits
109565f5
Commit
109565f5
authored
Sep 18, 2017
by
Mark Olesen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: use updated dictionary methods
- Eg, readIfPresent() instead of found() followed by lookup()
parent
37f772b2
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
385 additions
and
670 deletions
+385
-670
meshLibrary/cartesian2DMesh/cartesian2DMeshGenerator/cartesian2DMeshGenerator.C
...DMesh/cartesian2DMeshGenerator/cartesian2DMeshGenerator.C
+9
-3
meshLibrary/cartesianMesh/cartesianMeshGenerator/cartesianMeshGenerator.C
...esianMesh/cartesianMeshGenerator/cartesianMeshGenerator.C
+19
-9
meshLibrary/tetMesh/tetMeshGenerator/tetMeshGenerator.C
meshLibrary/tetMesh/tetMeshGenerator/tetMeshGenerator.C
+16
-12
meshLibrary/utilities/anisotropicMeshing/coordinateModification/boxScaling.C
...es/anisotropicMeshing/coordinateModification/boxScaling.C
+7
-53
meshLibrary/utilities/anisotropicMeshing/coordinateModification/planeScaling.C
.../anisotropicMeshing/coordinateModification/planeScaling.C
+5
-26
meshLibrary/utilities/boundaryLayers/refineBoundaryLayers/refineBoundaryLayers.C
...oundaryLayers/refineBoundaryLayers/refineBoundaryLayers.C
+43
-33
meshLibrary/utilities/boundaryLayers/triangulateNonPlanarBaseFaces/triangulateNonPlanarBaseFaces.C
...ngulateNonPlanarBaseFaces/triangulateNonPlanarBaseFaces.C
+2
-4
meshLibrary/utilities/checkMeshDict/checkMeshDict.C
meshLibrary/utilities/checkMeshDict/checkMeshDict.C
+113
-192
meshLibrary/utilities/meshes/polyMeshGenChecks/polyMeshGenChecksGeometry.C
...ties/meshes/polyMeshGenChecks/polyMeshGenChecksGeometry.C
+37
-63
meshLibrary/utilities/octrees/meshOctree/meshOctreeAddressing/meshOctreeAddressing.C
...es/meshOctree/meshOctreeAddressing/meshOctreeAddressing.C
+2
-10
meshLibrary/utilities/octrees/meshOctree/meshOctreeAddressing/meshOctreeAddressingCreation.C
...ctree/meshOctreeAddressing/meshOctreeAddressingCreation.C
+8
-16
meshLibrary/utilities/octrees/meshOctree/meshOctreeAddressing/meshOctreeAddressingGluedMesh.C
...tree/meshOctreeAddressing/meshOctreeAddressingGluedMesh.C
+6
-13
meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorAdjustOctreeToSurface.C
...eshOctreeCreator/meshOctreeCreatorAdjustOctreeToSurface.C
+6
-16
meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C
...ee/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C
+23
-19
meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/boxRefinement.C
...ctree/refinementControls/objectRefinement/boxRefinement.C
+4
-24
meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/coneRefinement.C
...tree/refinementControls/objectRefinement/coneRefinement.C
+4
-24
meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/hollowConeRefinement.C
...efinementControls/objectRefinement/hollowConeRefinement.C
+8
-37
meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/lineRefinement.C
...tree/refinementControls/objectRefinement/lineRefinement.C
+2
-11
meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/objectRefinement.C
...ee/refinementControls/objectRefinement/objectRefinement.C
+6
-9
meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/sphereRefinement.C
...ee/refinementControls/objectRefinement/sphereRefinement.C
+2
-11
meshLibrary/utilities/smoothers/geometry/meshOptimizer/boundaryLayerOptimisation/boundaryLayerOptimisation.C
...zer/boundaryLayerOptimisation/boundaryLayerOptimisation.C
+14
-27
meshLibrary/utilities/smoothers/geometry/meshOptimizer/optimizeMeshFV.C
...ilities/smoothers/geometry/meshOptimizer/optimizeMeshFV.C
+4
-9
meshLibrary/utilities/surfaceTools/renameBoundaryPatches/renameBoundaryPatches.C
...urfaceTools/renameBoundaryPatches/renameBoundaryPatches.C
+10
-17
meshLibrary/utilities/workflowControls/workflowControls.C
meshLibrary/utilities/workflowControls/workflowControls.C
+17
-20
meshLibrary/voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C
...y/voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C
+18
-12
No files found.
meshLibrary/cartesian2DMesh/cartesian2DMeshGenerator/cartesian2DMeshGenerator.C
View file @
109565f5
...
...
@@ -62,10 +62,16 @@ void cartesian2DMeshGenerator::createCartesianMesh()
// create polyMesh from octree boxes
cartesianMeshExtractor
cme
(
*
octreePtr_
,
meshDict_
,
mesh_
);
if
(
meshDict_
.
found
(
"decomposePolyhedraIntoTetsAndPyrs"
))
if
(
meshDict_
.
lookupOrDefault
<
bool
>
(
"decomposePolyhedraIntoTetsAndPyrs"
,
false
)
)
{
if
(
readBool
(
meshDict_
.
lookup
(
"decomposePolyhedraIntoTetsAndPyrs"
)))
cme
.
decomposeSplitHexes
();
cme
.
decomposeSplitHexes
();
}
cme
.
createMesh
();
...
...
meshLibrary/cartesianMesh/cartesianMeshGenerator/cartesianMeshGenerator.C
View file @
109565f5
...
...
@@ -61,10 +61,16 @@ void cartesianMeshGenerator::createCartesianMesh()
// create polyMesh from octree boxes
cartesianMeshExtractor
cme
(
*
octreePtr_
,
meshDict_
,
mesh_
);
if
(
meshDict_
.
found
(
"decomposePolyhedraIntoTetsAndPyrs"
))
if
(
meshDict_
.
lookupOrDefault
<
bool
>
(
"decomposePolyhedraIntoTetsAndPyrs"
,
false
)
)
{
if
(
readBool
(
meshDict_
.
lookup
(
"decomposePolyhedraIntoTetsAndPyrs"
)))
cme
.
decomposeSplitHexes
();
cme
.
decomposeSplitHexes
();
}
cme
.
createMesh
();
...
...
@@ -169,12 +175,12 @@ void cartesianMeshGenerator::refBoundaryLayers()
void
cartesianMeshGenerator
::
optimiseFinalMesh
()
{
// untangle the surface if needed
bool
enforceConstraints
(
false
);
if
(
meshDict_
.
found
(
"enforceGeometryConstraints"
))
{
enforceConstraints
=
readBool
(
meshDict_
.
lookup
(
"enforceGeometryConstraints"
));
}
const
bool
enforceConstraints
=
meshDict_
.
lookupOrDefault
<
bool
>
(
"enforceGeometryConstraints"
,
false
);
if
(
true
)
{
...
...
@@ -182,7 +188,9 @@ void cartesianMeshGenerator::optimiseFinalMesh()
meshSurfaceOptimizer
surfOpt
(
mse
,
*
octreePtr_
);
if
(
enforceConstraints
)
{
surfOpt
.
enforceConstraints
();
}
surfOpt
.
optimizeSurface
();
}
...
...
@@ -192,7 +200,9 @@ void cartesianMeshGenerator::optimiseFinalMesh()
// final optimisation
meshOptimizer
optimizer
(
mesh_
);
if
(
enforceConstraints
)
{
optimizer
.
enforceConstraints
();
}
optimizer
.
optimizeMeshFV
();
optimizer
.
optimizeLowQualityFaces
();
...
...
meshLibrary/tetMesh/tetMeshGenerator/tetMeshGenerator.C
View file @
109565f5
...
...
@@ -125,21 +125,23 @@ void tetMeshGenerator::generateBoundaryLayers()
const
dictionary
&
bndLayers
=
meshDict_
.
subDict
(
"boundaryLayers"
);
if
(
bndLayers
.
found
(
"nLayers"
))
label
nLayers
;
if
(
bndLayers
.
readIfPresent
(
"nLayers"
,
nLayers
))
{
const
label
nLayers
=
readLabel
(
bndLayers
.
lookup
(
"nLayers"
));
if
(
nLayers
>
0
)
{
bl
.
addLayerForAllPatches
();
}
}
else
if
(
bndLayers
.
found
(
"patchBoundaryLayers"
))
{
const
dictionary
&
patchLayers
=
bndLayers
.
subDict
(
"patchBoundaryLayers"
);
const
wordList
createLayers
=
patchLayers
.
toc
();
forAll
(
createLayers
,
patchI
)
bl
.
addLayerForPatch
(
createLayers
[
patchI
]);
for
(
const
word
&
patchName
:
patchLayers
.
toc
())
{
bl
.
addLayerForPatch
(
patchName
);
}
}
}
}
...
...
@@ -148,16 +150,18 @@ void tetMeshGenerator::generateBoundaryLayers()
void
tetMeshGenerator
::
optimiseFinalMesh
()
{
// final optimisation
bool
enforceConstraints
(
false
);
if
(
meshDict_
.
found
(
"enforceGeometryConstraints"
))
{
enforceConstraints
=
readBool
(
meshDict_
.
lookup
(
"enforceGeometryConstraints"
));
}
const
bool
enforceConstraints
=
meshDict_
.
lookupOrDefault
<
bool
>
(
"enforceGeometryConstraints"
,
false
);
meshOptimizer
optimizer
(
mesh_
);
if
(
enforceConstraints
)
{
optimizer
.
enforceConstraints
();
}
optimizer
.
optimizeSurface
(
*
octreePtr_
);
...
...
meshLibrary/utilities/anisotropicMeshing/coordinateModification/boxScaling.C
View file @
109565f5
...
...
@@ -260,83 +260,37 @@ void boxScaling::operator=(const dictionary& d)
:
d
);
// unspecified centre is (0 0 0)
if
(
dict
.
found
(
"centre"
))
{
dict
.
lookup
(
"centre"
)
>>
centre_
;
}
else
if
(
!
dict
.
readIfPresent
(
"centre"
,
centre_
))
{
FatalErrorInFunction
<<
"Entry centre is not specified!"
<<
exit
(
FatalError
);
centre_
=
vector
::
zero
;
}
// specify lengthX
if
(
dict
.
found
(
"lengthX"
))
{
lengthVec_
.
x
()
=
readScalar
(
dict
.
lookup
(
"lengthX"
));
}
else
if
(
!
dict
.
readIfPresent
(
"lengthX"
,
lengthVec_
.
x
()))
{
FatalErrorInFunction
<<
"Entry lengthX is not specified!"
<<
exit
(
FatalError
);
lengthVec_
.
x
()
=
0
.
0
;
}
// specify lengthY
if
(
dict
.
found
(
"lengthY"
))
{
lengthVec_
.
y
()
=
readScalar
(
dict
.
lookup
(
"lengthY"
));
}
else
if
(
!
dict
.
readIfPresent
(
"lengthY"
,
lengthVec_
.
y
()))
{
FatalErrorInFunction
<<
"Entry lengthY is not specified!"
<<
exit
(
FatalError
);
lengthVec_
.
y
()
=
0
.
0
;
}
// specify lengthZ
if
(
dict
.
found
(
"lengthZ"
))
{
lengthVec_
.
z
()
=
readScalar
(
dict
.
lookup
(
"lengthZ"
));
}
else
if
(
!
dict
.
readIfPresent
(
"lengthZ"
,
lengthVec_
.
z
()))
{
FatalErrorInFunction
<<
"Entry lengthZ is not specified!"
<<
exit
(
FatalError
);
lengthVec_
.
z
()
=
0
.
0
;
}
// specify scaleX
if
(
dict
.
found
(
"scaleX"
))
{
scaleVec_
.
x
()
=
readScalar
(
dict
.
lookup
(
"scaleX"
));
}
else
{
scaleVec_
.
x
()
=
1
.
0
;
}
// specify scaleY
if
(
dict
.
found
(
"scaleY"
))
{
scaleVec_
.
y
()
=
readScalar
(
dict
.
lookup
(
"scaleY"
));
}
else
{
scaleVec_
.
y
()
=
1
.
0
;
}
// specify scaleX
if
(
dict
.
found
(
"scaleZ"
))
{
scaleVec_
.
z
()
=
readScalar
(
dict
.
lookup
(
"scaleZ"
));
}
else
{
scaleVec_
.
z
()
=
1
.
0
;
}
scaleVec_
.
x
()
=
dict
.
lookupOrDefault
<
scalar
>
(
"scaleX"
,
1
.
0
);
scaleVec_
.
y
()
=
dict
.
lookupOrDefault
<
scalar
>
(
"scaleY"
,
1
.
0
);
scaleVec_
.
z
()
=
dict
.
lookupOrDefault
<
scalar
>
(
"scaleZ"
,
1
.
0
);
calculateBndBox
();
}
...
...
meshLibrary/utilities/anisotropicMeshing/coordinateModification/planeScaling.C
View file @
109565f5
...
...
@@ -222,12 +222,7 @@ void planeScaling::operator=(const dictionary& d)
:
d
);
// unspecified centre is (0 0 0)
if
(
dict
.
found
(
"origin"
))
{
dict
.
lookup
(
"origin"
)
>>
origin_
;
}
else
if
(
!
dict
.
readIfPresent
(
"origin"
,
origin_
))
{
FatalErrorInFunction
<<
"Entry origin is not specified!"
<<
exit
(
FatalError
);
...
...
@@ -235,25 +230,14 @@ void planeScaling::operator=(const dictionary& d)
origin_
=
vector
::
zero
;
}
// specify normal
if
(
dict
.
found
(
"normal"
))
{
dict
.
lookup
(
"normal"
)
>>
normal_
;
}
else
if
(
!
dict
.
readIfPresent
(
"normal"
,
normal_
))
{
FatalErrorInFunction
<<
"Entry lengthX is not specified!"
<<
exit
(
FatalError
);
<<
"Entry normal is not specified!"
<<
exit
(
FatalError
);
normal_
=
vector
(
1
,
1
,
1
);
}
// specify translation distance
if
(
dict
.
found
(
"scalingDistance"
))
{
scalingDistance_
=
readScalar
(
dict
.
lookup
(
"scalingDistance"
));
}
else
if
(
!
dict
.
readIfPresent
(
"scalingDistance"
,
scalingDistance_
))
{
FatalErrorInFunction
<<
"Entry scalingDistance is not specified!"
<<
exit
(
FatalError
);
...
...
@@ -261,12 +245,7 @@ void planeScaling::operator=(const dictionary& d)
scalingDistance_
=
0
.
0
;
}
// specify scaling factor
if
(
dict
.
found
(
"scalingFactor"
))
{
scalingFactor_
=
readScalar
(
dict
.
lookup
(
"scalingFactor"
));
}
else
if
(
!
dict
.
readIfPresent
(
"scalingFactor"
,
scalingFactor_
))
{
WarningInFunction
<<
"Entry scalingFactor is not specified!"
<<
endl
;
...
...
meshLibrary/utilities/boundaryLayers/refineBoundaryLayers/refineBoundaryLayers.C
View file @
109565f5
...
...
@@ -405,22 +405,28 @@ void refineBoundaryLayers::readSettings
const
dictionary
&
bndLayers
=
meshDict
.
subDict
(
"boundaryLayers"
);
// read global properties
if
(
bndLayers
.
found
(
"nLayers"
))
{
const
label
nLayers
=
readLabel
(
bndLayers
.
lookup
(
"nLayers"
));
refLayers
.
setGlobalNumberOfLayers
(
nLayers
);
label
nLayers
;
if
(
bndLayers
.
readIfPresent
(
"nLayers"
,
nLayers
))
{
refLayers
.
setGlobalNumberOfLayers
(
nLayers
);
}
}
if
(
bndLayers
.
found
(
"thicknessRatio"
))
{
const
scalar
ratio
=
readScalar
(
bndLayers
.
lookup
(
"thicknessRatio"
));
refLayers
.
setGlobalThicknessRatio
(
ratio
);
scalar
ratio
;
if
(
bndLayers
.
readIfPresent
(
"thicknessRatio"
,
ratio
))
{
refLayers
.
setGlobalThicknessRatio
(
ratio
);
}
}
if
(
bndLayers
.
found
(
"maxFirstLayerThickness"
))
{
const
scalar
maxFirstThickness
=
readScalar
(
bndLayers
.
lookup
(
"maxFirstLayerThickness"
));
refLayers
.
setGlobalMaxThicknessOfFirstLayer
(
maxFirstThickness
);
scalar
thick
;
if
(
bndLayers
.
readIfPresent
(
"maxFirstLayerThickness"
,
thick
))
{
refLayers
.
setGlobalMaxThicknessOfFirstLayer
(
thick
);
}
}
// consider specified patches for exclusion from boundary layer creation
...
...
@@ -453,41 +459,45 @@ void refineBoundaryLayers::readSettings
const
dictionary
&
patchDict
=
patchBndLayers
.
subDict
(
pName
);
if
(
patchDict
.
found
(
"nLayers"
))
label
nLayers
;
if
(
patchDict
.
readIfPresent
(
"nLayers"
,
nLayers
))
{
const
label
nLayers
=
readLabel
(
patchDict
.
lookup
(
"nLayers"
));
refLayers
.
setNumberOfLayersForPatch
(
pName
,
nLayers
);
}
if
(
patchDict
.
found
(
"thicknessRatio"
))
scalar
ratio
;
if
(
patchDict
.
readIfPresent
(
"thicknessRatio"
,
ratio
))
{
const
scalar
ratio
=
readScalar
(
patchDict
.
lookup
(
"thicknessRatio"
));
refLayers
.
setThicknessRatioForPatch
(
pName
,
ratio
);
}
if
(
patchDict
.
found
(
"maxFirstLayerThickness"
))
scalar
thick
;
if
(
patchDict
.
readIfPresent
(
"maxFirstLayerThickness"
,
thick
)
)
{
const
scalar
maxFirstThickness
=
readScalar
(
patchDict
.
lookup
(
"maxFirstLayerThickness"
)
);
refLayers
.
setMaxThicknessOfFirstLayerForPatch
(
pName
,
maxFirstThickness
thick
);
}
if
(
patchDict
.
found
(
"allowDiscontinuity"
))
{
const
bool
allowDiscontinuity
=
readBool
(
patchDict
.
lookup
(
"allowDiscontinuity"
));
if
(
allowDiscontinuity
)
{
refLayers
.
setInteruptForPatch
(
pName
);
}
if
(
patchDict
.
lookupOrDefault
<
bool
>
(
"allowDiscontinuity"
,
false
)
)
{
refLayers
.
setInteruptForPatch
(
pName
);
}
}
else
...
...
meshLibrary/utilities/boundaryLayers/triangulateNonPlanarBaseFaces/triangulateNonPlanarBaseFaces.C
View file @
109565f5
...
...
@@ -92,11 +92,9 @@ void triangulateNonPlanarBaseFaces::readSettings
const
dictionary
&
optLayerDict
=
layersDict
.
subDict
(
"optimisationParameters"
);
if
(
optLayerDict
.
found
(
"relFlatnessTol"
))
scalar
relTol
;
if
(
optLayerDict
.
readIfPresent
(
"relFlatnessTol"
,
relTol
))
{
const
scalar
relTol
=
readScalar
(
optLayerDict
.
lookup
(
"relFlatnessTol"
));
triangulator
.
setRelativeTolerance
(
relTol
);
}
}
...
...
meshLibrary/utilities/checkMeshDict/checkMeshDict.C
View file @
109565f5
...
...
@@ -39,75 +39,61 @@ namespace Foam
void
checkMeshDict
::
checkBasicSettings
()
const
{
// check if maxCellSize is valid
const
scalar
maxCellSize
=
readScalar
(
meshDict_
.
lookup
(
"maxCellSize"
))
;
bool
bval
;
scalar
sval
;
if
(
maxCellSize
<
0
)
// Check if maxCellSize is valid
sval
=
readScalar
(
meshDict_
.
lookup
(
"maxCellSize"
));
if
(
sval
<
0
)
{
FatalErrorInFunction
<<
"maxCellSize is negative! Cannot generate the mesh!!"
<<
exit
(
FatalError
);
}
//
c
heck if boundaryCellSize makes sense
if
(
meshDict_
.
found
(
"boundaryCellSize"
))
//
C
heck if boundaryCellSize makes sense
if
(
meshDict_
.
readIfPresent
(
"boundaryCellSize"
,
sval
))
{
const
scalar
bcs
=
readScalar
(
meshDict_
.
lookup
(
"boundaryCellSize"
));
if
(
bcs
<
0
)
if
(
sval
<
0
)
{
WarningInFunction
<<
"Boundary cell size is negative!!"
<<
endl
;
}
if
(
meshDict_
.
found
(
"boundaryCellSizeRefinementThickness"
))
if
(
meshDict_
.
readIfPresent
(
"boundaryCellSizeRefinementThickness"
,
sval
)
&&
(
sval
<
0
)
)
{
const
scalar
thickness
=
readScalar
(
meshDict_
.
lookup
(
"boundaryCellSizeRefinementThickness"
)
);
if
(
thickness
<
0
)
{
WarningInFunction
<<
"Boundary cell size refinement thickness is negative!!"
<<
endl
;
}
WarningInFunction
<<
"Boundary cell size refinement thickness is negative!!"
<<
endl
;
}
}
// check if minCellSize is valid
if
(
meshDict_
.
found
(
"minCellSize"
))
// Check if minCellSize is valid
if
(
meshDict_
.
readIfPresent
(
"minCellSize"
,
sval
)
&&
(
sval
<
0
)
)
{
const
scalar
mcs
=
readScalar
(
meshDict_
.
lookup
(
"minCellSize"
));
if
(
mcs
<
0
)
{
FatalErrorInFunction
<<
"Minimum cell size for automatic refinement is negative!!"
<<
exit
(
FatalError
);
}
FatalErrorInFunction
<<
"Minimum cell size for automatic refinement is negative!!"
<<
exit
(
FatalError
);
}
// check if keepCellsIntersectingBoundary can be read correctly
if
(
meshDict_
.
found
(
"keepCellsIntersectingBoundary"
))
{
const
bool
keep
=
readBool
(
meshDict_
.
lookup
(
"keepCellsIntersectingBoundary"
));
// Check if keepCellsIntersectingBoundary can be read correctly
meshDict_
.
readIfPresent
(
"keepCellsIntersectingBoundary"
,
bval
);
meshDict_
.
readIfPresent
(
"checkForGluedMesh"
,
bval
);
if
(
keep
&&
meshDict_
.
found
(
"checkForGluedMesh"
))
{
readBool
(
meshDict_
.
lookup
(
"checkForGluedMesh"
));
}
}
// check if enforceConstraints is available
if
(
meshDict_
.
found
(
"enforceGeometryConstraints"
))
{
readBool
(
meshDict_
.
lookup
(
"enforceGeometryConstraints"
));
}
// Check if enforceConstraints is available
meshDict_
.
readIfPresent
(
"enforceConstraints"
,
bval
);
}
...
...
@@ -163,23 +149,21 @@ void checkMeshDict::checkLocalRefinementLevel() const
{
const
dictionary
&
dict
=
refDict
.
subDict
(
entries
[
dictI
]);
if
(
dict
.
found
(
"cellSize"
))
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"cellSize"
));
label
ival
;
scalar
sval
;
if
(
cs
<
0
.
0
)
if
(
dict
.
readIfPresent
(
"cellSize"
,
sval
))
{
if
(
sval
<
0
.
0
)
{
WarningInFunction
<<
"Cell size for "
<<
entries
[
dictI
]
<<
" is negative"
<<
endl
;
}
}
else
if
(
dict
.
found
(
"additionalRefinementLevels"
))
else
if
(
dict
.
readIfPresent
(
"additionalRefinementLevels"
,
ival
))
{
const
label
nLevels
=
readLabel
(
dict
.
lookup
(
"additionalRefinementLevels"
));
if
(
nLevels
<
0
)
if
(
ival
<
0
)
{
WarningInFunction
<<
"Refinement level for "
<<
entries
[
dictI
]
...
...
@@ -194,12 +178,9 @@ void checkMeshDict::checkLocalRefinementLevel() const
<<
"for "
<<
entries
[
dictI
]
<<
exit
(
FatalError
);
}
if
(
dict
.
found
(
"refinementThickness"
))
if
(
dict
.
readIfPresent
(
"refinementThickness"
,
sval
))
{
const
scalar
s
=
readScalar
(
dict
.
lookup
(
"refinementThickness"
));
if
(
s
<
0
)
if
(
sval
<
0
)
{
WarningInFunction
<<
"Refinement thickness for "
<<
entries
[
dictI
]
...
...
@@ -387,11 +368,12 @@ void checkMeshDict::checkSurfaceRefinements() const
<<
surfaceSources
[
surfI
]
<<
exit
(
FatalError
);
}
if
(
dict
.
found
(
"cellSize"
))
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"cellSize"
));
label
ival
;
scalar
sval
;
if
(
cs
<
VSMALL
)
if
(
dict
.
readIfPresent
(
"cellSize"
,
sval
))
{
if
(
sval
<
VSMALL
)
{
FatalErrorInFunction
<<
"Cell size for entry "
<<
surfaceSources
[
surfI
]
...
...
@@ -399,12 +381,9 @@ void checkMeshDict::checkSurfaceRefinements() const
<<
exit
(
FatalError
);
}
}
else
if
(
dict
.
found
(
"additionalRefinementLevels"
))
else
if
(
dict
.
readIfPresent
(
"additionalRefinementLevels"
,
ival
))
{
const
label
nLev
=
readLabel
(
dict
.
lookup
(
"additionalRefinementLevels"
));
if
(
nLev
<
0
)
if
(
ival
<
0
)
{
FatalErrorInFunction
<<
"Number refinement levels for entry "
...
...
@@ -420,12 +399,9 @@ void checkMeshDict::checkSurfaceRefinements() const
<<
exit
(
FatalError
);
}
if
(
dict
.
found
(
"refinementThickness"
))
if
(
dict
.
readIfPresent
(
"refinementThickness"
,
sval
))
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"refinementThickness"
));
if
(
cs
<
VSMALL
)
if
(
sval
<
VSMALL
)
{