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
11b713e3
Commit
11b713e3
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
refactoring
parent
6c95b220
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Geo/GModelIO_GEO.cpp
+16
-23
16 additions, 23 deletions
Geo/GModelIO_GEO.cpp
Geo/GModelIO_GEO.h
+9
-8
9 additions, 8 deletions
Geo/GModelIO_GEO.h
Geo/Geo.h
+15
-0
15 additions, 0 deletions
Geo/Geo.h
Parser/Gmsh.tab.cpp
+477
-479
477 additions, 479 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+4
-6
4 additions, 6 deletions
Parser/Gmsh.y
with
521 additions
and
516 deletions
Geo/GModelIO_GEO.cpp
+
16
−
23
View file @
11b713e3
...
@@ -27,27 +27,7 @@
...
@@ -27,27 +27,7 @@
#include
"Parser.h"
#include
"Parser.h"
#endif
#endif
// GEO_Internals routines
void
GEO_Internals
::
_allocateAll
()
int
compareVertex
(
const
void
*
a
,
const
void
*
b
);
int
compareSurfaceLoop
(
const
void
*
a
,
const
void
*
b
);
int
compareEdgeLoop
(
const
void
*
a
,
const
void
*
b
);
int
compareCurve
(
const
void
*
a
,
const
void
*
b
);
int
compareSurface
(
const
void
*
a
,
const
void
*
b
);
int
compareVolume
(
const
void
*
a
,
const
void
*
b
);
int
compareLevelSet
(
const
void
*
a
,
const
void
*
b
);
int
comparePhysicalGroup
(
const
void
*
a
,
const
void
*
b
);
void
Free_Vertex
(
void
*
a
,
void
*
b
);
void
Free_PhysicalGroup
(
void
*
a
,
void
*
b
);
void
Free_EdgeLoop
(
void
*
a
,
void
*
b
);
void
Free_SurfaceLoop
(
void
*
a
,
void
*
b
);
void
Free_Curve
(
void
*
a
,
void
*
b
);
void
Free_Surface
(
void
*
a
,
void
*
b
);
void
Free_Volume
(
void
*
a
,
void
*
b
);
void
Free_LevelSet
(
void
*
a
,
void
*
b
);
void
GEO_Internals
::
alloc_all
()
{
{
MaxPointNum
=
MaxLineNum
=
MaxLineLoopNum
=
MaxSurfaceNum
=
0
;
MaxPointNum
=
MaxLineNum
=
MaxLineLoopNum
=
MaxSurfaceNum
=
0
;
MaxSurfaceLoopNum
=
MaxVolumeNum
=
MaxPhysicalNum
=
0
;
MaxSurfaceLoopNum
=
MaxVolumeNum
=
MaxPhysicalNum
=
0
;
...
@@ -61,7 +41,7 @@ void GEO_Internals::alloc_all()
...
@@ -61,7 +41,7 @@ void GEO_Internals::alloc_all()
PhysicalGroups
=
List_Create
(
5
,
5
,
sizeof
(
PhysicalGroup
*
));
PhysicalGroups
=
List_Create
(
5
,
5
,
sizeof
(
PhysicalGroup
*
));
}
}
void
GEO_Internals
::
free
_a
ll
()
void
GEO_Internals
::
_
free
A
ll
()
{
{
MaxPointNum
=
MaxLineNum
=
MaxLineLoopNum
=
MaxSurfaceNum
=
0
;
MaxPointNum
=
MaxLineNum
=
MaxLineLoopNum
=
MaxSurfaceNum
=
0
;
MaxSurfaceLoopNum
=
MaxVolumeNum
=
MaxPhysicalNum
=
0
;
MaxSurfaceLoopNum
=
MaxVolumeNum
=
MaxPhysicalNum
=
0
;
...
@@ -75,12 +55,25 @@ void GEO_Internals::free_all()
...
@@ -75,12 +55,25 @@ void GEO_Internals::free_all()
List_Action
(
PhysicalGroups
,
Free_PhysicalGroup
);
List_Delete
(
PhysicalGroups
);
List_Action
(
PhysicalGroups
,
Free_PhysicalGroup
);
List_Delete
(
PhysicalGroups
);
}
}
void
GEO_Internals
::
reset
_p
hysicals
()
void
GEO_Internals
::
reset
P
hysical
Group
s
()
{
{
List_Action
(
PhysicalGroups
,
Free_PhysicalGroup
);
List_Action
(
PhysicalGroups
,
Free_PhysicalGroup
);
List_Reset
(
PhysicalGroups
);
List_Reset
(
PhysicalGroups
);
}
}
void
GEO_Internals
::
addVertex
(
int
num
,
double
x
,
double
y
,
double
z
,
double
lc
)
{
Vertex
*
v
=
Create_Vertex
(
num
,
x
,
y
,
z
,
lc
,
1.0
);
Tree_Add
(
Points
,
&
v
);
}
void
GEO_Internals
::
addVertex
(
int
num
,
double
x
,
double
y
,
gmshSurface
*
surface
,
double
lc
)
{
Vertex
*
v
=
Create_Vertex
(
num
,
x
,
y
,
surface
,
lc
);
Tree_Add
(
Points
,
&
v
);
}
// GModel interface
// GModel interface
void
GModel
::
_createGEOInternals
()
void
GModel
::
_createGEOInternals
()
...
...
This diff is collapsed.
Click to expand it.
Geo/GModelIO_GEO.h
+
9
−
8
View file @
11b713e3
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
class
GEO_Internals
{
class
GEO_Internals
{
private:
private:
void
alloc
_
all
();
void
_
alloca
teA
ll
();
void
free
_a
ll
();
void
_
free
A
ll
();
public:
public:
// FIXME: all this must (will) become private ; and all the direct calls in
// FIXME: all this must (will) become private ; and all the direct calls in
// Gmsh.y should (will) go through an integer-based API similar to the one in
// Gmsh.y should (will) go through an integer-based API similar to the one in
...
@@ -45,18 +45,19 @@ class GEO_Internals{
...
@@ -45,18 +45,19 @@ class GEO_Internals{
std
::
map
<
int
,
MasterFace
>
periodicFaces
;
std
::
map
<
int
,
MasterFace
>
periodicFaces
;
public
:
public
:
GEO_Internals
(){
alloc
_
all
();
}
GEO_Internals
(){
_
alloca
teA
ll
();
}
~
GEO_Internals
(){
free
_a
ll
();
}
~
GEO_Internals
(){
_
free
A
ll
();
}
void
destroy
(){
free
_a
ll
();
alloc
_
all
();
}
void
destroy
(){
_
free
A
ll
();
_
alloca
teA
ll
();
}
void
reset
_p
hysicals
();
void
reset
P
hysical
Group
s
();
void
addCompoundMesh
(
int
dim
,
List_T
*
_list
)
void
addCompoundMesh
(
int
dim
,
List_T
*
_list
)
{
{
std
::
vector
<
int
>
compound
;
std
::
vector
<
int
>
compound
;
for
(
int
i
=
0
;
i
<
List_Nbr
(
_list
);
i
++
)
for
(
int
i
=
0
;
i
<
List_Nbr
(
_list
);
i
++
)
compound
.
push_back
((
int
)
*
(
double
*
)
List_Pointer
(
_list
,
i
));
compound
.
push_back
((
int
)
*
(
double
*
)
List_Pointer
(
_list
,
i
));
meshCompounds
.
insert
(
std
::
make_pair
(
dim
,
compound
));
meshCompounds
.
insert
(
std
::
make_pair
(
dim
,
compound
));
}
}
void
addVertex
(
int
num
,
double
x
,
double
y
,
double
z
,
double
lc
);
void
addVertex
(
int
num
,
double
x
,
double
y
,
gmshSurface
*
s
,
double
lc
);
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
Geo/Geo.h
+
15
−
0
View file @
11b713e3
...
@@ -306,7 +306,22 @@ int NEWFIELD(void);
...
@@ -306,7 +306,22 @@ int NEWFIELD(void);
int
NEWPHYSICAL
(
void
);
int
NEWPHYSICAL
(
void
);
int
compareVertex
(
const
void
*
a
,
const
void
*
b
);
int
compareVertex
(
const
void
*
a
,
const
void
*
b
);
int
compareSurfaceLoop
(
const
void
*
a
,
const
void
*
b
);
int
compareEdgeLoop
(
const
void
*
a
,
const
void
*
b
);
int
compareCurve
(
const
void
*
a
,
const
void
*
b
);
int
compareCurve
(
const
void
*
a
,
const
void
*
b
);
int
compareSurface
(
const
void
*
a
,
const
void
*
b
);
int
compareVolume
(
const
void
*
a
,
const
void
*
b
);
int
compareLevelSet
(
const
void
*
a
,
const
void
*
b
);
int
comparePhysicalGroup
(
const
void
*
a
,
const
void
*
b
);
void
Free_Vertex
(
void
*
a
,
void
*
b
);
void
Free_PhysicalGroup
(
void
*
a
,
void
*
b
);
void
Free_EdgeLoop
(
void
*
a
,
void
*
b
);
void
Free_SurfaceLoop
(
void
*
a
,
void
*
b
);
void
Free_Curve
(
void
*
a
,
void
*
b
);
void
Free_Surface
(
void
*
a
,
void
*
b
);
void
Free_Volume
(
void
*
a
,
void
*
b
);
void
Free_LevelSet
(
void
*
a
,
void
*
b
);
void
Projette
(
Vertex
*
v
,
double
mat
[
3
][
3
]);
void
Projette
(
Vertex
*
v
,
double
mat
[
3
][
3
]);
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.tab.cpp
+
477
−
479
View file @
11b713e3
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
4
−
6
View file @
11b713e3
...
@@ -1736,17 +1736,15 @@ Shape :
...
@@ -1736,17 +1736,15 @@ Shape :
double y = CTX::instance()->geom.scalingFactor * $6[1];
double y = CTX::instance()->geom.scalingFactor * $6[1];
double z = CTX::instance()->geom.scalingFactor * $6[2];
double z = CTX::instance()->geom.scalingFactor * $6[2];
double lc = CTX::instance()->geom.scalingFactor * $6[3];
double lc = CTX::instance()->geom.scalingFactor * $6[3];
if(lc == 0.) lc = MAX_LC; // no mesh size given at the point
if(factory == "OpenCASCADE" && GModel::current()->getOCCInternals()){
if(factory == "OpenCASCADE" && GModel::current()->getOCCInternals()){
GModel::current()->getOCCInternals()->addVertex(num, x, y, z, lc);
GModel::current()->getOCCInternals()->addVertex(num, x, y, z, lc);
}
}
else{
else{
if(lc == 0.) lc = MAX_LC; // no mesh size given at the point
Vertex *v;
if(!myGmshSurface)
if(!myGmshSurface)
v = Create_
Vertex(num, x, y, z, lc
, 1.0
);
GModel::current()->getGEOInternals()->add
Vertex(num, x, y, z, lc);
else
else
v = Create_Vertex(num, x, y, myGmshSurface, lc);
GModel::current()->getGEOInternals()->addVertex(num, x, y, myGmshSurface, lc);
Tree_Add(GModel::current()->getGEOInternals()->Points, &v);
}
}
AddToTemporaryBoundingBox(x, y, z);
AddToTemporaryBoundingBox(x, y, z);
}
}
...
@@ -3667,7 +3665,7 @@ Delete :
...
@@ -3667,7 +3665,7 @@ Delete :
GModel::current()->getGEOInternals()->destroy();
GModel::current()->getGEOInternals()->destroy();
}
}
else if(!strcmp($2, "Physicals")){
else if(!strcmp($2, "Physicals")){
GModel::current()->getGEOInternals()->reset
_p
hysicals();
GModel::current()->getGEOInternals()->reset
P
hysical
Group
s();
GModel::current()->deletePhysicalGroups();
GModel::current()->deletePhysicalGroups();
}
}
else if(!strcmp($2, "Variables")){
else if(!strcmp($2, "Variables")){
...
...
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