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
bb86220e
Commit
bb86220e
authored
24 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Corrected syntax
parent
736436f7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/Geo.cpp
+24
-24
24 additions, 24 deletions
Geo/Geo.cpp
Parser/Gmsh.tab.cpp
+1017
-1046
1017 additions, 1046 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+44
-53
44 additions, 53 deletions
Parser/Gmsh.y
Parser/Gmsh.yy.cpp
+1
-1
1 addition, 1 deletion
Parser/Gmsh.yy.cpp
with
1086 additions
and
1124 deletions
Geo/Geo.cpp
+
24
−
24
View file @
bb86220e
/* $Id: Geo.cpp,v 1.
4
2000-11-2
6
1
5
:4
3
:4
5
geuzaine Exp $ */
/* $Id: Geo.cpp,v 1.
5
2000-11-2
8
1
4
:4
2
:4
2
geuzaine Exp $ */
#include
"Gmsh.h"
#include
"Const.h"
...
...
@@ -73,21 +73,21 @@ void add_infile(char *text, char *fich){
void
del_pnt
(
int
p1
,
char
*
fich
){
char
text
[
BUFFSIZE
];
sprintf
(
text
,
"Delete {
\n
Point
(
%d
)
;
\n
}"
,
p1
);
sprintf
(
text
,
"Delete {
\n
Point
{
%d
}
;
\n
}"
,
p1
);
add_infile
(
text
,
fich
);
}
void
del_seg
(
int
p1
,
char
*
fich
){
char
text
[
BUFFSIZE
];
sprintf
(
text
,
"Delete {
\n
Line
(
%d
)
;
\n
}"
,
p1
);
sprintf
(
text
,
"Delete {
\n
Line
{
%d
}
;
\n
}"
,
p1
);
add_infile
(
text
,
fich
);
}
void
del_srf
(
int
p1
,
char
*
fich
){
char
text
[
BUFFSIZE
];
sprintf
(
text
,
"Delete {
\n
Surface
(
%d
)
;
\n
}"
,
p1
);
sprintf
(
text
,
"Delete {
\n
Surface
{
%d
}
;
\n
}"
,
p1
);
add_infile
(
text
,
fich
);
}
...
...
@@ -164,10 +164,10 @@ void add_trsfline (int N, int *l, char *fich){
}
if
(
Mode_Transfinite
==
0
)
sprintf
(
text2
,
"} = %s;"
,
nb_pts
);
else
if
(
Mode_Transfinite
==
1
)
sprintf
(
text2
,
"} = %s Using Progression %s;"
,
nb_pts
,
mode_value
);
else
if
(
Mode_Transfinite
==
2
)
sprintf
(
text2
,
"} = %s Using Bump %s;"
,
nb_pts
,
mode_value
);
else
if
(
Mode_Transfinite
==
1
)
sprintf
(
text2
,
"} = %s Using Power %s;"
,
nb_pts
,
mode_value
);
strcat
(
text
,
text2
);
add_infile
(
text
,
fich
);
}
...
...
@@ -191,16 +191,16 @@ void add_point(char *fich){
void
add_attractor
(
char
*
fich
,
int
ip
,
int
typ
){
char
text
[
BUFFSIZE
];
if
(
typ
==
0
)
{
sprintf
(
text
,
"Attractor Point
(
%s,%s,%s
)
=
{%d}
;"
,
attrx_text
,
attry_text
,
attrdec_text
,
ip
);
sprintf
(
text
,
"Attractor Point
{%d} = {
%s,%s,%s
}
= ;"
,
ip
,
attrx_text
,
attry_text
,
attrdec_text
);
}
else
if
(
typ
==
1
){
sprintf
(
text
,
"Attractor Line
(
%s,%s,%s
) = {%d
};"
,
attrx_text
,
attry_text
,
attrdec_text
,
ip
);
sprintf
(
text
,
"Attractor Line
{%d} = {
%s,%s,%s};"
,
ip
,
attrx_text
,
attry_text
,
attrdec_text
);
}
else
if
(
typ
==
2
)
{
sprintf
(
text
,
"Attractor Surface
(
%s,%s,%s
) = {%d
};"
,
attrx_text
,
attry_text
,
attrdec_text
,
ip
);
sprintf
(
text
,
"Attractor Surface
{%d} = {
%s,%s,%s};"
,
ip
,
attrx_text
,
attry_text
,
attrdec_text
);
}
add_infile
(
text
,
fich
);
}
...
...
@@ -454,7 +454,7 @@ void add_physical_entity(List_T *list, char *fich, int type, int *num){
void
extrude
(
int
s
,
char
*
fich
,
char
*
what
){
char
text
[
BUFFSIZE
];
sprintf
(
text
,
"Extrude %s
(
%d, {%s,%s,%s}
)
;"
,
what
,
s
,
tx_text
,
ty_text
,
tz_text
);
sprintf
(
text
,
"Extrude %s
{
%d, {%s,%s,%s}
}
;"
,
what
,
s
,
tx_text
,
ty_text
,
tz_text
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
}
...
...
@@ -462,10 +462,10 @@ void translate_seg(int add, int s, char *fich){
char
text
[
BUFFSIZE
];
if
(
add
)
sprintf
(
text
,
"Translate
(
{%s,%s,%s}
)
{
\n
Duplicata { Line
(
%d
)
; }
\n
}"
,
sprintf
(
text
,
"Translate
{%s,%s,%s} {
\n
Duplicata { Line
{
%d
}
; }
\n
}"
,
tx_text
,
ty_text
,
tz_text
,
s
);
else
sprintf
(
text
,
"Translate
(
{%s,%s,%s}
)
{
\n
Line
(
%d
)
;
\n
}"
,
sprintf
(
text
,
"Translate
{%s,%s,%s} {
\n
Line
{
%d
}
;
\n
}"
,
tx_text
,
ty_text
,
tz_text
,
s
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
...
...
@@ -476,10 +476,10 @@ void translate_surf(int add, int s, char *fich){
char
text
[
BUFFSIZE
];
if
(
add
)
sprintf
(
text
,
"Translate
(
{%s,%s,%s}
)
{
\n
Duplicata { Surface
(
%d
)
; }
\n
}"
,
sprintf
(
text
,
"Translate
{%s,%s,%s} {
\n
Duplicata { Surface
{
%d
}
; }
\n
}"
,
tx_text
,
ty_text
,
tz_text
,
s
);
else
sprintf
(
text
,
"Translate
(
{%s,%s,%s}
)
{
\n
Surface
(
%d
)
;
\n
}"
,
sprintf
(
text
,
"Translate
{%s,%s,%s} {
\n
Surface
{
%d
}
;
\n
}"
,
tx_text
,
ty_text
,
tz_text
,
s
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
...
...
@@ -489,10 +489,10 @@ void translate_pt(int add, int s, char *fich){
char
text
[
BUFFSIZE
];
if
(
add
)
sprintf
(
text
,
"Translate
(
{%s,%s,%s}
)
{
\n
Duplicata { Point
(
%d
)
; }
\n
}"
,
sprintf
(
text
,
"Translate
{%s,%s,%s} {
\n
Duplicata { Point
{
%d
}
; }
\n
}"
,
tx_text
,
ty_text
,
tz_text
,
s
);
else
sprintf
(
text
,
"Translate
(
{%s,%s,%s}
)
{
\n
Point
(
%d
)
;
\n
}"
,
sprintf
(
text
,
"Translate
{%s,%s,%s} {
\n
Point
{
%d
}
;
\n
}"
,
tx_text
,
ty_text
,
tz_text
,
s
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
...
...
@@ -502,10 +502,10 @@ void rotate(int add, int s, char *fich, char *quoi){
char
text
[
BUFFSIZE
];
if
(
add
)
sprintf
(
text
,
"Rotate
(
{%s,%s,%s},{%s,%s,%s},%s
)
{
\n
Duplicata { %s
(
%d
)
; }
\n
}"
,
sprintf
(
text
,
"Rotate
{
{%s,%s,%s},{%s,%s,%s},%s
}
{
\n
Duplicata { %s
{
%d
}
; }
\n
}"
,
ax_text
,
ay_text
,
az_text
,
px_text
,
py_text
,
pz_text
,
angle_text
,
quoi
,
s
);
else
sprintf
(
text
,
"Rotate
(
{%s,%s,%s},{%s,%s,%s},%s
)
{
\n
%s
(
%d
)
;
\n
}"
,
sprintf
(
text
,
"Rotate
{
{%s,%s,%s},{%s,%s,%s},%s
}
{
\n
%s
{
%d
}
;
\n
}"
,
ax_text
,
ay_text
,
az_text
,
px_text
,
py_text
,
pz_text
,
angle_text
,
quoi
,
s
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
...
...
@@ -515,10 +515,10 @@ void dilate(int add, int s, char *fich, char *quoi){
char
text
[
BUFFSIZE
];
if
(
add
)
sprintf
(
text
,
"Dilate
(
{%s,%s,%s},%s
)
{
\n
Duplicata { %s
(
%d
)
; }
\n
}"
,
sprintf
(
text
,
"Dilate
{
{%s,%s,%s},%s
}
{
\n
Duplicata { %s
{
%d
}
; }
\n
}"
,
dx_text
,
dy_text
,
dz_text
,
df_text
,
quoi
,
s
);
else
sprintf
(
text
,
"Dilate
(
{%s,%s,%s},%s
)
{
\n
%s
(
%d
)
;
\n
}"
,
sprintf
(
text
,
"Dilate
{
{%s,%s,%s},%s
}
{
\n
%s
{
%d
}
;
\n
}"
,
dx_text
,
dy_text
,
dz_text
,
df_text
,
quoi
,
s
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
...
...
@@ -528,7 +528,7 @@ void dilate(int add, int s, char *fich, char *quoi){
void
protude
(
int
s
,
char
*
fich
,
char
*
what
){
char
text
[
BUFFSIZE
];
sprintf
(
text
,
"Extrude %s
(
%d, {%s,%s,%s}, {%s,%s,%s}, %s
)
;"
,
what
,
s
,
ax_text
,
ay_text
,
sprintf
(
text
,
"Extrude %s
{
%d, {%s,%s,%s}, {%s,%s,%s}, %s
}
;"
,
what
,
s
,
ax_text
,
ay_text
,
az_text
,
px_text
,
py_text
,
pz_text
,
angle_text
);
add_infile
(
text
,
fich
);
add_infile
(
"Coherence;"
,
fich
);
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.tab.cpp
+
1017
−
1046
View file @
bb86220e
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
44
−
53
View file @
bb86220e
%{ /* $Id: Gmsh.y,v 1.
8
2000-11-28 1
1:28:35
geuzaine Exp $ */
%{ /* $Id: Gmsh.y,v 1.
9
2000-11-28 1
4:42:44
geuzaine Exp $ */
#include <stdarg.h>
...
...
@@ -697,21 +697,21 @@ Shape :
$$.Type = MSH_PHYSICAL_POINT;
$$.Num = (int)$4;
}
| tAttractor tPoint '(' FExpr ',' FExpr ',' FExpr ')'
tAFFECT ListOfDouble
tEND
| tAttractor tPoint
ListOfDouble tAFFECT
'(' FExpr ',' FExpr ',' FExpr ')' tEND
{
Vertex *v;
Attractor *a;
double p;
int ip;
for(int i=0;i<List_Nbr($
11
);i++){
List_Read($
11
,i,&p);
for(int i=0;i<List_Nbr($
3
);i++){
List_Read($
3
,i,&p);
ip = (int)p;
v = FindVertex(ip,THEM);
if(!v)
vyyerror("Unkown Point %d", ip);
else{
a = Create_Attractor(List_Nbr(THEM->Metric->Attractors)+1,
$4,
$6,$8,v,NULL,NULL);
$6,$8,
$10,
v,NULL,NULL);
List_Add(THEM->Metric->Attractors,&a);
}
}
...
...
@@ -727,7 +727,7 @@ Shape :
v->lc = $5;
}
}
| tPoint '
(
' FExpr '
)
' tEND
| tPoint '
{
' FExpr '
}
' tEND
{
$$.Type = MSH_POINT;
$$.Num = (int)$3;
...
...
@@ -747,21 +747,21 @@ Shape :
$$.Type = MSH_SEGM_SPLN;
$$.Num = (int)$3;
}
| tAttractor tLine
'(
' FExpr ',' FExpr ',' FExpr '
)
'
tAFFECT ListOfDouble
tEND
| tAttractor tLine
ListOfDouble tAFFECT '{
' FExpr ',' FExpr ',' FExpr '
}
' tEND
{
Curve *c;
Attractor *a;
double p;
int ip;
for(int i=0;i<List_Nbr($
11
);i++){
List_Read($
11
,i,&p);
for(int i=0;i<List_Nbr($
3
);i++){
List_Read($
3
,i,&p);
ip = (int)p;
c = FindCurve(ip,THEM);
if(!c)
vyyerror("Unkown Curve %d", ip);
else{
a = Create_Attractor(List_Nbr(THEM->Metric->Attractors)+1,
$4,
$6,$8,NULL,c,NULL);
$6,$8,
$10,
NULL,c,NULL);
List_Add(THEM->Metric->Attractors,&a);
}
}
...
...
@@ -789,7 +789,7 @@ Shape :
$$.Num = (int)$3;
}
| tParametric '(' FExpr ')' tAFFECT
'
(
' FExpr ',' FExpr ',' tBIGSTR ',' tBIGSTR ',' tBIGSTR '
)
' tEND
'
{
' FExpr ',' FExpr ',' tBIGSTR ',' tBIGSTR ',' tBIGSTR '
}
' tEND
{
Cdbseg101((int)$3,MSH_SEGM_PARAMETRIC,2,NULL,NULL,-1,-1,$7,$9,$11,$13,$15);
$$.Type = MSH_SEGM_PARAMETRIC ;
...
...
@@ -813,15 +813,6 @@ Shape :
Cdbz101((int)$4,$$.Type,0,0,0,0,0,NULL,$7,NULL);
$$.Num = (int)$4;
}
| tLine '(' FExpr ')' tEND
{
$$.Num = (int)$3;
Curve *c = FindCurve($$.Num,THEM);
if(!c)
vyyerror("Unkown Curve %d", $$.Num);
else
$$.Type = c->Typ;
}
| tBSpline '(' FExpr ')' tAFFECT ListOfDouble tEND
{
Cdbseg101((int)$3,MSH_SEGM_BSPLN,2,$6,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
...
...
@@ -847,6 +838,15 @@ Shape :
AddCurveInDataBase ((int)$3,MSH_SEGM_NURBS,(int)$10,Temp,$8,-1,-1,0.,1.);
List_Delete(Temp);
}
| tLine '{' FExpr '}' tEND
{
$$.Num = (int)$3;
Curve *c = FindCurve($$.Num,THEM);
if(!c)
vyyerror("Unkown Curve %d", $$.Num);
else
$$.Type = c->Typ;
}
/* -------- Surfaces -------- */
...
...
@@ -922,7 +922,7 @@ Shape :
$$.Type = MSH_SURF_LOOP;
$$.Num = (int)$4;
}
| tSurface '
(
' FExpr '
)
' tEND
| tSurface '
{
' FExpr '
}
' tEND
{
$$.Num = (int)$3;
Surface *s = FindSurface($$.Num,THEM);
...
...
@@ -959,22 +959,22 @@ Shape :
------------------- */
Transform :
tTranslate
'('
VExpr
')'
'{' MultipleShape '}'
tTranslate VExpr '{' MultipleShape '}'
{
TranslateShapes ($
3
[0],$
3
[1],$
3
[2],$
6
,1);
$$ = $
6
;
TranslateShapes ($
2
[0],$
2
[1],$
2
[2],$
4
,1);
$$ = $
4
;
}
| tRotate '
(
' VExpr ',' VExpr ',' FExpr '
)
' '{' MultipleShape '}'
| tRotate '
{
' VExpr ',' VExpr ',' FExpr '
}
' '{' MultipleShape '}'
{
RotateShapes($3[0],$3[1],$3[2],$5[0],$5[1],$5[2],$7,$10);
$$ = $10;
}
| tSymmetry
'('
VExpr
')'
'{' MultipleShape '}'
| tSymmetry VExpr '{' MultipleShape '}'
{
SymmetryShapes($
3
[0],$
3
[1],$
3
[2],$
3
[3],$
6
,1);
$$ = $
6
;
SymmetryShapes($
2
[0],$
2
[1],$
2
[2],$
2
[3],$
4
,1);
$$ = $
4
;
}
| tDilate '
(
' VExpr ',' FExpr '
)
' '{' MultipleShape '}'
| tDilate '
{
' VExpr ',' FExpr '
}
' '{' MultipleShape '}'
{
DilatShapes($3[0],$3[1],$3[2],$5,$8,1);
$$ = $8;
...
...
@@ -1068,48 +1068,39 @@ Macro :
--------------- */
Extrude :
tExtrude
'(
' FExpr ',' VExpr '
)
' tEND
tExtrude
tPoint '{
' FExpr ',' VExpr '
}
' tEND
{
Extrude_ProtudeSurface(1,(int)$3,$5[0],$5[1],$5[2],0.,0.,0.,0.,0,NULL);
}
| tExtrude tSurface '(' FExpr ',' VExpr ')' tEND
{
Extrude_ProtudeSurface(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,0,NULL);
}
| tExtrude '(' FExpr ',' VExpr ',' VExpr ',' FExpr ')' tEND
{
Extrude_ProtudeSurface(0,(int)$3,$5[0],$5[1],$5[2],$7[0],$7[1],$7[2],$9,0,NULL);
}
| tExtrude tSurface '(' FExpr ',' VExpr ',' VExpr ',' FExpr ')' tEND
{
Extrude_ProtudeSurface(0,(int)$4,$6[0],$6[1],$6[2],$8[0],$8[1],$8[2],$10,0,NULL);
Curve *pc, *prc;
Extrude_ProtudePoint(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,&pc,&prc,NULL);
}
| tExtrude tPoint '
(
' FExpr ',' VExpr ',' VExpr ',' FExpr '
)
' tEND
| tExtrude tPoint '
{
' FExpr ',' VExpr ',' VExpr ',' FExpr '
}
' tEND
{
Curve *pc, *prc;
Extrude_ProtudePoint(0,(int)$4,$6[0],$6[1],$6[2],$8[0],$8[1],$8[2],$10,
&pc,&prc,NULL);
}
| tExtrude t
Point '(
' FExpr ',' VExpr '
)
' tEND
| tExtrude t
Line'{
' FExpr ',' VExpr '
}
' tEND
{
Curve *pc, *prc;
Extrude_ProtudePoint(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,&pc,&prc,NULL);
Extrude_ProtudeCurve(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,NULL);
}
| tExtrude tLine'
(
' FExpr ',' VExpr ',' VExpr ',' FExpr '
)
' tEND
| tExtrude tLine'
{
' FExpr ',' VExpr ',' VExpr ',' FExpr '
}
' tEND
{
Extrude_ProtudeCurve(0,(int)$4,$6[0],$6[1],$6[2],$8[0],$8[1],$8[2],$10,NULL);
}
| tExtrude t
Line'(
' FExpr ',' VExpr '
)
' tEND
|
tExtrude t
Surface '{
' FExpr ',' VExpr '
}
' tEND
{
Extrude_ProtudeCurve(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,NULL);
Extrude_ProtudeSurface(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,0,NULL);
}
| tExtrude tSurface '{' FExpr ',' VExpr ',' VExpr ',' FExpr '}' tEND
{
Extrude_ProtudeSurface(0,(int)$4,$6[0],$6[1],$6[2],$8[0],$8[1],$8[2],$10,0,NULL);
}
| tExtrude tSurface '
(
' FExpr ',' VExpr '
)
' '{' ExtrudeParameters '}' tEND
| tExtrude tSurface '
{
' FExpr ',' VExpr '
}
' '{' ExtrudeParameters '}' tEND
{
int vol = NEWREG();
Extrude_ProtudeSurface(1,(int)$4,$6[0],$6[1],$6[2],0.,0.,0.,0.,vol,&extr);
}
| tExtrude tSurface '(' FExpr ',' VExpr ',' VExpr ',' FExpr ')'
'{' ExtrudeParameters '}'tEND
| tExtrude tSurface '{' FExpr ',' VExpr ',' VExpr ',' FExpr '}' '{' ExtrudeParameters '}'tEND
{
int vol = NEWREG();
Extrude_ProtudeSurface(0,(int)$4,$6[0],$6[1],$6[2],$8[0],$8[1],$8[2],$10,vol,&extr);
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.yy.cpp
+
1
−
1
View file @
bb86220e
...
...
@@ -2,7 +2,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.1
0
2000-11-28 1
1:28:35
geuzaine Exp $
* $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.1
1
2000-11-28 1
4:42:44
geuzaine Exp $
*/
#define FLEX_SCANNER
...
...
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