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
cf93675a
Commit
cf93675a
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp + fix compile without occ
parent
1f35aaa5
No related branches found
No related tags found
No related merge requests found
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Geo/GModelIO_OCC.h
+1
-1
1 addition, 1 deletion
Geo/GModelIO_OCC.h
Geo/Geo.h
+1
-40
1 addition, 40 deletions
Geo/Geo.h
Parser/Gmsh.tab.cpp
+658
-691
658 additions, 691 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.tab.hpp
+1
-1
1 addition, 1 deletion
Parser/Gmsh.tab.hpp
Parser/Gmsh.y
+40
-73
40 additions, 73 deletions
Parser/Gmsh.y
with
701 additions
and
806 deletions
Geo/GModelIO_OCC.h
+
1
−
1
View file @
cf93675a
...
@@ -264,7 +264,7 @@ public:
...
@@ -264,7 +264,7 @@ public:
OCC_Internals
(){}
OCC_Internals
(){}
bool
getChanged
()
const
{
return
false
;
}
bool
getChanged
()
const
{
return
false
;
}
void
reset
(){}
void
reset
(){}
void
setMaxTag
(
int
dim
,
int
val
)
;
void
setMaxTag
(
int
dim
,
int
val
)
{}
int
getMaxTag
(
int
dim
)
const
{
return
0
;
}
int
getMaxTag
(
int
dim
)
const
{
return
0
;
}
void
addVertex
(
int
tag
,
double
x
,
double
y
,
double
z
,
double
meshSize
=
MAX_LC
)
void
addVertex
(
int
tag
,
double
x
,
double
y
,
double
z
,
double
meshSize
=
MAX_LC
)
{
_error
(
"add vertex"
);
}
{
_error
(
"add vertex"
);
}
...
...
This diff is collapsed.
Click to expand it.
Geo/Geo.h
+
1
−
40
View file @
cf93675a
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include
<vector>
#include
<vector>
#include
<list>
#include
<list>
#include
"GmshDefines.h"
#include
"GmshDefines.h"
#include
"GeoDefines.h"
#include
"gmshSurface.h"
#include
"gmshSurface.h"
#include
"ListUtils.h"
#include
"ListUtils.h"
#include
"TreeUtils.h"
#include
"TreeUtils.h"
...
@@ -17,46 +18,6 @@
...
@@ -17,46 +18,6 @@
#include
"ExtrudeParams.h"
#include
"ExtrudeParams.h"
#include
"findLinks.h"
#include
"findLinks.h"
// type/100 gives (dimension+1)
#define MSH_POINT 100
#define MSH_POINT_BND_LAYER 101
#define MSH_POINT_DISCRETE 102
#define MSH_POINT_FROM_GMODEL 103
#define MSH_SEGM_LINE 200
#define MSH_SEGM_SPLN 201
#define MSH_SEGM_CIRC 202
#define MSH_SEGM_CIRC_INV 203
#define MSH_SEGM_ELLI 204
#define MSH_SEGM_ELLI_INV 205
#define MSH_SEGM_LOOP 206
#define MSH_SEGM_BSPLN 207
#define MSH_SEGM_NURBS 208
#define MSH_SEGM_BEZIER 209
#define MSH_SEGM_BND_LAYER 211
#define MSH_SEGM_DISCRETE 212
#define MSH_SEGM_FROM_GMODEL 213
#define MSH_SEGM_COMPOUND 214
#define MSH_SURF_PLAN 300
#define MSH_SURF_REGL 301
#define MSH_SURF_TRIC 302
#define MSH_SURF_BND_LAYER 303
#define MSH_SURF_LOOP 304
#define MSH_SURF_DISCRETE 305
#define MSH_SURF_FROM_GMODEL 306
#define MSH_SURF_COMPOUND 307
#define MSH_VOLUME 400
#define MSH_VOLUME_DISCRETE 401
#define MSH_VOLUME_FROM_GMODEL 402
#define MSH_VOLUME_COMPOUND 403
#define MSH_PHYSICAL_POINT 500
#define MSH_PHYSICAL_LINE 501
#define MSH_PHYSICAL_SURFACE 502
#define MSH_PHYSICAL_VOLUME 503
struct
Coord
{
struct
Coord
{
double
X
,
Y
,
Z
;
double
X
,
Y
,
Z
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.tab.cpp
+
658
−
691
View file @
cf93675a
This diff is collapsed.
Click to expand it.
Parser/Gmsh.tab.hpp
+
1
−
1
View file @
cf93675a
...
@@ -476,7 +476,7 @@
...
@@ -476,7 +476,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef
union
YYSTYPE
typedef
union
YYSTYPE
#line 1
29
"Gmsh.y"
#line 1
30
"Gmsh.y"
{
{
char
*
c
;
char
*
c
;
int
i
;
int
i
;
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
40
−
73
View file @
cf93675a
...
@@ -21,8 +21,9 @@
...
@@ -21,8 +21,9 @@
#include "GModel.h"
#include "GModel.h"
#include "GModelIO_GEO.h"
#include "GModelIO_GEO.h"
#include "GModelIO_OCC.h"
#include "GModelIO_OCC.h"
#include "Geo.h"
#include "GeoDefines.h"
#include "GeoInterpolation.h"
#include "Geo.h" // FIXME: remove once Extrusion, Color and Visibility have been refactored
#include "ExtrudeParams.h"
#include "Options.h"
#include "Options.h"
#include "Parser.h"
#include "Parser.h"
#include "OpenFile.h"
#include "OpenFile.h"
...
@@ -2554,12 +2555,11 @@ ListOfShapes :
...
@@ -2554,12 +2555,11 @@ ListOfShapes :
}
}
;
;
// L E V E L S E T
// L E V E L S E T
S
LevelSet :
LevelSet :
tLevelset tPlane '(' FExpr ')' tAFFECT ListOfDouble tEND
tLevelset tPlane '(' FExpr ')' tAFFECT ListOfDouble tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($7) == 4){
if(List_Nbr($7) == 4){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2574,24 +2574,20 @@ LevelSet :
...
@@ -2574,24 +2574,20 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
List_Delete($7);
List_Delete($7);
#endif
}
}
| tLevelset tPoint '(' FExpr ')' tAFFECT '{' RecursiveListOfListOfDouble '}' tEND
| tLevelset tPoint '(' FExpr ')' tAFFECT '{' RecursiveListOfListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
yymsg(0, "Levelset %d already exists", t);
yymsg(0, "Levelset %d already exists", t);
}
}
else {
else {
//Msg::Info("nb = %d \n",List_Nbr($8) );
fullMatrix<double> centers(List_Nbr($8),3);
fullMatrix<double> centers(List_Nbr($8),3);
for (int i = 0; i < List_Nbr($8); i++){
for (int i = 0; i < List_Nbr($8); i++){
List_T *l = *(List_T**)List_Pointer($8, i);
List_T *l = *(List_T**)List_Pointer($8, i);
for (int j = 0; j < List_Nbr(l); j++){
for (int j = 0; j < List_Nbr(l); j++){
//Msg::Info("nb j = %d \n",List_Nbr(l) );
centers(i,j) = (double)(*(double*)List_Pointer(l, j));
centers(i,j) = (double)(*(double*)List_Pointer(l, j));
}
}
}
}
...
@@ -2601,13 +2597,10 @@ LevelSet :
...
@@ -2601,13 +2597,10 @@ LevelSet :
for(int i = 0; i < List_Nbr($8); i++)
for(int i = 0; i < List_Nbr($8); i++)
List_Delete(*(List_T**)List_Pointer($8, i));
List_Delete(*(List_T**)List_Pointer($8, i));
List_Delete($8);
List_Delete($8);
#endif
}
}
| tLevelset tPlane '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
| tLevelset tPlane '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
RecursiveListOfDouble '}' tEND
RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($12) == 0){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
yymsg(0, "Levelset %d already exists", t);
yymsg(0, "Levelset %d already exists", t);
...
@@ -2618,17 +2611,11 @@ LevelSet :
...
@@ -2618,17 +2611,11 @@ LevelSet :
gLevelset *ls = new gLevelsetPlane(pt, n, t);
gLevelset *ls = new gLevelsetPlane(pt, n, t);
gLevelset::add(ls);
gLevelset::add(ls);
}
}
}
else
yymsg(0, "Wrong levelset definition (%d)", $4);
List_Delete($12);
List_Delete($12);
#endif
}
}
| tLevelset tPlane '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ',' VExpr ','
| tLevelset tPlane '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ',' VExpr ','
RecursiveListOfDouble '}' tEND
RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($14) == 0){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
yymsg(0, "Levelset %d already exists", t);
yymsg(0, "Levelset %d already exists", t);
...
@@ -2640,15 +2627,10 @@ LevelSet :
...
@@ -2640,15 +2627,10 @@ LevelSet :
gLevelset *ls = new gLevelsetPlane(pt1, pt2, pt3, t);
gLevelset *ls = new gLevelsetPlane(pt1, pt2, pt3, t);
gLevelset::add(ls);
gLevelset::add(ls);
}
}
}
else
yymsg(0, "Wrong levelset definition (%d)", $4);
List_Delete($14);
List_Delete($14);
#endif
}
}
| tLevelset tSphere '(' FExpr ')' tAFFECT '{' VExpr ',' RecursiveListOfDouble '}' tEND
| tLevelset tSphere '(' FExpr ')' tAFFECT '{' VExpr ',' RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($10) == 1){
if(List_Nbr($10) == 1){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2662,14 +2644,12 @@ LevelSet :
...
@@ -2662,14 +2644,12 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
List_Delete($10);
List_Delete($10);
#endif
}
}
| tLevelset tCylinder '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
| tLevelset tCylinder '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
RecursiveListOfDouble '}' tEND
RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($12) == 1){
if(List_Nbr($12) == 1){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2715,14 +2695,12 @@ LevelSet :
...
@@ -2715,14 +2695,12 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
List_Delete($12);
List_Delete($12);
#endif
}
}
| tLevelset tCone '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
| tLevelset tCone '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
RecursiveListOfDouble '}' tEND
RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($12) == 1){
if(List_Nbr($12) == 1){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2738,14 +2716,12 @@ LevelSet :
...
@@ -2738,14 +2716,12 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
List_Delete($12);
List_Delete($12);
#endif
}
}
| tLevelset tEllipsoid '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
| tLevelset tEllipsoid '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
RecursiveListOfDouble '}' tEND
RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($12) == 3){
if(List_Nbr($12) == 3){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2762,14 +2738,12 @@ LevelSet :
...
@@ -2762,14 +2738,12 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
List_Delete($12);
List_Delete($12);
#endif
}
}
| tLevelset tQuadric '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
| tLevelset tQuadric '(' FExpr ')' tAFFECT '{' VExpr ',' VExpr ','
RecursiveListOfDouble '}' tEND
RecursiveListOfDouble '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(List_Nbr($12) == 5){
if(List_Nbr($12) == 5){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2787,13 +2761,11 @@ LevelSet :
...
@@ -2787,13 +2761,11 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
List_Delete($12);
List_Delete($12);
#endif
}
}
| tLevelset tSTRING '(' FExpr ')' tAFFECT ListOfDouble tEND
| tLevelset tSTRING '(' FExpr ')' tAFFECT ListOfDouble tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(!strcmp($2, "Union")){
if(!strcmp($2, "Union")){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2804,7 +2776,7 @@ LevelSet :
...
@@ -2804,7 +2776,7 @@ LevelSet :
for(int i = 0; i < List_Nbr($7); i++) {
for(int i = 0; i < List_Nbr($7); i++) {
double d; List_Read($7, i, &d);
double d; List_Read($7, i, &d);
gLevelset *pl = gLevelset::find((int)d);
gLevelset *pl = gLevelset::find((int)d);
if(!pl) yymsg(0, "
Levelset Union %d : u
nknown levelset %d",
t,
(int)d);
if(!pl) yymsg(0, "
U
nknown levelset %d", (int)d);
else vl.push_back(pl);
else vl.push_back(pl);
}
}
gLevelset *ls = new gLevelsetUnion(vl, true, t);
gLevelset *ls = new gLevelsetUnion(vl, true, t);
...
@@ -2821,7 +2793,7 @@ LevelSet :
...
@@ -2821,7 +2793,7 @@ LevelSet :
for(int i = 0; i < List_Nbr($7); i++) {
for(int i = 0; i < List_Nbr($7); i++) {
double d; List_Read($7, i, &d);
double d; List_Read($7, i, &d);
gLevelset *pl = gLevelset::find((int)d);
gLevelset *pl = gLevelset::find((int)d);
if(!pl) yymsg(0, "
Levelset Intersection %d : u
nknown levelset %d",
t,
(int)d);
if(!pl) yymsg(0, "
U
nknown levelset %d", (int)d);
else vl.push_back(pl);
else vl.push_back(pl);
}
}
gLevelset *ls = new gLevelsetIntersection(vl, true, t);
gLevelset *ls = new gLevelsetIntersection(vl, true, t);
...
@@ -2838,7 +2810,7 @@ LevelSet :
...
@@ -2838,7 +2810,7 @@ LevelSet :
for(int i = 0; i < List_Nbr($7); i++) {
for(int i = 0; i < List_Nbr($7); i++) {
double d; List_Read($7, i, &d);
double d; List_Read($7, i, &d);
gLevelset *pl = gLevelset::find((int)d);
gLevelset *pl = gLevelset::find((int)d);
if(!pl) yymsg(0, "
Levelset Cut %d : u
nknown levelset %d",
t,
(int)d);
if(!pl) yymsg(0, "
U
nknown levelset %d", (int)d);
else vl.push_back(pl);
else vl.push_back(pl);
}
}
gLevelset *ls = new gLevelsetCut(vl, true, t);
gLevelset *ls = new gLevelsetCut(vl, true, t);
...
@@ -2855,7 +2827,7 @@ LevelSet :
...
@@ -2855,7 +2827,7 @@ LevelSet :
for(int i = 0; i < List_Nbr($7); i++) {
for(int i = 0; i < List_Nbr($7); i++) {
double d; List_Read($7, i, &d);
double d; List_Read($7, i, &d);
gLevelset *pl = gLevelset::find((int)d);
gLevelset *pl = gLevelset::find((int)d);
if(!pl) yymsg(0, "
Levelset Crack %d : u
nknown levelset %d",
t,
(int)d);
if(!pl) yymsg(0, "
U
nknown levelset %d", (int)d);
else vl.push_back(pl);
else vl.push_back(pl);
}
}
gLevelset *ls = new gLevelsetCrack(vl, false, t);
gLevelset *ls = new gLevelsetCrack(vl, false, t);
...
@@ -2872,7 +2844,7 @@ LevelSet :
...
@@ -2872,7 +2844,7 @@ LevelSet :
List_Read($7, 0, &d);
List_Read($7, 0, &d);
gLevelset *pl = gLevelset::find((int)d);
gLevelset *pl = gLevelset::find((int)d);
gLevelset *ls = NULL;
gLevelset *ls = NULL;
if(!pl) yymsg(0, "
Levelset Reverse %d : u
nknown levelset %d",
t,
(int)d);
if(!pl) yymsg(0, "
U
nknown levelset %d", (int)d);
else ls = new gLevelsetReverse(pl, t);
else ls = new gLevelsetReverse(pl, t);
if(ls) gLevelset::add(ls);
if(ls) gLevelset::add(ls);
}
}
...
@@ -2893,14 +2865,12 @@ LevelSet :
...
@@ -2893,14 +2865,12 @@ LevelSet :
}
}
#endif
#endif
else
else
yymsg(0, "Wrong levelset definition
(%d)", $4
);
yymsg(0, "Wrong
number of arguments for
levelset definition
"
);
Free($2);
Free($2);
List_Delete($7);
List_Delete($7);
#endif
}
}
| tLevelset tSTRING '(' FExpr ')' tAFFECT tBIGSTR tEND
| tLevelset tSTRING '(' FExpr ')' tAFFECT tBIGSTR tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(!strcmp($2, "MathEval")){
if(!strcmp($2, "MathEval")){
int t = (int)$4;
int t = (int)$4;
if(gLevelset::find(t)){
if(gLevelset::find(t)){
...
@@ -2912,13 +2882,11 @@ LevelSet :
...
@@ -2912,13 +2882,11 @@ LevelSet :
}
}
}
}
else
else
yymsg(0, "
Wrong
levelset
definition"
);
yymsg(0, "
Unknown
levelset
'%s'", $2
);
Free($2); Free($7);
Free($2); Free($7);
#endif
}
}
| tLevelset tSTRING '{' FExpr '}' tEND
| tLevelset tSTRING '{' FExpr '}' tEND
{
{
#if defined(HAVE_DINTEGRATION)
if(!strcmp($2, "CutMesh")){
if(!strcmp($2, "CutMesh")){
int t = (int)$4;
int t = (int)$4;
GModel *GM = GModel::current();
GModel *GM = GModel::current();
...
@@ -2927,7 +2895,7 @@ LevelSet :
...
@@ -2927,7 +2895,7 @@ LevelSet :
GM->setVisibility(0);
GM->setVisibility(0);
}
}
else
else
yymsg(0, "Unknown levelset
(
%d
)
", t);
yymsg(0, "Unknown levelset %d", t);
}
}
else if(!strcmp($2, "CutMeshTri")){
else if(!strcmp($2, "CutMeshTri")){
int t = (int)$4;
int t = (int)$4;
...
@@ -2937,7 +2905,7 @@ LevelSet :
...
@@ -2937,7 +2905,7 @@ LevelSet :
GM->setVisibility(0);
GM->setVisibility(0);
}
}
else
else
yymsg(0, "Unknown levelset
(
%d
)
", t);
yymsg(0, "Unknown levelset %d", t);
}
}
else if(!strcmp($2, "SplitMesh")){
else if(!strcmp($2, "SplitMesh")){
int t = (int)$4;
int t = (int)$4;
...
@@ -2947,12 +2915,11 @@ LevelSet :
...
@@ -2947,12 +2915,11 @@ LevelSet :
GM->setVisibility(0);
GM->setVisibility(0);
}
}
else
else
yymsg(0, "Unknown levelset
(
%d
)
", t);
yymsg(0, "Unknown levelset %d", t);
}
}
else
else
yymsg(0, "
Wrong
levelset
definition"
);
yymsg(0, "
Unknown
levelset
'%s'", $2
);
Free($2);
Free($2);
#endif
}
}
;
;
...
...
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