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
207529ca
Commit
207529ca
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
get name of physical group
parent
48a2329f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Parser/Gmsh.tab.cpp
+3086
-3048
3086 additions, 3048 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+135
-109
135 additions, 109 deletions
Parser/Gmsh.y
with
3221 additions
and
3157 deletions
Parser/Gmsh.tab.cpp
+
3086
−
3048
View file @
207529ca
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
135
−
109
View file @
207529ca
...
@@ -5415,28 +5415,16 @@ FExpr_Multi :
...
@@ -5415,28 +5415,16 @@ FExpr_Multi :
{
{
$$ = GetAllElementaryEntityNumbers(3);
$$ = GetAllElementaryEntityNumbers(3);
}
}
| tPhysical tPoint
tBIGSTR
| tPhysical tPoint
ListOfDoubleOrAll
{
{
if(!$3){
$$ = GetAllPhysicalEntityNumbers(0);
$$ = GetAllPhysicalEntityNumbers(0);
}
}
| tPhysical tLine tBIGSTR
else{
{
$$ = GetAllPhysicalEntityNumbers(1);
}
| tPhysical tSurface tBIGSTR
{
$$ = GetAllPhysicalEntityNumbers(2);
}
| tPhysical tVolume tBIGSTR
{
$$ = GetAllPhysicalEntityNumbers(3);
}
| tPhysical tPoint '{' RecursiveListOfDouble '}'
{
$$ = List_Create(10, 1, sizeof(double));
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($
4
); i++){
for(int i = 0; i < List_Nbr($
3
); i++){
double num;
double num;
List_Read($
4
, i, &num);
List_Read($
3
, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_POINT);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_POINT);
if(p){
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
for(int j = 0; j < List_Nbr(p->Entities); j++){
...
@@ -5458,14 +5446,19 @@ FExpr_Multi :
...
@@ -5458,14 +5446,19 @@ FExpr_Multi :
}
}
}
}
}
}
List_Delete($4);
List_Delete($3);
}
}
}
| tPhysical tLine
'{' Recursive
ListOfDouble
'}'
| tPhysical tLine ListOfDouble
OrAll
{
{
if(!$3){
$$ = GetAllPhysicalEntityNumbers(1);
}
else{
$$ = List_Create(10, 1, sizeof(double));
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($
4
); i++){
for(int i = 0; i < List_Nbr($
3
); i++){
double num;
double num;
List_Read($
4
, i, &num);
List_Read($
3
, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_LINE);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_LINE);
if(p){
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
for(int j = 0; j < List_Nbr(p->Entities); j++){
...
@@ -5487,14 +5480,19 @@ FExpr_Multi :
...
@@ -5487,14 +5480,19 @@ FExpr_Multi :
}
}
}
}
}
}
List_Delete($
4
);
List_Delete($
3
);
}
}
| tPhysical tSurface '{' RecursiveListOfDouble '}'
}
| tPhysical tSurface ListOfDoubleOrAll
{
{
if(!$3){
$$ = GetAllPhysicalEntityNumbers(2);
}
else{
$$ = List_Create(10, 1, sizeof(double));
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($
4
); i++){
for(int i = 0; i < List_Nbr($
3
); i++){
double num;
double num;
List_Read($
4
, i, &num);
List_Read($
3
, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_SURFACE);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_SURFACE);
if(p){
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
for(int j = 0; j < List_Nbr(p->Entities); j++){
...
@@ -5516,14 +5514,19 @@ FExpr_Multi :
...
@@ -5516,14 +5514,19 @@ FExpr_Multi :
}
}
}
}
}
}
List_Delete($
4
);
List_Delete($
3
);
}
}
| tPhysical tVolume '{' RecursiveListOfDouble '}'
}
| tPhysical tVolume ListOfDoubleOrAll
{
{
if(!$3){
$$ = GetAllPhysicalEntityNumbers(3);
}
else{
$$ = List_Create(10, 1, sizeof(double));
$$ = List_Create(10, 1, sizeof(double));
for(int i = 0; i < List_Nbr($
4
); i++){
for(int i = 0; i < List_Nbr($
3
); i++){
double num;
double num;
List_Read($
4
, i, &num);
List_Read($
3
, i, &num);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_VOLUME);
PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_VOLUME);
if(p){
if(p){
for(int j = 0; j < List_Nbr(p->Entities); j++){
for(int j = 0; j < List_Nbr(p->Entities); j++){
...
@@ -5545,7 +5548,8 @@ FExpr_Multi :
...
@@ -5545,7 +5548,8 @@ FExpr_Multi :
}
}
}
}
}
}
List_Delete($4);
List_Delete($3);
}
}
}
| tPoint tIn tBoundingBox
| tPoint tIn tBoundingBox
'{' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr '}'
'{' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr '}'
...
@@ -5980,7 +5984,6 @@ StringExprVar :
...
@@ -5980,7 +5984,6 @@ StringExprVar :
strcpy($$, val.c_str());
strcpy($$, val.c_str());
Free($1);
Free($1);
}
}
| String__Index '.' tSTRING_Member_Float
| String__Index '.' tSTRING_Member_Float
{
{
std::string out;
std::string out;
...
@@ -6002,7 +6005,6 @@ StringExprVar :
...
@@ -6002,7 +6005,6 @@ StringExprVar :
Free($1);
Free($1);
if (flag_tSTRING_alloc) Free($3);
if (flag_tSTRING_alloc) Free($3);
}
}
| tSTRING '[' FExpr ']' '.' tSTRING
| tSTRING '[' FExpr ']' '.' tSTRING
{
{
std::string out;
std::string out;
...
@@ -6011,6 +6013,30 @@ StringExprVar :
...
@@ -6011,6 +6013,30 @@ StringExprVar :
strcpy($$, out.c_str());
strcpy($$, out.c_str());
Free($1); Free($6);
Free($1); Free($6);
}
}
| tPhysical tPoint '{' FExpr '}'
{
std::string name = GModel::current()->getPhysicalName(0, (int)$4);
$$ = (char*)Malloc((name.size() + 1) * sizeof(char));
strcpy($$, name.c_str());
}
| tPhysical tLine '{' FExpr '}'
{
std::string name = GModel::current()->getPhysicalName(1, (int)$4);
$$ = (char*)Malloc((name.size() + 1) * sizeof(char));
strcpy($$, name.c_str());
}
| tPhysical tSurface '{' FExpr '}'
{
std::string name = GModel::current()->getPhysicalName(2, (int)$4);
$$ = (char*)Malloc((name.size() + 1) * sizeof(char));
strcpy($$, name.c_str());
}
| tPhysical tVolume '{' FExpr '}'
{
std::string name = GModel::current()->getPhysicalName(3, (int)$4);
$$ = (char*)Malloc((name.size() + 1) * sizeof(char));
strcpy($$, name.c_str());
}
;
;
StringExpr :
StringExpr :
...
@@ -6259,7 +6285,6 @@ StringExpr :
...
@@ -6259,7 +6285,6 @@ StringExpr :
strcpy($$, val.c_str());
strcpy($$, val.c_str());
Free($3);
Free($3);
}
}
| tNameStruct LP NameStruct_Arg RP
| tNameStruct LP NameStruct_Arg RP
{
{
std::string out;
std::string out;
...
@@ -6280,7 +6305,6 @@ NameStruct_Arg :
...
@@ -6280,7 +6305,6 @@ NameStruct_Arg :
{ Struct_NameSpace = $1; $$ = $5; }
{ Struct_NameSpace = $1; $$ = $5; }
;
;
RecursiveListOfStringExprVar :
RecursiveListOfStringExprVar :
StringExprVar
StringExprVar
{
{
...
@@ -6288,7 +6312,9 @@ RecursiveListOfStringExprVar :
...
@@ -6288,7 +6312,9 @@ RecursiveListOfStringExprVar :
List_Add($$, &($1));
List_Add($$, &($1));
}
}
| RecursiveListOfStringExprVar ',' StringExprVar
| RecursiveListOfStringExprVar ',' StringExprVar
{ List_Add($$, &($3)); }
{
List_Add($$, &($3));
}
;
;
StringIndex :
StringIndex :
...
...
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