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
d56f72c9
Commit
d56f72c9
authored
Apr 10, 2015
by
Franjo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a utility for generating boundary layers
parent
b0bc62a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
169 additions
and
0 deletions
+169
-0
utilities/generateBoundaryLayers/Make/files
utilities/generateBoundaryLayers/Make/files
+3
-0
utilities/generateBoundaryLayers/Make/options
utilities/generateBoundaryLayers/Make/options
+10
-0
utilities/generateBoundaryLayers/generateBoundaryLayers.C
utilities/generateBoundaryLayers/generateBoundaryLayers.C
+156
-0
No files found.
utilities/generateBoundaryLayers/Make/files
0 → 100644
View file @
d56f72c9
generateBoundaryLayers.C
EXE = $(FOAM_USER_APPBIN)/generateBoundaryLayers
utilities/generateBoundaryLayers/Make/options
0 → 100644
View file @
d56f72c9
EXE_INC = \
-I../../meshLibrary/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools \
-ltriSurface \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary
utilities/generateBoundaryLayers/generateBoundaryLayers.C
0 → 100644
View file @
d56f72c9
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | cfMesh: A library for mesh generation
\\ / O peration |
\\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
\\/ M anipulation | Copyright (C) Creative Fields, Ltd.
-------------------------------------------------------------------------------
License
This file is part of cfMesh.
cfMesh is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
cfMesh is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 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/>.
Description
Performs point relocations in the mesh (smoothing) in order to
improve quality measures. It does not make the mesh invalied.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMeshGenModifier.H"
#include "meshOptimizer.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
validArgs
.
clear
();
argList
::
validOptions
.
insert
(
"nLoops"
,
"int"
);
argList
::
validOptions
.
insert
(
"nIterations"
,
"int"
);
argList
::
validOptions
.
insert
(
"nSurfaceIterations"
,
"int"
);
argList
::
validOptions
.
insert
(
"qualityThreshold"
,
"scalar"
);
argList
::
validOptions
.
insert
(
"constrainedCellsSet"
,
"word"
);
# include "setRootCase.H"
# include "createTime.H"
//- read the settings
label
nIterations
(
50
);
label
nLoops
(
10
);
label
nSurfaceIterations
(
2
);
scalar
qualityThreshold
(
0
.
1
);
if
(
args
.
options
().
found
(
"nLoops"
)
)
{
nLoops
=
readLabel
(
IStringStream
(
args
.
options
()[
"nLoops"
])());
}
else
{
Info
<<
"Default number of loops is 10"
<<
endl
;
}
if
(
args
.
options
().
found
(
"nIterations"
)
)
{
nIterations
=
readLabel
(
IStringStream
(
args
.
options
()[
"nIterations"
])());
}
else
{
Info
<<
"Default number of iterations is 50"
<<
endl
;
}
if
(
args
.
options
().
found
(
"nSurfaceIterations"
)
)
{
nSurfaceIterations
=
readLabel
(
IStringStream
(
args
.
options
()[
"nSurfaceIterations"
])());
}
else
{
Info
<<
"Default number of surface iterations is 2"
<<
endl
;
}
if
(
args
.
options
().
found
(
"qualityThreshold"
)
)
{
qualityThreshold
=
readScalar
(
IStringStream
(
args
.
options
()[
"qualityThreshold"
])());
}
else
{
Info
<<
"Using default quality threshold 0.1"
<<
endl
;
}
word
constrainedCellSet
;
if
(
args
.
options
().
found
(
"constrainedCellsSet"
)
)
{
constrainedCellSet
=
args
.
options
()[
"constrainedCellsSet"
];
}
else
{
Info
<<
"No constraints applied on the smoothing procedure"
<<
endl
;
}
//- load the mesh from disk
polyMeshGen
pmg
(
runTime
);
pmg
.
read
();
//- construct the smoother
meshOptimizer
mOpt
(
pmg
);
if
(
!
constrainedCellSet
.
empty
()
)
{
//- lock cells in constrainedCellSet
mOpt
.
lockCellsInSubset
(
constrainedCellSet
);
//- find boundary faces which shall be locked
labelLongList
lockedBndFaces
,
selectedCells
;
const
label
sId
=
pmg
.
cellSubsetIndex
(
constrainedCellSet
);
pmg
.
cellsInSubset
(
sId
,
selectedCells
);
boolList
activeCell
(
pmg
.
cells
().
size
(),
false
);
forAll
(
selectedCells
,
i
)
activeCell
[
selectedCells
[
i
]]
=
true
;
}
//- clear geometry information before volume smoothing
pmg
.
clearAddressingData
();
//- perform optimisation using the laplace smoother and
mOpt
.
optimizeMeshFV
(
nLoops
,
nLoops
,
nIterations
,
nSurfaceIterations
);
//- perform optimisation of worst quality faces
mOpt
.
optimizeMeshFVBestQuality
(
nLoops
,
qualityThreshold
);
//- check the mesh again and untangl bad regions if any of them exist
mOpt
.
untangleMeshFV
(
nLoops
,
nIterations
,
nSurfaceIterations
);
Info
<<
"Writing mesh"
<<
endl
;
pmg
.
write
();
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
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