Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Community
integration-cfmesh
Commits
f2cb3e93
Commit
f2cb3e93
authored
Sep 24, 2014
by
Franjo
Browse files
Added checks for refinement thickness into checkMeshDict
parent
2ef674c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
meshLibrary/utilities/checkMeshDict/checkMeshDict.C
View file @
f2cb3e93
...
...
@@ -38,6 +38,79 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void
checkMeshDict
::
checkBasicSettings
()
const
{
//- check if maxCellSize is valid
const
scalar
maxCellSize
=
readScalar
(
meshDict_
.
lookup
(
"maxCellSize"
));
if
(
maxCellSize
<
0
)
FatalErrorIn
(
"void checkMeshDict::checkBasicSettings() const"
)
<<
"maxCellSize is negative! Cannot generate the mesh!!"
<<
exit
(
FatalError
);
//- check if boundaryCellSize makes sense
if
(
meshDict_
.
found
(
"boundaryCellSize"
)
)
{
const
scalar
bcs
=
readScalar
(
meshDict_
.
lookup
(
"boundaryCellSize"
));
if
(
bcs
<
0
)
{
WarningIn
(
"void checkMeshDict::checkBasicSettings() const"
)
<<
"Boundary cell size is negative!!"
<<
endl
;
}
if
(
meshDict_
.
found
(
"boundaryCellSizeRefinementThickness"
)
)
{
const
scalar
thickness
=
readScalar
(
meshDict_
.
lookup
(
"boundaryCellSizeRefinementThickness"
)
);
if
(
thickness
<
0
)
{
WarningIn
(
"void checkMeshDict::checkBasicSettings() const"
)
<<
"Boundary cell size refinement thickness is negative!!"
<<
endl
;
}
}
}
//- check if minCellSize is valid
if
(
meshDict_
.
found
(
"minCellSize"
)
)
{
const
scalar
mcs
=
readScalar
(
meshDict_
.
lookup
(
"minCellSize"
));
if
(
mcs
<
0
)
{
FatalErrorIn
(
"void checkMeshDict::checkBasicSettings() const"
)
<<
"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"
));
if
(
keep
&&
meshDict_
.
found
(
"checkForGluedMesh"
)
)
{
readBool
(
meshDict_
.
lookup
(
"checkForGluedMesh"
));
}
}
}
void
checkMeshDict
::
checkPatchCellSize
()
const
{
if
(
meshDict_
.
found
(
"patchCellSize"
)
)
...
...
@@ -92,14 +165,14 @@ void checkMeshDict::checkLocalRefinementLevel() const
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"cellSize"
));
if
(
cs
>
0
.
0
)
continue
;
WarningIn
(
if
(
cs
<
0
.
0
)
{
WarningIn
(
"void checkMeshDict::checkLocalRefinementLevel() const"
)
<<
"Cell size for "
<<
entries
[
dictI
]
<<
" is negative"
<<
endl
;
)
<<
"Cell size for "
<<
entries
[
dictI
]
<<
" is negative"
<<
endl
;
}
}
else
if
(
dict
.
found
(
"additionalRefinementLevels"
)
)
{
...
...
@@ -107,13 +180,13 @@ void checkMeshDict::checkLocalRefinementLevel() const
readLabel
(
dict
.
lookup
(
"additionalRefinementLevels"
));
if
(
nLevels
>
0
)
continue
;
WarningIn
(
{
WarningIn
(
"void checkMeshDict::checkLocalRefinementLevel() const"
)
<<
"Refinement level for "
<<
entries
[
dictI
]
<<
" is negative"
<<
endl
;
)
<<
"Refinement level for "
<<
entries
[
dictI
]
<<
" is negative"
<<
endl
;
}
}
else
{
...
...
@@ -124,6 +197,21 @@ void checkMeshDict::checkLocalRefinementLevel() const
<<
" additionalRefinementLevels or cellSize"
<<
"for "
<<
entries
[
dictI
]
<<
exit
(
FatalError
);
}
if
(
dict
.
found
(
"refinementThickness"
)
)
{
const
scalar
s
=
readScalar
(
dict
.
lookup
(
"refinementThickness"
));
if
(
s
<
0
)
{
WarningIn
(
"void checkMeshDict::checkLocalRefinementLevel() const"
)
<<
"Refinement thickness for "
<<
entries
[
dictI
]
<<
" is negative"
<<
endl
;
}
}
}
}
else
...
...
@@ -223,6 +311,27 @@ void checkMeshDict::checkObjectRefinements() const
);
}
}
forAll
(
refObjects
,
oI
)
{
if
(
refObjects
[
oI
].
cellSize
()
<
0
.
0
)
{
WarningIn
(
"void checkMeshDict::checkObjectRefinements() const"
)
<<
"Cell size specified for object "
<<
refObjects
[
oI
].
name
()
<<
" is negative!!"
<<
endl
;
}
if
(
refObjects
[
oI
].
refinementThickness
()
<
0
.
0
)
{
WarningIn
(
"void checkMeshDict::checkObjectRefinements() const"
)
<<
"Refinement thickness specified for object "
<<
refObjects
[
oI
].
name
()
<<
" is negative!!"
<<
endl
;
}
}
}
}
...
...
@@ -238,7 +347,8 @@ void checkMeshDict::checkSurfaceRefinements() const
{
if
(
surfaces
.
isDict
(
surfaceSources
[
surfI
])
)
{
const
dictionary
&
dict
=
surfaces
.
subDict
(
surfaceSources
[
surfI
]);
const
dictionary
&
dict
=
surfaces
.
subDict
(
surfaceSources
[
surfI
]);
if
(
dict
.
found
(
"surfaceFile"
)
)
{
...
...
@@ -247,50 +357,73 @@ void checkMeshDict::checkSurfaceRefinements() const
if
(
!
isFile
(
fName
)
)
FatalErrorIn
(
"void checkMeshDict::checkSurfaceRefinements() const"
"void checkMeshDict::checkSurfaceRefinements() const"
)
<<
"Surface file "
<<
fName
<<
" does not exist or is not readable!!"
<<
exit
(
FatalError
);
}
else
{
FatalErrorIn
(
"void checkMeshDict::checkSurfaceRefinements() const"
)
<<
"Missing surfaceFile for entry "
<<
surfaceSources
[
surfI
]
<<
exit
(
FatalError
);
}
if
(
dict
.
found
(
"cellSize"
)
)
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"cellSize"
));
if
(
cs
<
VSMALL
)
FatalErrorIn
(
"void checkMeshDict::"
"checkSurfaceRefinements() const"
)
<<
"Cell size for surface "
<<
fName
<<
" is extremely small or negative!!"
<<
exit
(
FatalError
);
}
else
if
(
dict
.
found
(
"additionalRefinementLevels"
)
)
{
const
label
nLev
=
readLabel
(
dict
.
lookup
(
"additionalRefinementLevels"
));
if
(
dict
.
found
(
"cellSize"
)
)
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"cellSize"
));
if
(
nLev
<
0
)
{
FatalErrorIn
(
"void checkMeshDict::"
"checkSurfaceRefinements() const"
)
<<
"Number refinement levels for surface "
<<
fName
<<
" is negative!!"
<<
exit
(
FatalError
);
}
}
else
if
(
cs
<
VSMALL
)
FatalErrorIn
(
"void checkMeshDict::"
"checkSurfaceRefinements() const"
)
<<
"Cell size for entry "
<<
surfaceSources
[
surfI
]
<<
" is extremely small or negative!!"
<<
exit
(
FatalError
);
}
else
if
(
dict
.
found
(
"additionalRefinementLevels"
)
)
{
const
label
nLev
=
readLabel
(
dict
.
lookup
(
"additionalRefinementLevels"
));
if
(
nLev
<
0
)
{
FatalErrorIn
(
"void checkMeshDict::checkSurfaceRefinements() const"
)
<<
"Missing cellSize or additionalRefinementLevels"
<<
" for surface "
<<
fName
"void checkMeshDict::"
"checkSurfaceRefinements() const"
)
<<
"Number refinement levels for entry "
<<
surfaceSources
[
surfI
]
<<
" is negative!!"
<<
exit
(
FatalError
);
}
}
else
{
FatalErrorIn
(
"void checkMeshDict::checkSurfaceRefinements() const"
)
<<
"Missing cellSize or additionalRefinementLevels"
<<
" for entry "
<<
surfaceSources
[
surfI
]
<<
exit
(
FatalError
);
}
if
(
dict
.
found
(
"refinementThickness"
)
)
{
const
scalar
cs
=
readScalar
(
dict
.
lookup
(
"refinementThickness"
));
if
(
cs
<
VSMALL
)
WarningIn
(
"void checkMeshDict::"
"checkSurfaceRefinements() const"
)
<<
"Refinement thickness for entry "
<<
surfaceSources
[
surfI
]
<<
" is extremely small or negative!!"
<<
endl
;
}
}
else
{
...
...
@@ -431,6 +564,8 @@ void checkMeshDict::checkRenameBoundary() const
void
checkMeshDict
::
checkEntries
()
const
{
checkBasicSettings
();
checkPatchCellSize
();
checkSubsetCellSize
();
...
...
meshLibrary/utilities/checkMeshDict/checkMeshDict.H
View file @
f2cb3e93
...
...
@@ -54,6 +54,9 @@ class checkMeshDict
IOdictionary
&
meshDict_
;
// Private member functions
//- check settings for cell size in meshDict
void
checkBasicSettings
()
const
;
//- check patchCellSize entry
void
checkPatchCellSize
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment