Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
4d7cd473
Commit
4d7cd473
authored
Oct 14, 2008
by
mattijs
Browse files
use average when merging points to prevent truncation error
parent
43705d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/meshTools/mergePoints.C
View file @
4d7cd473
...
@@ -40,6 +40,16 @@ bool Foam::mergePoints
...
@@ -40,6 +40,16 @@ bool Foam::mergePoints
const
point
&
origin
const
point
&
origin
)
)
{
{
point
compareOrigin
=
origin
;
if
(
origin
==
point
(
VGREAT
,
VGREAT
,
VGREAT
))
{
if
(
points
.
size
()
>
0
)
{
compareOrigin
=
sum
(
points
)
/
points
.
size
();
}
}
// Create a old to new point mapping array
// Create a old to new point mapping array
pointMap
.
setSize
(
points
.
size
());
pointMap
.
setSize
(
points
.
size
());
pointMap
=
-
1
;
pointMap
=
-
1
;
...
@@ -56,7 +66,7 @@ bool Foam::mergePoints
...
@@ -56,7 +66,7 @@ bool Foam::mergePoints
const
scalar
mergeTolSqr
=
sqr
(
mergeTol
);
const
scalar
mergeTolSqr
=
sqr
(
mergeTol
);
// Sort points by magSqr
// Sort points by magSqr
SortableList
<
scalar
>
sortedMagSqr
(
magSqr
(
points
-
o
rigin
));
SortableList
<
scalar
>
sortedMagSqr
(
magSqr
(
points
-
compareO
rigin
));
bool
hasMerged
=
false
;
bool
hasMerged
=
false
;
...
...
Write
Preview
Supports
Markdown
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