Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
3f2d5983
Commit
3f2d5983
authored
9 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: snappyHexMesh: shoot gap-detection rays perpendicular to the surface
parent
afa6bd50
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementGapRefine.C
+62
-11
62 additions, 11 deletions
...Mesh/autoHexMesh/meshRefinement/meshRefinementGapRefine.C
with
62 additions
and
11 deletions
src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementGapRefine.C
+
62
−
11
View file @
3f2d5983
...
@@ -881,7 +881,7 @@ Foam::label Foam::meshRefinement::generateRays
...
@@ -881,7 +881,7 @@ Foam::label Foam::meshRefinement::generateRays
||
(
mode
==
volumeType
::
INSIDE
&&
s
<
-
SMALL
)
||
(
mode
==
volumeType
::
INSIDE
&&
s
<
-
SMALL
)
)
)
{
{
//// Use vector through cell centre
//// Use
single
vector through cell centre
//vector n(v/(magV+ROOTVSMALL));
//vector n(v/(magV+ROOTVSMALL));
//
//
//start.append(cc);
//start.append(cc);
...
@@ -893,32 +893,83 @@ Foam::label Foam::meshRefinement::generateRays
...
@@ -893,32 +893,83 @@ Foam::label Foam::meshRefinement::generateRays
//gapSize2.append(nearGap);
//gapSize2.append(nearGap);
// Shoot some rays through the cell centre
//// Shoot some rays through the cell centre
// X-direction:
//// X-direction:
//start.append(cc);
//end.append(cc+nearGap*vector(1, 0, 0));
//gapSize.append(nearGap);
//
//start2.append(cc);
//end2.append(cc-nearGap*vector(1, 0, 0));
//gapSize2.append(nearGap);
//
//// Y-direction:
//start.append(cc);
//end.append(cc+nearGap*vector(0, 1, 0));
//gapSize.append(nearGap);
//
//start2.append(cc);
//end2.append(cc-nearGap*vector(0, 1, 0));
//gapSize2.append(nearGap);
//
//// Z-direction:
//start.append(cc);
//end.append(cc+nearGap*vector(0, 0, 1));
//gapSize.append(nearGap);
//
//start2.append(cc);
//end2.append(cc-nearGap*vector(0, 0, 1));
//gapSize2.append(nearGap);
// 3 axes aligned with normal
// Use vector through cell centre
vector
n
(
v
/
(
magV
+
ROOTVSMALL
));
// Get second vector. Make sure it is sufficiently perpendicular
vector
e2
(
1
,
0
,
0
);
scalar
s
=
(
e2
&
n
);
if
(
mag
(
s
)
<
0
.
9
)
{
e2
-=
s
*
n
;
}
else
{
e2
=
vector
(
0
,
1
,
0
);
e2
-=
(
e2
&
n
)
*
n
;
}
e2
/=
mag
(
e2
);
// Third vector
vector
e3
=
n
^
e2
;
// Rays in first direction
start
.
append
(
cc
);
start
.
append
(
cc
);
end
.
append
(
cc
+
nearGap
*
vector
(
1
,
0
,
0
)
);
end
.
append
(
cc
+
nearGap
*
n
);
gapSize
.
append
(
nearGap
);
gapSize
.
append
(
nearGap
);
start2
.
append
(
cc
);
start2
.
append
(
cc
);
end2
.
append
(
cc
-
nearGap
*
vector
(
1
,
0
,
0
)
);
end2
.
append
(
cc
-
nearGap
*
n
);
gapSize2
.
append
(
nearGap
);
gapSize2
.
append
(
nearGap
);
//
Y-
direction
:
//
Rays in second
direction
start
.
append
(
cc
);
start
.
append
(
cc
);
end
.
append
(
cc
+
nearGap
*
vector
(
0
,
1
,
0
)
);
end
.
append
(
cc
+
nearGap
*
e2
);
gapSize
.
append
(
nearGap
);
gapSize
.
append
(
nearGap
);
start2
.
append
(
cc
);
start2
.
append
(
cc
);
end2
.
append
(
cc
-
nearGap
*
vector
(
0
,
1
,
0
)
);
end2
.
append
(
cc
-
nearGap
*
e2
);
gapSize2
.
append
(
nearGap
);
gapSize2
.
append
(
nearGap
);
//
Z-
direction
:
//
Rays in third
direction
start
.
append
(
cc
);
start
.
append
(
cc
);
end
.
append
(
cc
+
nearGap
*
vector
(
0
,
0
,
1
)
);
end
.
append
(
cc
+
nearGap
*
e3
);
gapSize
.
append
(
nearGap
);
gapSize
.
append
(
nearGap
);
start2
.
append
(
cc
);
start2
.
append
(
cc
);
end2
.
append
(
cc
-
nearGap
*
vector
(
0
,
0
,
1
)
);
end2
.
append
(
cc
-
nearGap
*
e3
);
gapSize2
.
append
(
nearGap
);
gapSize2
.
append
(
nearGap
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment