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
Development
openfoam
Commits
8407dd24
Commit
8407dd24
authored
Mar 01, 2012
by
mattijs
Browse files
ENH: autoLayerDriver: use weighted smoothing
parent
633d9447
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
View file @
8407dd24
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -2067,8 +2067,10 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
// The important thing, however, is that when only a few faces
// are disabled, their coordinates are printed, and this should be
// the case
label
nReportLocal
=
min
label
nReportLocal
=
nChanged
;
if
(
nChangedTotal
>
nReportMax
)
{
nReportLocal
=
min
(
max
(
nChangedTotal
/
Pstream
::
nProcs
(),
1
),
min
...
...
@@ -2077,11 +2079,15 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
max
(
nReportMax
/
Pstream
::
nProcs
(),
1
)
)
);
}
Pout
<<
"Checked mesh with layers. Disabled extrusion at "
<<
endl
;
for
(
label
i
=
0
;
i
<
nReportLocal
;
i
++
)
if
(
nReportLocal
)
{
Pout
<<
" "
<<
disabledFaceCentres
[
i
]
<<
endl
;
Pout
<<
"Checked mesh with layers. Disabled extrusion at "
<<
endl
;
for
(
label
i
=
0
;
i
<
nReportLocal
;
i
++
)
{
Pout
<<
" "
<<
disabledFaceCentres
[
i
]
<<
endl
;
}
}
label
nReportTotal
=
returnReduce
(
nReportLocal
,
sumOp
<
label
>
());
...
...
@@ -2546,7 +2552,7 @@ void Foam::autoLayerDriver::addLayers
false
),
meshMover
().
pMesh
(),
dimensionedScalar
(
"pointMedialDist"
,
dim
less
,
0
.
0
)
dimensionedScalar
(
"pointMedialDist"
,
dim
Length
,
0
.
0
)
);
pointVectorField
dispVec
...
...
@@ -2561,7 +2567,7 @@ void Foam::autoLayerDriver::addLayers
false
),
meshMover
().
pMesh
(),
dimensionedVector
(
"dispVec"
,
dim
less
,
vector
::
zero
)
dimensionedVector
(
"dispVec"
,
dim
Length
,
vector
::
zero
)
);
pointScalarField
medialRatio
...
...
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
View file @
8407dd24
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -49,6 +49,8 @@ void Foam::autoLayerDriver::sumWeights
scalarField
&
invSumWeight
)
const
{
const
pointField
&
pts
=
meshRefiner_
.
mesh
().
points
();
invSumWeight
=
0
;
forAll
(
edges
,
edgeI
)
...
...
@@ -57,7 +59,18 @@ void Foam::autoLayerDriver::sumWeights
{
const
edge
&
e
=
edges
[
edgeI
];
//scalar eWeight = edgeWeights[edgeI];
scalar
eWeight
=
1
.
0
;
//scalar eWeight = 1.0;
scalar
eMag
=
max
(
VSMALL
,
mag
(
pts
[
meshPoints
[
e
[
1
]]]
-
pts
[
meshPoints
[
e
[
0
]]]
)
);
scalar
eWeight
=
1
.
0
/
eMag
;
invSumWeight
[
e
[
0
]]
+=
eWeight
;
invSumWeight
[
e
[
1
]]
+=
eWeight
;
...
...
@@ -799,6 +812,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
// Both end points of edge have very different nearest wall
// point. Mark both points as medial axis points.
const
edge
&
e
=
edges
[
edgeI
];
const
point
eMid
=
e
.
centre
(
points
);
forAll
(
e
,
ep
)
{
...
...
@@ -811,8 +825,8 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
(
pointData
(
points
[
pointI
],
0
.
0
,
eMid
,
//
points[pointI],
magSqr
(
points
[
pointI
]
-
eMid
),
//
0.0,
pointI
,
// passive data
vector
::
zero
// passive data
)
...
...
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverTemplates.C
View file @
8407dd24
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -41,6 +41,8 @@ void Foam::autoLayerDriver::averageNeighbours
Field
<
Type
>&
average
)
{
const
pointField
&
pts
=
mesh
.
points
();
average
=
pTraits
<
Type
>::
zero
;
forAll
(
edges
,
edgeI
)
...
...
@@ -49,7 +51,18 @@ void Foam::autoLayerDriver::averageNeighbours
{
const
edge
&
e
=
edges
[
edgeI
];
//scalar eWeight = edgeWeights[edgeI];
scalar
eWeight
=
1
.
0
;
//scalar eWeight = 1.0;
scalar
eMag
=
max
(
VSMALL
,
mag
(
pts
[
meshPoints
[
e
[
1
]]]
-
pts
[
meshPoints
[
e
[
0
]]]
)
);
scalar
eWeight
=
1
.
0
/
eMag
;
label
v0
=
e
[
0
];
label
v1
=
e
[
1
];
...
...
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