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
Analyze
Contributor 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
Gmsh
Gmsh
Commits
46d3643f
There was a problem fetching the pipeline summary.
Commit
46d3643f
authored
Nov 12, 2017
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
first OCC API functions
parent
4ed75883
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/gmsh.cpp
+229
-20
229 additions, 20 deletions
Common/gmsh.cpp
Common/gmsh.h
+83
-24
83 additions, 24 deletions
Common/gmsh.h
demos/api/CMakeLists.txt
+6
-8
6 additions, 8 deletions
demos/api/CMakeLists.txt
with
318 additions
and
52 deletions
Common/gmsh.cpp
+
229
−
20
View file @
46d3643f
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// See the LICENSE.txt file for license information. Please report all
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
// bugs and problems to the public mailing list <gmsh@onelab.info>.
#include
"gmsh.h"
#include
"GmshGlobal.h"
#include
"GmshGlobal.h"
#include
"GModel.h"
#include
"GModel.h"
#include
"GModelIO_GEO.h"
#include
"GModelIO_GEO.h"
...
@@ -140,7 +141,7 @@ int gmshModelDestroy()
...
@@ -140,7 +141,7 @@ int gmshModelDestroy()
return
1
;
return
1
;
}
}
int
gmshModelGetEntities
(
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
)
int
gmshModelGetEntities
(
vector
_pair
&
dimTags
)
{
{
std
::
vector
<
GEntity
*>
entities
;
std
::
vector
<
GEntity
*>
entities
;
GModel
::
current
()
->
getEntities
(
entities
);
GModel
::
current
()
->
getEntities
(
entities
);
...
@@ -149,7 +150,7 @@ int gmshModelGetEntities(std::vector<std::pair<int, int> > &dimTags)
...
@@ -149,7 +150,7 @@ int gmshModelGetEntities(std::vector<std::pair<int, int> > &dimTags)
return
0
;
return
0
;
}
}
int
gmshModelGetPhysicalGroups
(
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
)
int
gmshModelGetPhysicalGroups
(
vector
_pair
&
dimTags
)
{
{
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
GModel
::
current
()
->
getPhysicalGroups
(
groups
);
GModel
::
current
()
->
getPhysicalGroups
(
groups
);
...
@@ -209,8 +210,7 @@ int gmshModelGetVertexCoordinates(int tag, double &x, double &y, double &z)
...
@@ -209,8 +210,7 @@ int gmshModelGetVertexCoordinates(int tag, double &x, double &y, double &z)
return
1
;
return
1
;
}
}
int
gmshModelGetBoundary
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
int
gmshModelGetBoundary
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
bool
combined
,
bool
oriented
,
bool
recursive
)
bool
combined
,
bool
oriented
,
bool
recursive
)
{
{
bool
r
=
GModel
::
current
()
->
getBoundaryTags
(
inDimTags
,
outDimTags
,
combined
,
bool
r
=
GModel
::
current
()
->
getBoundaryTags
(
inDimTags
,
outDimTags
,
combined
,
...
@@ -248,8 +248,7 @@ int gmshModelGetBoundingBox(int dim, int tag, double &x1, double &y1, double &z1
...
@@ -248,8 +248,7 @@ int gmshModelGetBoundingBox(int dim, int tag, double &x1, double &y1, double &z1
return
0
;
return
0
;
}
}
int
gmshModelRemove
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
int
gmshModelRemove
(
const
vector_pair
&
dimTags
,
bool
recursive
)
bool
recursive
)
{
{
GModel
::
current
()
->
remove
(
dimTags
,
recursive
);
GModel
::
current
()
->
remove
(
dimTags
,
recursive
);
return
0
;
return
0
;
...
@@ -551,9 +550,9 @@ static ExtrudeParams *getExtrudeParams(const std::vector<int> &numElements,
...
@@ -551,9 +550,9 @@ static ExtrudeParams *getExtrudeParams(const std::vector<int> &numElements,
return
e
;
return
e
;
}
}
int
gmshModelGeoExtrude
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
int
gmshModelGeoExtrude
(
const
vector
_pair
&
inDimTags
,
double
dx
,
double
dy
,
double
dz
,
double
dx
,
double
dy
,
double
dz
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
vector
_pair
&
outDimTags
,
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
double
>
&
heights
,
bool
recombine
)
const
std
::
vector
<
double
>
&
heights
,
bool
recombine
)
{
{
...
@@ -562,10 +561,10 @@ int gmshModelGeoExtrude(const std::vector<std::pair<int, int> > &inDimTags,
...
@@ -562,10 +561,10 @@ int gmshModelGeoExtrude(const std::vector<std::pair<int, int> > &inDimTags,
getExtrudeParams
(
numElements
,
heights
,
recombine
));
getExtrudeParams
(
numElements
,
heights
,
recombine
));
}
}
int
gmshModelGeoRevolve
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
int
gmshModelGeoRevolve
(
const
vector
_pair
&
inDimTags
,
double
x
,
double
y
,
double
z
,
double
x
,
double
y
,
double
z
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
vector
_pair
&
outDimTags
,
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
double
>
&
heights
,
bool
recombine
)
const
std
::
vector
<
double
>
&
heights
,
bool
recombine
)
{
{
...
@@ -574,11 +573,11 @@ int gmshModelGeoRevolve(const std::vector<std::pair<int, int> > &inDimTags,
...
@@ -574,11 +573,11 @@ int gmshModelGeoRevolve(const std::vector<std::pair<int, int> > &inDimTags,
getExtrudeParams
(
numElements
,
heights
,
recombine
));
getExtrudeParams
(
numElements
,
heights
,
recombine
));
}
}
int
gmshModelGeoTwist
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
int
gmshModelGeoTwist
(
const
vector
_pair
&
inDimTags
,
double
x
,
double
y
,
double
z
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
dx
,
double
dy
,
double
dz
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
vector
_pair
&
outDimTags
,
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
double
>
&
heights
,
bool
recombine
)
const
std
::
vector
<
double
>
&
heights
,
bool
recombine
)
{
{
...
@@ -587,13 +586,13 @@ int gmshModelGeoTwist(const std::vector<std::pair<int, int> > &inDimTags,
...
@@ -587,13 +586,13 @@ int gmshModelGeoTwist(const std::vector<std::pair<int, int> > &inDimTags,
getExtrudeParams
(
numElements
,
heights
,
recombine
));
getExtrudeParams
(
numElements
,
heights
,
recombine
));
}
}
int
gmshModelGeoTranslate
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
int
gmshModelGeoTranslate
(
const
vector
_pair
&
dimTags
,
double
dx
,
double
dy
,
double
dz
)
double
dx
,
double
dy
,
double
dz
)
{
{
return
!
GModel
::
current
()
->
getGEOInternals
()
->
translate
(
dimTags
,
dx
,
dy
,
dz
);
return
!
GModel
::
current
()
->
getGEOInternals
()
->
translate
(
dimTags
,
dx
,
dy
,
dz
);
}
}
int
gmshModelGeoRotate
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
int
gmshModelGeoRotate
(
const
vector
_pair
&
dimTags
,
double
x
,
double
y
,
double
z
,
double
ax
,
double
ay
,
double
az
,
double
x
,
double
y
,
double
z
,
double
ax
,
double
ay
,
double
az
,
double
angle
)
double
angle
)
{
{
...
@@ -601,7 +600,7 @@ int gmshModelGeoRotate(const std::vector<std::pair<int, int> > &dimTags,
...
@@ -601,7 +600,7 @@ int gmshModelGeoRotate(const std::vector<std::pair<int, int> > &dimTags,
(
dimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
);
(
dimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
);
}
}
int
gmshModelGeoDilate
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
int
gmshModelGeoDilate
(
const
vector
_pair
&
dimTags
,
double
x
,
double
y
,
double
z
,
double
x
,
double
y
,
double
z
,
double
a
,
double
b
,
double
c
)
double
a
,
double
b
,
double
c
)
{
{
...
@@ -609,21 +608,19 @@ int gmshModelGeoDilate(const std::vector<std::pair<int, int> > &dimTags,
...
@@ -609,21 +608,19 @@ int gmshModelGeoDilate(const std::vector<std::pair<int, int> > &dimTags,
(
dimTags
,
x
,
y
,
z
,
a
,
b
,
c
);
(
dimTags
,
x
,
y
,
z
,
a
,
b
,
c
);
}
}
int
gmshModelGeoSymmetry
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
int
gmshModelGeoSymmetry
(
const
vector
_pair
&
dimTags
,
double
a
,
double
b
,
double
c
,
double
d
)
double
a
,
double
b
,
double
c
,
double
d
)
{
{
return
!
GModel
::
current
()
->
getGEOInternals
()
->
symmetry
return
!
GModel
::
current
()
->
getGEOInternals
()
->
symmetry
(
dimTags
,
a
,
b
,
c
,
d
);
(
dimTags
,
a
,
b
,
c
,
d
);
}
}
int
gmshModelGeoCopy
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
int
gmshModelGeoCopy
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
)
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
)
{
{
return
!
GModel
::
current
()
->
getGEOInternals
()
->
copy
(
inDimTags
,
outDimTags
);
return
!
GModel
::
current
()
->
getGEOInternals
()
->
copy
(
inDimTags
,
outDimTags
);
}
}
int
gmshModelGeoRemove
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
int
gmshModelGeoRemove
(
const
vector_pair
&
dimTags
,
bool
recursive
)
bool
recursive
)
{
{
return
!
GModel
::
current
()
->
getGEOInternals
()
->
remove
(
dimTags
,
recursive
);
return
!
GModel
::
current
()
->
getGEOInternals
()
->
remove
(
dimTags
,
recursive
);
}
}
...
@@ -653,6 +650,218 @@ int gmshModelOccAddVertex(int &tag, double x, double y, double z, double meshSiz
...
@@ -653,6 +650,218 @@ int gmshModelOccAddVertex(int &tag, double x, double y, double z, double meshSiz
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addVertex
(
tag
,
x
,
y
,
z
,
meshSize
);
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addVertex
(
tag
,
x
,
y
,
z
,
meshSize
);
}
}
int
gmshModelOccAddLine
(
int
&
tag
,
int
startTag
,
int
endTag
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addLine
(
tag
,
startTag
,
endTag
);
}
int
gmshModelOccAddCircleArc
(
int
&
tag
,
int
startTag
,
int
centerTag
,
int
endTag
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addCircleArc
(
tag
,
startTag
,
centerTag
,
endTag
);
}
int
gmshModelOccAddCircle
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
r
,
double
angle1
,
double
angle2
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addCircle
(
tag
,
x
,
y
,
z
,
r
,
angle1
,
angle2
);
}
int
gmshModelOccAddEllipseArc
(
int
&
tag
,
int
startTag
,
int
centerTag
,
int
endTag
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addEllipseArc
(
tag
,
startTag
,
centerTag
,
endTag
);
}
int
gmshModelOccAddEllipse
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
r1
,
double
r2
,
double
angle1
,
double
angle2
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addEllipse
(
tag
,
x
,
y
,
z
,
r1
,
r2
,
angle1
,
angle2
);
}
int
gmshModelOccAddSpline
(
int
&
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addSpline
(
tag
,
vertexTags
);
}
int
gmshModelOccAddBezier
(
int
&
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addBezier
(
tag
,
vertexTags
);
}
int
gmshModelOccAddBSpline
(
int
&
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addBSpline
(
tag
,
vertexTags
);
}
int
gmshModelOccAddWire
(
int
&
tag
,
const
std
::
vector
<
int
>
&
edgeTags
,
bool
checkClosed
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addWire
(
tag
,
edgeTags
,
checkClosed
);
}
int
gmshModelOccAddLineLoop
(
int
&
tag
,
const
std
::
vector
<
int
>
&
edgeTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addLineLoop
(
tag
,
edgeTags
);
}
int
gmshModelOccAddRectangle
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
roundedRadius
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addRectangle
(
tag
,
x
,
y
,
z
,
dx
,
dy
,
roundedRadius
);
}
int
gmshModelOccAddDisk
(
int
&
tag
,
double
xc
,
double
yc
,
double
zc
,
double
rx
,
double
ry
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addDisk
(
tag
,
xc
,
yc
,
zc
,
rx
,
ry
);
}
int
gmshModelOccAddPlaneSurface
(
int
&
tag
,
const
std
::
vector
<
int
>
&
wireTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addPlaneSurface
(
tag
,
wireTags
);
}
int
gmshModelOccAddSurfaceFilling
(
int
&
tag
,
int
wireTag
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addSurfaceFilling
(
tag
,
wireTag
);
}
int
gmshModelOccAddSurfaceLoop
(
int
&
tag
,
const
std
::
vector
<
int
>
&
faceTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addSurfaceLoop
(
tag
,
faceTags
);
}
int
gmshModelOccAddVolume
(
int
&
tag
,
const
std
::
vector
<
int
>
&
shellTags
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addVolume
(
tag
,
shellTags
);
}
int
gmshModelOccAddSphere
(
int
&
tag
,
double
xc
,
double
yc
,
double
zc
,
double
radius
,
double
angle1
,
double
angle2
,
double
angle3
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addSphere
(
tag
,
xc
,
yc
,
zc
,
radius
,
angle1
,
angle2
,
angle3
);
}
int
gmshModelOccAddBox
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addBox
(
tag
,
x
,
y
,
z
,
dx
,
dy
,
dz
);
}
int
gmshModelOccAddCylinder
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
r
,
double
angle
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addCylinder
(
tag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
r
,
angle
);
}
int
gmshModelOccAddCone
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
r1
,
double
r2
,
double
angle
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addCone
(
tag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
r1
,
r2
,
angle
);
}
int
gmshModelOccAddWedge
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
ltx
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addWedge
(
tag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
ltx
);
}
int
gmshModelOccAddTorus
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
r1
,
double
r2
,
double
angle
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
addTorus
(
tag
,
x
,
y
,
z
,
r1
,
r2
,
angle
);
}
int
gmshModelOccBooleanUnion
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
booleanUnion
(
tag
,
objectDimTags
,
toolDimTags
,
outDimTags
,
outDimTagsMap
,
removeObject
,
removeTool
);
}
int
gmshModelOccBooleanIntersection
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
booleanIntersection
(
tag
,
objectDimTags
,
toolDimTags
,
outDimTags
,
outDimTagsMap
,
removeObject
,
removeTool
);
}
int
gmshModelOccBooleanDifference
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
booleanDifference
(
tag
,
objectDimTags
,
toolDimTags
,
outDimTags
,
outDimTagsMap
,
removeObject
,
removeTool
);
}
int
gmshModelOccBooleanFragments
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
)
{
createOcc
();
return
!
GModel
::
current
()
->
getOCCInternals
()
->
booleanFragments
(
tag
,
objectDimTags
,
toolDimTags
,
outDimTags
,
outDimTagsMap
,
removeObject
,
removeTool
);
}
int
gmshModelOccSynchronize
()
int
gmshModelOccSynchronize
()
{
{
createOcc
();
createOcc
();
...
...
This diff is collapsed.
Click to expand it.
Common/gmsh.h
+
83
−
24
View file @
46d3643f
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
// All functions return 0 on successful completion.
// All functions return 0 on successful completion.
#include
<cmath>
#include
<vector>
#include
<vector>
#include
<string>
#include
<string>
...
@@ -28,6 +29,8 @@
...
@@ -28,6 +29,8 @@
#define GMSH_API int
#define GMSH_API int
#endif
#endif
typedef
std
::
vector
<
std
::
pair
<
int
,
int
>
>
vector_pair
;
// gmsh
// gmsh
GMSH_API
gmshInitialize
(
int
argc
=
0
,
char
**
argv
=
0
);
GMSH_API
gmshInitialize
(
int
argc
=
0
,
char
**
argv
=
0
);
GMSH_API
gmshFinalize
();
GMSH_API
gmshFinalize
();
...
@@ -46,16 +49,15 @@ GMSH_API gmshOptionGetString(const std::string &name, std::string &value);
...
@@ -46,16 +49,15 @@ GMSH_API gmshOptionGetString(const std::string &name, std::string &value);
GMSH_API
gmshModelCreate
(
const
std
::
string
&
name
);
GMSH_API
gmshModelCreate
(
const
std
::
string
&
name
);
GMSH_API
gmshModelSetCurrent
(
const
std
::
string
&
name
);
GMSH_API
gmshModelSetCurrent
(
const
std
::
string
&
name
);
GMSH_API
gmshModelDestroy
();
GMSH_API
gmshModelDestroy
();
GMSH_API
gmshModelGetEntities
(
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
);
GMSH_API
gmshModelGetEntities
(
vector
_pair
&
dimTags
);
GMSH_API
gmshModelGetPhysicalGroups
(
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
);
GMSH_API
gmshModelGetPhysicalGroups
(
vector
_pair
&
dimTags
);
GMSH_API
gmshModelAddPhysicalGroup
(
int
dim
,
int
tag
,
const
std
::
vector
<
int
>
&
tags
);
GMSH_API
gmshModelAddPhysicalGroup
(
int
dim
,
int
tag
,
const
std
::
vector
<
int
>
&
tags
);
GMSH_API
gmshModelGetEntitiesForPhysicalGroup
(
int
dim
,
int
tag
,
GMSH_API
gmshModelGetEntitiesForPhysicalGroup
(
int
dim
,
int
tag
,
std
::
vector
<
int
>
&
tags
);
std
::
vector
<
int
>
&
tags
);
GMSH_API
gmshModelSetPhysicalName
(
int
dim
,
int
tag
,
const
std
::
string
&
name
);
GMSH_API
gmshModelSetPhysicalName
(
int
dim
,
int
tag
,
const
std
::
string
&
name
);
GMSH_API
gmshModelGetPhysicalName
(
int
dim
,
int
tag
,
std
::
string
&
name
);
GMSH_API
gmshModelGetPhysicalName
(
int
dim
,
int
tag
,
std
::
string
&
name
);
GMSH_API
gmshModelGetVertexCoordinates
(
int
tag
,
double
&
x
,
double
&
y
,
double
&
z
);
GMSH_API
gmshModelGetVertexCoordinates
(
int
tag
,
double
&
x
,
double
&
y
,
double
&
z
);
GMSH_API
gmshModelGetBoundary
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
GMSH_API
gmshModelGetBoundary
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
bool
combined
=
true
,
bool
oriented
=
true
,
bool
combined
=
true
,
bool
oriented
=
true
,
bool
recursive
=
false
);
bool
recursive
=
false
);
GMSH_API
gmshModelGetEntitiesInBoundingBox
(
int
dim
,
double
x1
,
double
y1
,
double
z1
,
GMSH_API
gmshModelGetEntitiesInBoundingBox
(
int
dim
,
double
x1
,
double
y1
,
double
z1
,
...
@@ -63,8 +65,7 @@ GMSH_API gmshModelGetEntitiesInBoundingBox(int dim, double x1, double y1, double
...
@@ -63,8 +65,7 @@ GMSH_API gmshModelGetEntitiesInBoundingBox(int dim, double x1, double y1, double
std
::
vector
<
int
>
&
tags
);
std
::
vector
<
int
>
&
tags
);
GMSH_API
gmshModelGetBoundingBox
(
int
dim
,
int
tag
,
double
&
x1
,
double
&
y1
,
GMSH_API
gmshModelGetBoundingBox
(
int
dim
,
int
tag
,
double
&
x1
,
double
&
y1
,
double
&
z1
,
double
&
x2
,
double
&
y2
,
double
&
z2
);
double
&
z1
,
double
&
x2
,
double
&
y2
,
double
&
z2
);
GMSH_API
gmshModelRemove
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
GMSH_API
gmshModelRemove
(
const
vector_pair
&
dimTags
,
bool
recursive
=
false
);
bool
recursive
=
false
);
GMSH_API
gmshModelMesh
(
int
dim
);
GMSH_API
gmshModelMesh
(
int
dim
);
GMSH_API
gmshModelGetMeshVertices
(
int
dim
,
int
tag
,
std
::
vector
<
int
>
&
vertexTags
,
GMSH_API
gmshModelGetMeshVertices
(
int
dim
,
int
tag
,
std
::
vector
<
int
>
&
vertexTags
,
std
::
vector
<
double
>
&
coords
);
std
::
vector
<
double
>
&
coords
);
...
@@ -99,49 +100,107 @@ GMSH_API gmshModelGeoAddSurfaceFilling(int &tag, const std::vector<int> &wireTag
...
@@ -99,49 +100,107 @@ GMSH_API gmshModelGeoAddSurfaceFilling(int &tag, const std::vector<int> &wireTag
int
sphereCenterTag
=
-
1
);
int
sphereCenterTag
=
-
1
);
GMSH_API
gmshModelGeoAddSurfaceLoop
(
int
&
tag
,
const
std
::
vector
<
int
>
&
faceTags
);
GMSH_API
gmshModelGeoAddSurfaceLoop
(
int
&
tag
,
const
std
::
vector
<
int
>
&
faceTags
);
GMSH_API
gmshModelGeoAddVolume
(
int
&
tag
,
const
std
::
vector
<
int
>
&
shellTags
);
GMSH_API
gmshModelGeoAddVolume
(
int
&
tag
,
const
std
::
vector
<
int
>
&
shellTags
);
GMSH_API
gmshModelGeoExtrude
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
GMSH_API
gmshModelGeoExtrude
(
const
vector
_pair
&
inDimTags
,
double
dx
,
double
dy
,
double
dz
,
double
dx
,
double
dy
,
double
dz
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
vector
_pair
&
outDimTags
,
const
std
::
vector
<
int
>
&
numElements
=
std
::
vector
<
int
>
(),
const
std
::
vector
<
int
>
&
numElements
=
std
::
vector
<
int
>
(),
const
std
::
vector
<
double
>
&
heights
=
std
::
vector
<
double
>
(),
const
std
::
vector
<
double
>
&
heights
=
std
::
vector
<
double
>
(),
bool
recombine
=
false
);
bool
recombine
=
false
);
GMSH_API
gmshModelGeoRevolve
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
GMSH_API
gmshModelGeoRevolve
(
const
vector
_pair
&
inDimTags
,
double
x
,
double
y
,
double
z
,
double
x
,
double
y
,
double
z
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
vector
_pair
&
outDimTags
,
const
std
::
vector
<
int
>
&
numElements
=
std
::
vector
<
int
>
(),
const
std
::
vector
<
int
>
&
numElements
=
std
::
vector
<
int
>
(),
const
std
::
vector
<
double
>
&
heights
=
std
::
vector
<
double
>
(),
const
std
::
vector
<
double
>
&
heights
=
std
::
vector
<
double
>
(),
bool
recombine
=
false
);
bool
recombine
=
false
);
GMSH_API
gmshModelGeoTwist
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
GMSH_API
gmshModelGeoTwist
(
const
vector
_pair
&
inDimTags
,
double
x
,
double
y
,
double
z
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
dx
,
double
dy
,
double
dz
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
double
ax
,
double
ay
,
double
az
,
double
angle
,
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
,
vector
_pair
&
outDimTags
,
const
std
::
vector
<
int
>
&
numElements
=
std
::
vector
<
int
>
(),
const
std
::
vector
<
int
>
&
numElements
=
std
::
vector
<
int
>
(),
const
std
::
vector
<
double
>
&
heights
=
std
::
vector
<
double
>
(),
const
std
::
vector
<
double
>
&
heights
=
std
::
vector
<
double
>
(),
bool
recombine
=
false
);
bool
recombine
=
false
);
GMSH_API
gmshModelGeoTranslate
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
GMSH_API
gmshModelGeoTranslate
(
const
vector
_pair
&
dimTags
,
double
dx
,
double
dy
,
double
dz
);
double
dx
,
double
dy
,
double
dz
);
GMSH_API
gmshModelGeoRotate
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
GMSH_API
gmshModelGeoRotate
(
const
vector_pair
&
dimTags
,
double
x
,
double
y
,
double
z
,
double
x
,
double
y
,
double
z
,
double
ax
,
double
ay
,
double
ax
,
double
ay
,
double
az
,
double
angle
);
double
az
,
double
angle
);
GMSH_API
gmshModelGeoDilate
(
const
vector_pair
&
dimTags
,
double
x
,
double
y
,
double
z
,
GMSH_API
gmshModelGeoDilate
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
double
x
,
double
y
,
double
z
,
double
a
,
double
b
,
double
c
);
double
a
,
double
b
,
double
c
);
GMSH_API
gmshModelGeoSymmetry
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
GMSH_API
gmshModelGeoSymmetry
(
const
vector_pair
&
dimTags
,
double
a
,
double
b
,
double
a
,
double
b
,
double
c
,
double
d
);
double
c
,
double
d
);
GMSH_API
gmshModelGeoCopy
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
inDimTags
,
GMSH_API
gmshModelGeoCopy
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
);
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
outDimTags
);
GMSH_API
gmshModelGeoRemove
(
const
vector_pair
&
dimTags
,
bool
recursive
=
false
);
GMSH_API
gmshModelGeoRemove
(
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>
&
dimTags
,
bool
recursive
=
false
);
GMSH_API
gmshModelGeoRemoveAllDuplicates
();
GMSH_API
gmshModelGeoRemoveAllDuplicates
();
GMSH_API
gmshModelGeoSynchronize
();
GMSH_API
gmshModelGeoSynchronize
();
// gmshModelOcc
// gmshModelOcc
GMSH_API
gmshModelOccAddVertex
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
GMSH_API
gmshModelOccAddVertex
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
meshSize
);
double
meshSize
);
GMSH_API
gmshModelOccAddLine
(
int
&
tag
,
int
startTag
,
int
endTag
);
GMSH_API
gmshModelOccAddCircleArc
(
int
&
tag
,
int
startTag
,
int
centerTag
,
int
endTag
);
GMSH_API
gmshModelOccAddCircle
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
r
,
double
angle1
,
double
angle2
);
GMSH_API
gmshModelOccAddEllipseArc
(
int
&
tag
,
int
startTag
,
int
centerTag
,
int
endTag
);
GMSH_API
gmshModelOccAddEllipse
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
r1
,
double
r2
,
double
angle1
,
double
angle2
);
GMSH_API
gmshModelOccAddSpline
(
int
&
tag
,
const
std
::
vector
<
int
>
&
vertexTags
);
GMSH_API
gmshModelOccAddBezier
(
int
&
tag
,
const
std
::
vector
<
int
>
&
vertexTags
);
GMSH_API
gmshModelOccAddBSpline
(
int
&
tag
,
const
std
::
vector
<
int
>
&
vertexTags
);
GMSH_API
gmshModelOccAddWire
(
int
&
tag
,
const
std
::
vector
<
int
>
&
edgeTags
,
bool
checkClosed
=
false
);
GMSH_API
gmshModelOccAddLineLoop
(
int
&
tag
,
const
std
::
vector
<
int
>
&
edgeTags
);
GMSH_API
gmshModelOccAddRectangle
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
roundedRadius
=
0
.);
GMSH_API
gmshModelOccAddDisk
(
int
&
tag
,
double
xc
,
double
yc
,
double
zc
,
double
rx
,
double
ry
);
GMSH_API
gmshModelOccAddPlaneSurface
(
int
&
tag
,
const
std
::
vector
<
int
>
&
wireTags
);
GMSH_API
gmshModelOccAddSurfaceFilling
(
int
&
tag
,
int
wireTag
);
GMSH_API
gmshModelOccAddSurfaceLoop
(
int
&
tag
,
const
std
::
vector
<
int
>
&
faceTags
);
GMSH_API
gmshModelOccAddVolume
(
int
&
tag
,
const
std
::
vector
<
int
>
&
shellTags
);
GMSH_API
gmshModelOccAddSphere
(
int
&
tag
,
double
xc
,
double
yc
,
double
zc
,
double
radius
,
double
angle1
=
-
M_PI
/
2
,
double
angle2
=
M_PI
/
2
,
double
angle3
=
2
*
M_PI
);
GMSH_API
gmshModelOccAddBox
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
);
GMSH_API
gmshModelOccAddCylinder
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
r
,
double
angle
=
2
*
M_PI
);
GMSH_API
gmshModelOccAddCone
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
r1
,
double
r2
,
double
angle
=
2
*
M_PI
);
GMSH_API
gmshModelOccAddWedge
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
dx
,
double
dy
,
double
dz
,
double
ltx
=
0
.);
GMSH_API
gmshModelOccAddTorus
(
int
&
tag
,
double
x
,
double
y
,
double
z
,
double
r1
,
double
r2
,
double
angle
=
2
*
M_PI
);
GMSH_API
gmshModelOccBooleanUnion
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
);
GMSH_API
gmshModelOccBooleanIntersection
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
);
GMSH_API
gmshModelOccBooleanDifference
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
);
GMSH_API
gmshModelOccBooleanFragments
(
int
tag
,
const
vector_pair
&
objectDimTags
,
const
vector_pair
&
toolDimTags
,
vector_pair
&
outDimTags
,
std
::
vector
<
vector_pair
>
&
outDimTagsMap
,
bool
removeObject
,
bool
removeTool
);
GMSH_API
gmshModelOccSynchronize
();
GMSH_API
gmshModelOccSynchronize
();
// gmshField
// gmshSolver
// gmshSolver
// gmshPost
// gmshPost
...
...
This diff is collapsed.
Click to expand it.
demos/api/CMakeLists.txt
+
6
−
8
View file @
46d3643f
...
@@ -22,11 +22,9 @@ endif(GMSH_LIB MATCHES ".a")
...
@@ -22,11 +22,9 @@ endif(GMSH_LIB MATCHES ".a")
include_directories
(
${
GMSH_INC
}
)
include_directories
(
${
GMSH_INC
}
)
add_executable
(
basic basic.cpp
)
file
(
GLOB FILES *.cpp
)
target_link_libraries
(
basic
${
GMSH_LIB
}
${
LAPACK_LIB
}
${
BLAS_LIB
}
)
foreach
(
FILE
${
FILES
}
)
get_filename_component
(
DEMO
${
FILE
}
NAME_WE
)
add_executable
(
basic2 basic2.cpp
)
add_executable
(
${
DEMO
}
${
FILE
}
)
target_link_libraries
(
basic2
${
GMSH_LIB
}
${
LAPACK_LIB
}
${
BLAS_LIB
}
)
target_link_libraries
(
${
DEMO
}
${
GMSH_LIB
}
${
LAPACK_LIB
}
${
BLAS_LIB
}
)
endforeach
(
FILE
)
add_executable
(
t1 t1.cpp
)
target_link_libraries
(
t1
${
GMSH_LIB
}
${
LAPACK_LIB
}
${
BLAS_LIB
}
)
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