Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9ce73bf3
Commit
9ce73bf3
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
attractors on surfaces (not fully satisfactory, but useful nonetheless)
parent
9f7c88ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mesh/Field.cpp
+51
-7
51 additions, 7 deletions
Mesh/Field.cpp
doc/TODO.txt
+6
-7
6 additions, 7 deletions
doc/TODO.txt
with
57 additions
and
14 deletions
Mesh/Field.cpp
+
51
−
7
View file @
9ce73bf3
...
...
@@ -1117,8 +1117,7 @@ class AttractorField : public Field
ANNpointArray
zeronodes
;
ANNidxArray
index
;
ANNdistArray
dist
;
std
::
list
<
int
>
nodes_id
;
std
::
list
<
int
>
edges_id
;
std
::
list
<
int
>
nodes_id
,
edges_id
,
faces_id
;
int
n_nodes_by_edge
;
public:
AttractorField
()
:
kdtree
(
0
),
zeronodes
(
0
)
...
...
@@ -1135,6 +1134,11 @@ class AttractorField : public Field
options
[
"NNodesByEdge"
]
=
new
FieldOptionInt
(
n_nodes_by_edge
,
"Number of nodes "
"used to discetized each curve"
,
&
update_needed
);
options
[
"FacesList"
]
=
new
FieldOptionList
(
faces_id
,
"Indices of "
"surfaces in the geometric model "
"(Warning: might give strange "
"results for complex surfaces)"
,
&
update_needed
);
}
~
AttractorField
()
{
...
...
@@ -1163,7 +1167,8 @@ class AttractorField : public Field
annDeallocPts
(
zeronodes
);
delete
kdtree
;
}
int
totpoints
=
nodes_id
.
size
()
+
n_nodes_by_edge
*
edges_id
.
size
();
int
totpoints
=
nodes_id
.
size
()
+
n_nodes_by_edge
*
edges_id
.
size
()
+
n_nodes_by_edge
*
n_nodes_by_edge
*
faces_id
.
size
();
if
(
totpoints
)
zeronodes
=
annAllocPts
(
totpoints
,
4
);
int
k
=
0
;
...
...
@@ -1197,13 +1202,13 @@ class AttractorField : public Field
}
}
else
{
GEdge
*
g
e
=
GModel
::
current
()
->
getEdgeByTag
(
*
it
);
if
(
g
e
)
{
GEdge
*
e
=
GModel
::
current
()
->
getEdgeByTag
(
*
it
);
if
(
e
)
{
for
(
int
i
=
0
;
i
<
n_nodes_by_edge
;
i
++
)
{
double
u
=
(
double
)
i
/
(
n_nodes_by_edge
-
1
);
Range
<
double
>
b
=
g
e
->
parBounds
(
0
);
Range
<
double
>
b
=
e
->
parBounds
(
0
);
double
t
=
b
.
low
()
+
u
*
(
b
.
high
()
-
b
.
low
());
GPoint
gp
=
g
e
->
point
(
t
);
GPoint
gp
=
e
->
point
(
t
);
zeronodes
[
k
][
0
]
=
gp
.
x
();
zeronodes
[
k
][
1
]
=
gp
.
y
();
zeronodes
[
k
++
][
2
]
=
gp
.
z
();
...
...
@@ -1211,6 +1216,45 @@ class AttractorField : public Field
}
}
}
// This can lead to weird results as we generate attractors over
// the whole parametric plane (We should really use a
// mesh... but none is available before 1D & 2D meshing. Or we
// should provide a better containsParam() implementation.)
for
(
std
::
list
<
int
>::
iterator
it
=
faces_id
.
begin
();
it
!=
faces_id
.
end
();
++
it
)
{
Surface
*
s
=
FindSurface
(
*
it
);
if
(
s
)
{
for
(
int
i
=
0
;
i
<
n_nodes_by_edge
;
i
++
)
{
for
(
int
j
=
0
;
j
<
n_nodes_by_edge
;
j
++
)
{
double
u
=
(
double
)
i
/
(
n_nodes_by_edge
-
1
);
double
v
=
(
double
)
j
/
(
n_nodes_by_edge
-
1
);
Vertex
V
=
InterpolateSurface
(
s
,
u
,
v
,
0
,
0
);
zeronodes
[
k
][
0
]
=
V
.
Pos
.
X
;
zeronodes
[
k
][
1
]
=
V
.
Pos
.
Y
;
zeronodes
[
k
++
][
2
]
=
V
.
Pos
.
Z
;
}
}
}
else
{
GFace
*
f
=
GModel
::
current
()
->
getFaceByTag
(
*
it
);
if
(
f
)
{
for
(
int
i
=
0
;
i
<
n_nodes_by_edge
;
i
++
)
{
for
(
int
j
=
0
;
j
<
n_nodes_by_edge
;
j
++
)
{
double
u
=
(
double
)
i
/
(
n_nodes_by_edge
-
1
);
double
v
=
(
double
)
j
/
(
n_nodes_by_edge
-
1
);
Range
<
double
>
b1
=
ge
->
parBounds
(
0
);
Range
<
double
>
b2
=
ge
->
parBounds
(
1
);
double
t1
=
b1
.
low
()
+
u
*
(
b1
.
high
()
-
b1
.
low
());
double
t2
=
b2
.
low
()
+
v
*
(
b2
.
high
()
-
b2
.
low
());
GPoint
gp
=
f
->
point
(
t1
,
t2
);
zeronodes
[
k
][
0
]
=
gp
.
x
();
zeronodes
[
k
][
1
]
=
gp
.
y
();
zeronodes
[
k
++
][
2
]
=
gp
.
z
();
}
}
}
}
}
kdtree
=
new
ANNkd_tree
(
zeronodes
,
totpoints
,
3
);
update_needed
=
false
;
}
...
...
This diff is collapsed.
Click to expand it.
doc/TODO.txt
+
6
−
7
View file @
9ce73bf3
$Id: TODO.txt,v 1.6 2008-10-01 19:18:14 geuzaine Exp $
********************************************************************
Add Attractor field on surfaces (use the surface mesh points as point
attractors?)
$Id: TODO.txt,v 1.7 2008-10-05 12:06:58 geuzaine Exp $
********************************************************************
...
...
@@ -39,7 +34,8 @@ entity, and sort like in post-processing.
fix tetgen for non manifold geometries: with a single surface
connected to a volume and tetgen modifies the volume boundary mesh, we
get hanging nodes
Plus we need to fix the 1D mesh in all cases
Also: we need to fix the 1D mesh in all cases!
********************************************************************
...
...
@@ -72,6 +68,9 @@ interface GModel in surface creation in the parser
add linear lc progression in 1D transfinite generator
Also: implement easier to understand "bump" function (double
progression?)
********************************************************************
add parameter to geo transforms to copy the meshes--this would allow
...
...
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