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
d707246a
Commit
d707246a
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
allow Physicals as right values in FExprs
parent
45de44ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Parser/Gmsh.tab.cpp
+1769
-1677
1769 additions, 1677 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+72
-0
72 additions, 0 deletions
Parser/Gmsh.y
doc/texinfo/gmsh.texi
+6
-4
6 additions, 4 deletions
doc/texinfo/gmsh.texi
with
1847 additions
and
1681 deletions
Parser/Gmsh.tab.cpp
+
1769
−
1677
View file @
d707246a
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
72
−
0
View file @
d707246a
...
@@ -4219,6 +4219,78 @@ FExpr_Multi :
...
@@ -4219,6 +4219,78 @@ FExpr_Multi :
{
{
$$ = GetAllEntityNumbers(3);
$$ = GetAllEntityNumbers(3);
}
}
| tPhysical tPoint '{' RecursiveListOfDouble '}'
{
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($4); i++){
double num;
List_Read($4, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_POINT);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add($$, &d);
}
}
}
List_Delete($4);
}
| tPhysical tLine '{' RecursiveListOfDouble '}'
{
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($4); i++){
double num;
List_Read($4, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_LINE);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add($$, &d);
}
}
}
List_Delete($4);
}
| tPhysical tSurface '{' RecursiveListOfDouble '}'
{
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($4); i++){
double num;
List_Read($4, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_SURFACE);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add($$, &d);
}
}
}
List_Delete($4);
}
| tPhysical tVolume '{' RecursiveListOfDouble '}'
{
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($4); i++){
double num;
List_Read($4, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_VOLUME);
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
int nume;
List_Read(p->Entities, j, &nume);
double d = nume;
List_Add($$, &d);
}
}
}
List_Delete($4);
}
| Transform
| Transform
{
{
$$ = List_Create(List_Nbr($1), 1, sizeof(double));
$$ = List_Create(List_Nbr($1), 1, sizeof(double));
...
...
This diff is collapsed.
Click to expand it.
doc/texinfo/gmsh.texi
+
6
−
4
View file @
d707246a
...
@@ -1336,6 +1336,7 @@ List of expressions are also widely used, and are defined as:
...
@@ -1336,6 +1336,7 @@ List of expressions are also widely used, and are defined as:
@var
{
extrude
}
@var
{
extrude
}
Point @
{
@var
{
expression
}
@
}
|
Point @
{
@var
{
expression
}
@
}
|
Point|Line|Surface|Volume "*" |
Point|Line|Surface|Volume "*" |
Physical Point|Line|Surface|Volume @
{
@var
{
expression-list
}
@
}
@c @var
{
duplicata
}
- already implemented: should we explain this?
@c @var
{
duplicata
}
- already implemented: should we explain this?
@end example
@end example
...
@@ -1350,10 +1351,11 @@ permits to reference an expression sublist (whose elements are those
...
@@ -1350,10 +1351,11 @@ permits to reference an expression sublist (whose elements are those
corresponding to the indices provided by the @var
{
expression-list
}
).
corresponding to the indices provided by the @var
{
expression-list
}
).
The next two cases permit to retrieve the indices of entities created
The next two cases permit to retrieve the indices of entities created
through geometrical transformations and extrusions (see
through geometrical transformations and extrusions (see
@ref
{
Transformations
}
, and @ref
{
Extrusions
}
). The last two cases permit
@ref
{
Transformations
}
, and @ref
{
Extrusions
}
). The last three cases
to retrieve the coordinates of a given geometry point (@pxref
{
Points
}
),
permit to retrieve the coordinates of a given geometry point
or to retrieve the id numbers of all points, lines, surfaces or volumes
(@pxref
{
Points
}
), to retrieve the id numbers of all points, lines,
in the model.
surfaces or volumes in the model, or to retrieve the elementary entities
making up physical groups.
To see the practical use of such expressions, have a look at the first
To see the practical use of such expressions, have a look at the first
couple of examples in @ref
{
Tutorial
}
. Note that, in order to lighten the
couple of examples in @ref
{
Tutorial
}
. Note that, in order to lighten the
...
...
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