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
10eb1e08
Commit
10eb1e08
authored
Mar 19, 2015
by
Franjo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a check fo collocated points
parent
c01116f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
2 deletions
+106
-2
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.C
...ities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.C
+92
-2
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.H
...ities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.H
+14
-0
No files found.
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.C
View file @
10eb1e08
...
...
@@ -31,7 +31,6 @@ Description
#include "meshOctree.H"
#include "meshOctreeCreator.H"
#include "helperFunctions.H"
//#include "triSurfaceCopyParts.H"
#ifdef USE_OMP
#include <omp.h>
...
...
@@ -636,6 +635,95 @@ void calculateBoundingBox(const triSurf& surf, boundBox& bb)
bb
.
max
()
=
Foam
::
max
(
surf
.
points
());
}
label
checkCollocatedPoints
(
const
triSurf
&
surf
,
labelLongList
&
collocatedPoints
,
const
scalar
distTol
)
{
collocatedPoints
.
clear
();
meshOctree
octree
(
surf
);
meshOctreeCreator
(
octree
).
createOctreeWithRefinedBoundary
(
20
,
30
);
const
pointField
&
pts
=
surf
.
points
();
boolList
collocated
(
pts
.
size
(),
false
);
# ifdef USE_OMP
# pragma omp parallel for schedule(dynamic, 50)
# endif
forAll
(
collocated
,
pI
)
{
const
point
&
p
=
pts
[
pI
];
boundBox
bb
(
p
,
p
);
bb
.
min
()
-=
point
(
distTol
,
distTol
,
distTol
);
bb
.
max
()
+=
point
(
distTol
,
distTol
,
distTol
);
DynList
<
label
>
leavesInBox
;
octree
.
findLeavesContainedInBox
(
bb
,
leavesInBox
);
forAll
(
leavesInBox
,
i
)
{
const
label
leafI
=
leavesInBox
[
i
];
DynList
<
label
>
trianglesInBox
;
octree
.
containedTriangles
(
leafI
,
trianglesInBox
);
forAll
(
trianglesInBox
,
j
)
{
const
label
triJ
=
trianglesInBox
[
j
];
const
labelledTri
&
nt
=
surf
[
triJ
];
forAll
(
nt
,
tpI
)
{
if
(
nt
[
tpI
]
==
pI
)
continue
;
if
(
magSqr
(
pts
[
nt
[
tpI
]]
-
p
)
<
sqr
(
distTol
)
)
{
collocated
[
pI
]
=
true
;
collocated
[
nt
[
tpI
]]
=
true
;
}
}
}
}
}
forAll
(
collocated
,
pI
)
if
(
collocated
[
pI
]
)
collocatedPoints
.
append
(
pI
);
return
collocatedPoints
.
size
();
}
label
checkCollocatedPoints
(
triSurf
&
surf
,
const
word
subsetName
,
const
scalar
distTol
)
{
labelLongList
collocatedPoints
;
if
(
checkCollocatedPoints
(
surf
,
collocatedPoints
,
distTol
)
)
{
label
setId
=
surf
.
pointSubsetIndex
(
subsetName
);
if
(
setId
>=
0
)
surf
.
removePointSubset
(
setId
);
setId
=
surf
.
addPointSubset
(
subsetName
);
forAll
(
collocatedPoints
,
i
)
surf
.
addPointToSubset
(
setId
,
collocatedPoints
[
i
]);
}
return
collocatedPoints
.
size
();
}
label
checkSelfIntersections
(
const
triSurf
&
surf
,
...
...
@@ -808,6 +896,8 @@ label checkOverlaps
meshOctree
octree
(
surf
);
meshOctreeCreator
(
octree
).
createOctreeWithRefinedBoundary
(
20
,
30
);
const
scalar
cosVal
=
Foam
::
cos
(
angleTol
*
M_PI
/
180
.
0
);
const
pointField
&
pts
=
surf
.
points
();
boolList
intersected
(
surf
.
size
(),
false
);
...
...
@@ -871,7 +961,7 @@ label checkOverlaps
neiTri
,
commonPolygon
,
tol
,
Foam
::
cos
(
angleTol
*
M_PI
/
180
.
0
)
cosVal
);
if
(
intersect
)
...
...
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.H
View file @
10eb1e08
...
...
@@ -95,6 +95,20 @@ label checkDisconnectedParts(triSurf&, const word subsetPrefix="region_");
//- calculate bounding box of the surface mesh
void
calculateBoundingBox
(
const
triSurf
&
,
boundBox
&
);
//- check existence of collocated points
label
checkCollocatedPoints
(
const
triSurf
&
,
labelLongList
&
,
const
scalar
distTol
=
1e-6
);
label
checkCollocatedPoints
(
triSurf
&
,
const
word
subsetName
=
"collocatedPoints"
,
const
scalar
distTol
=
1e-6
);
//- check if there exist any self-intersections
label
checkSelfIntersections
(
...
...
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