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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
ab1038c9
Commit
ab1038c9
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
new VerticesList in Restrict field
parent
0949cd9b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/Field.cpp
+16
-15
16 additions, 15 deletions
Mesh/Field.cpp
with
16 additions
and
15 deletions
Mesh/Field.cpp
+
16
−
15
View file @
ab1038c9
...
...
@@ -1538,12 +1538,13 @@ class MaxField : public Field
class
RestrictField
:
public
Field
{
int
iField
;
std
::
list
<
int
>
edges
,
faces
,
regions
;
std
::
list
<
int
>
vertices
,
edges
,
faces
,
regions
;
public:
RestrictField
()
{
iField
=
1
;
options
[
"IField"
]
=
new
FieldOptionInt
(
iField
,
"Field index"
);
options
[
"VerticesList"
]
=
new
FieldOptionList
(
vertices
,
"Point indices"
);
options
[
"EdgesList"
]
=
new
FieldOptionList
(
edges
,
"Curve indices"
);
options
[
"FacesList"
]
=
new
FieldOptionList
(
faces
,
"Surface indices"
);
options
[
"RegionsList"
]
=
new
FieldOptionList
(
regions
,
"Volume indices"
);
...
...
@@ -1551,14 +1552,15 @@ class RestrictField : public Field
std
::
string
getDescription
()
{
return
"Restrict the application of a field to a given list of geometrical "
"curves, surfaces or volumes."
;
"
points,
curves, surfaces or volumes."
;
}
double
operator
()
(
double
x
,
double
y
,
double
z
,
GEntity
*
ge
=
0
)
{
Field
*
f
=
(
GModel
::
current
()
->
getFields
()
->
get
(
iField
));
if
(
!
f
||
iField
==
id
)
return
MAX_LC
;
if
(
!
ge
)
return
(
*
f
)
(
x
,
y
,
z
);
if
((
ge
->
dim
()
==
0
)
||
if
((
ge
->
dim
()
==
0
&&
std
::
find
(
vertices
.
begin
(),
vertices
.
end
(),
ge
->
tag
())
!=
vertices
.
end
())
||
(
ge
->
dim
()
==
1
&&
std
::
find
(
edges
.
begin
(),
edges
.
end
(),
ge
->
tag
())
!=
edges
.
end
())
||
(
ge
->
dim
()
==
2
&&
std
::
find
...
...
@@ -1820,7 +1822,6 @@ class AttractorField : public Field
it
!=
faces_id
.
end
();
++
it
)
{
GFace
*
f
=
GModel
::
current
()
->
getFaceByTag
(
*
it
);
if
(
f
){
if
(
f
->
mesh_vertices
.
size
()){
for
(
unsigned
int
i
=
0
;
i
<
f
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v
=
f
->
mesh_vertices
[
i
];
...
...
@@ -1847,7 +1848,7 @@ class AttractorField : public Field
((
points
.
size
())
?
points
.
size
()
:
n_nodes_by_edge
*
n_nodes_by_edge
*
faces_id
.
size
());
Msg
::
Info
(
"%d points found in point
s
clouds (%d edges)"
,
totpoints
,
Msg
::
Info
(
"%d points found in point clouds (%d edges)"
,
totpoints
,
(
int
)
edges_id
.
size
());
if
(
totpoints
){
...
...
@@ -2030,7 +2031,8 @@ void BoundaryLayerField::setupFor2d(int iF)
it
!=
ed
.
end
()
;
++
it
){
bool
isIn
=
false
;
int
iE
=
(
*
it
)
->
tag
();
bool
found
=
std
::
find
(
edges_id_saved
.
begin
(),
edges_id_saved
.
end
(),
iE
)
!=
edges_id_saved
.
end
();
bool
found
=
std
::
find
(
edges_id_saved
.
begin
(),
edges_id_saved
.
end
(),
iE
)
!=
edges_id_saved
.
end
();
// printf("edges %d found %d\n",iE,found);
// this edge is a BL Edge
if
(
found
){
...
...
@@ -2040,13 +2042,15 @@ void BoundaryLayerField::setupFor2d(int iF)
else
{
// more than one face and
std
::
list
<
GFace
*>::
iterator
itf
=
fc
.
begin
();
bool
found_this
=
std
::
find
(
faces_id_saved
.
begin
(),
faces_id_saved
.
end
(),
iF
)
!=
faces_id_saved
.
end
();
bool
found_this
=
std
::
find
(
faces_id_saved
.
begin
(),
faces_id_saved
.
end
(),
iF
)
!=
faces_id_saved
.
end
();
if
(
!
found_this
)
isIn
=
true
;
else
{
bool
foundAll
=
true
;
for
(
;
itf
!=
fc
.
end
()
;
++
itf
){
int
iF2
=
(
*
itf
)
->
tag
();
foundAll
&=
std
::
find
(
faces_id_saved
.
begin
(),
faces_id_saved
.
end
(),
iF2
)
!=
faces_id_saved
.
end
();
foundAll
&=
std
::
find
(
faces_id_saved
.
begin
(),
faces_id_saved
.
end
(),
iF2
)
!=
faces_id_saved
.
end
();
}
if
(
foundAll
)
isIn
=
true
;
}
...
...
@@ -2059,7 +2063,6 @@ void BoundaryLayerField::setupFor2d(int iF)
}
}
// printf("face %d %d BL Edges\n", iF, (int)edges_id.size());
removeAttractors
();
}
}
...
...
@@ -2070,10 +2073,8 @@ void BoundaryLayerField::setupFor3d()
removeAttractors
();
}
double
BoundaryLayerField
::
operator
()
(
double
x
,
double
y
,
double
z
,
GEntity
*
ge
)
{
if
(
update_needed
){
for
(
std
::
list
<
int
>::
iterator
it
=
nodes_id
.
begin
();
it
!=
nodes_id
.
end
();
++
it
)
{
...
...
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