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
Package registry
Model registry
Operate
Terraform modules
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
Romin Tomasetti
gmsh
Commits
93d7a46d
Commit
93d7a46d
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp
parent
d7a5a82b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/gmsh.cpp
+204
-203
204 additions, 203 deletions
Common/gmsh.cpp
Common/gmsh.h
+2
-2
2 additions, 2 deletions
Common/gmsh.h
with
206 additions
and
205 deletions
Common/gmsh.cpp
+
204
−
203
View file @
93d7a46d
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
static
int
_initialized
=
0
;
static
int
_initialized
=
0
;
static
bool
isInitialized
()
static
bool
_
isInitialized
()
{
{
if
(
!
_initialized
){
if
(
!
_initialized
){
// make sure stuff gets printed out
// make sure stuff gets printed out
...
@@ -62,7 +62,7 @@ GMSH_API gmshInitialize(int argc, char **argv)
...
@@ -62,7 +62,7 @@ GMSH_API gmshInitialize(int argc, char **argv)
GMSH_API
gmshFinalize
()
GMSH_API
gmshFinalize
()
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GmshFinalize
()){
if
(
GmshFinalize
()){
_initialized
=
0
;
_initialized
=
0
;
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -73,7 +73,7 @@ GMSH_API gmshFinalize()
...
@@ -73,7 +73,7 @@ GMSH_API gmshFinalize()
GMSH_API
gmshOpen
(
const
std
::
string
&
fileName
)
GMSH_API
gmshOpen
(
const
std
::
string
&
fileName
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GmshOpenProject
(
fileName
))
if
(
GmshOpenProject
(
fileName
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -81,7 +81,7 @@ GMSH_API gmshOpen(const std::string &fileName)
...
@@ -81,7 +81,7 @@ GMSH_API gmshOpen(const std::string &fileName)
GMSH_API
gmshMerge
(
const
std
::
string
&
fileName
)
GMSH_API
gmshMerge
(
const
std
::
string
&
fileName
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GmshMergeFile
(
fileName
))
if
(
GmshMergeFile
(
fileName
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -89,7 +89,7 @@ GMSH_API gmshMerge(const std::string &fileName)
...
@@ -89,7 +89,7 @@ GMSH_API gmshMerge(const std::string &fileName)
GMSH_API
gmshExport
(
const
std
::
string
&
fileName
)
GMSH_API
gmshExport
(
const
std
::
string
&
fileName
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GmshWriteFile
(
fileName
))
if
(
GmshWriteFile
(
fileName
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -97,7 +97,7 @@ GMSH_API gmshExport(const std::string &fileName)
...
@@ -97,7 +97,7 @@ GMSH_API gmshExport(const std::string &fileName)
GMSH_API
gmshClear
()
GMSH_API
gmshClear
()
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GmshClearProject
())
if
(
GmshClearProject
())
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -105,7 +105,7 @@ GMSH_API gmshClear()
...
@@ -105,7 +105,7 @@ GMSH_API gmshClear()
// gmshOption
// gmshOption
static
void
splitOptionName
(
const
std
::
string
&
fullName
,
std
::
string
&
category
,
static
void
_
splitOptionName
(
const
std
::
string
&
fullName
,
std
::
string
&
category
,
std
::
string
&
name
,
int
&
index
)
std
::
string
&
name
,
int
&
index
)
{
{
std
::
string
::
size_type
d
=
fullName
.
find_first_of
(
'.'
);
std
::
string
::
size_type
d
=
fullName
.
find_first_of
(
'.'
);
...
@@ -132,10 +132,10 @@ static void splitOptionName(const std::string &fullName, std::string &category,
...
@@ -132,10 +132,10 @@ static void splitOptionName(const std::string &fullName, std::string &category,
GMSH_API
gmshOptionSetNumber
(
const
std
::
string
&
name
,
const
double
value
)
GMSH_API
gmshOptionSetNumber
(
const
std
::
string
&
name
,
const
double
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
std
::
string
c
,
n
;
std
::
string
c
,
n
;
int
i
;
int
i
;
splitOptionName
(
name
,
c
,
n
,
i
);
_
splitOptionName
(
name
,
c
,
n
,
i
);
if
(
GmshSetOption
(
c
,
n
,
value
,
i
))
if
(
GmshSetOption
(
c
,
n
,
value
,
i
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -143,10 +143,10 @@ GMSH_API gmshOptionSetNumber(const std::string &name, const double value)
...
@@ -143,10 +143,10 @@ GMSH_API gmshOptionSetNumber(const std::string &name, const double value)
GMSH_API
gmshOptionGetNumber
(
const
std
::
string
&
name
,
double
&
value
)
GMSH_API
gmshOptionGetNumber
(
const
std
::
string
&
name
,
double
&
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
std
::
string
c
,
n
;
std
::
string
c
,
n
;
int
i
;
int
i
;
splitOptionName
(
name
,
c
,
n
,
i
);
_
splitOptionName
(
name
,
c
,
n
,
i
);
if
(
GmshGetOption
(
c
,
n
,
value
,
i
))
if
(
GmshGetOption
(
c
,
n
,
value
,
i
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -154,10 +154,10 @@ GMSH_API gmshOptionGetNumber(const std::string &name, double &value)
...
@@ -154,10 +154,10 @@ GMSH_API gmshOptionGetNumber(const std::string &name, double &value)
GMSH_API
gmshOptionSetString
(
const
std
::
string
&
name
,
const
std
::
string
&
value
)
GMSH_API
gmshOptionSetString
(
const
std
::
string
&
name
,
const
std
::
string
&
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
std
::
string
c
,
n
;
std
::
string
c
,
n
;
int
i
;
int
i
;
splitOptionName
(
name
,
c
,
n
,
i
);
_
splitOptionName
(
name
,
c
,
n
,
i
);
if
(
GmshSetOption
(
c
,
n
,
value
,
i
))
if
(
GmshSetOption
(
c
,
n
,
value
,
i
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -165,10 +165,10 @@ GMSH_API gmshOptionSetString(const std::string &name, const std::string &value)
...
@@ -165,10 +165,10 @@ GMSH_API gmshOptionSetString(const std::string &name, const std::string &value)
GMSH_API
gmshOptionGetString
(
const
std
::
string
&
name
,
std
::
string
&
value
)
GMSH_API
gmshOptionGetString
(
const
std
::
string
&
name
,
std
::
string
&
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
std
::
string
c
,
n
;
std
::
string
c
,
n
;
int
i
;
int
i
;
splitOptionName
(
name
,
c
,
n
,
i
);
_
splitOptionName
(
name
,
c
,
n
,
i
);
if
(
GmshGetOption
(
c
,
n
,
value
,
i
))
if
(
GmshGetOption
(
c
,
n
,
value
,
i
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -178,30 +178,30 @@ GMSH_API gmshOptionGetString(const std::string &name, std::string &value)
...
@@ -178,30 +178,30 @@ GMSH_API gmshOptionGetString(const std::string &name, std::string &value)
GMSH_API
gmshModelCreate
(
const
std
::
string
&
name
)
GMSH_API
gmshModelCreate
(
const
std
::
string
&
name
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
*
m
=
new
GModel
(
name
);
GModel
*
m
=
new
GModel
(
name
);
if
(
m
)
if
(
m
)
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
GMSH_API
gmshModel
SetCurrent
(
const
std
::
string
&
name
)
GMSH_API
gmshModel
Delete
(
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
*
m
=
GModel
::
findByName
(
name
);
GModel
*
m
=
GModel
::
current
(
);
if
(
m
){
if
(
m
){
GModel
::
setCurrent
(
m
)
;
delete
m
;
return
GMSH_OK
;
return
GMSH_OK
;
}
}
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
GMSH_API
gmshModel
Destroy
(
)
GMSH_API
gmshModel
SetCurrent
(
const
std
::
string
&
name
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
*
m
=
GModel
::
current
(
);
GModel
*
m
=
GModel
::
findByName
(
name
);
if
(
m
){
if
(
m
){
delete
m
;
GModel
::
setCurrent
(
m
)
;
return
GMSH_OK
;
return
GMSH_OK
;
}
}
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -209,7 +209,7 @@ GMSH_API gmshModelDestroy()
...
@@ -209,7 +209,7 @@ GMSH_API gmshModelDestroy()
GMSH_API
gmshModelGetEntities
(
vector_pair
&
dimTags
,
const
int
dim
)
GMSH_API
gmshModelGetEntities
(
vector_pair
&
dimTags
,
const
int
dim
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
dimTags
.
clear
();
dimTags
.
clear
();
std
::
vector
<
GEntity
*>
entities
;
std
::
vector
<
GEntity
*>
entities
;
GModel
::
current
()
->
getEntities
(
entities
,
dim
);
GModel
::
current
()
->
getEntities
(
entities
,
dim
);
...
@@ -220,7 +220,7 @@ GMSH_API gmshModelGetEntities(vector_pair &dimTags, const int dim)
...
@@ -220,7 +220,7 @@ GMSH_API gmshModelGetEntities(vector_pair &dimTags, const int dim)
GMSH_API
gmshModelGetPhysicalGroups
(
vector_pair
&
dimTags
,
const
int
dim
)
GMSH_API
gmshModelGetPhysicalGroups
(
vector_pair
&
dimTags
,
const
int
dim
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
dimTags
.
clear
();
dimTags
.
clear
();
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
GModel
::
current
()
->
getPhysicalGroups
(
groups
);
GModel
::
current
()
->
getPhysicalGroups
(
groups
);
...
@@ -237,7 +237,7 @@ GMSH_API gmshModelGetPhysicalGroups(vector_pair &dimTags, const int dim)
...
@@ -237,7 +237,7 @@ GMSH_API gmshModelGetPhysicalGroups(vector_pair &dimTags, const int dim)
GMSH_API
gmshModelAddPhysicalGroup
(
const
int
dim
,
const
int
tag
,
GMSH_API
gmshModelAddPhysicalGroup
(
const
int
dim
,
const
int
tag
,
const
std
::
vector
<
int
>
&
tags
)
const
std
::
vector
<
int
>
&
tags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
bool
r
=
GModel
::
current
()
->
getGEOInternals
()
->
modifyPhysicalGroup
bool
r
=
GModel
::
current
()
->
getGEOInternals
()
->
modifyPhysicalGroup
(
dim
,
tag
,
0
,
tags
);
(
dim
,
tag
,
0
,
tags
);
if
(
r
){
if
(
r
){
...
@@ -250,7 +250,7 @@ GMSH_API gmshModelAddPhysicalGroup(const int dim, const int tag,
...
@@ -250,7 +250,7 @@ GMSH_API gmshModelAddPhysicalGroup(const int dim, const int tag,
GMSH_API
gmshModelGetEntitiesForPhysicalGroup
(
const
int
dim
,
const
int
tag
,
GMSH_API
gmshModelGetEntitiesForPhysicalGroup
(
const
int
dim
,
const
int
tag
,
std
::
vector
<
int
>
&
tags
)
std
::
vector
<
int
>
&
tags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
tags
.
clear
();
tags
.
clear
();
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
;
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
;
GModel
::
current
()
->
getPhysicalGroups
(
dim
,
groups
);
GModel
::
current
()
->
getPhysicalGroups
(
dim
,
groups
);
...
@@ -265,7 +265,7 @@ GMSH_API gmshModelGetEntitiesForPhysicalGroup(const int dim, const int tag,
...
@@ -265,7 +265,7 @@ GMSH_API gmshModelGetEntitiesForPhysicalGroup(const int dim, const int tag,
GMSH_API
gmshModelSetPhysicalName
(
const
int
dim
,
const
int
tag
,
GMSH_API
gmshModelSetPhysicalName
(
const
int
dim
,
const
int
tag
,
const
std
::
string
&
name
)
const
std
::
string
&
name
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
setPhysicalName
(
name
,
dim
,
tag
);
GModel
::
current
()
->
setPhysicalName
(
name
,
dim
,
tag
);
return
GMSH_OK
;
return
GMSH_OK
;
}
}
...
@@ -273,7 +273,7 @@ GMSH_API gmshModelSetPhysicalName(const int dim, const int tag,
...
@@ -273,7 +273,7 @@ GMSH_API gmshModelSetPhysicalName(const int dim, const int tag,
GMSH_API
gmshModelGetPhysicalName
(
const
int
dim
,
const
int
tag
,
GMSH_API
gmshModelGetPhysicalName
(
const
int
dim
,
const
int
tag
,
std
::
string
&
name
)
std
::
string
&
name
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
name
=
GModel
::
current
()
->
getPhysicalName
(
dim
,
tag
);
name
=
GModel
::
current
()
->
getPhysicalName
(
dim
,
tag
);
return
GMSH_OK
;
return
GMSH_OK
;
}
}
...
@@ -281,7 +281,7 @@ GMSH_API gmshModelGetPhysicalName(const int dim, const int tag,
...
@@ -281,7 +281,7 @@ GMSH_API gmshModelGetPhysicalName(const int dim, const int tag,
GMSH_API
gmshModelGetVertexCoordinates
(
const
int
tag
,
double
&
x
,
double
&
y
,
GMSH_API
gmshModelGetVertexCoordinates
(
const
int
tag
,
double
&
x
,
double
&
y
,
double
&
z
)
double
&
z
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GVertex
*
gv
=
GModel
::
current
()
->
getVertexByTag
(
tag
);
GVertex
*
gv
=
GModel
::
current
()
->
getVertexByTag
(
tag
);
if
(
gv
){
if
(
gv
){
x
=
gv
->
x
();
x
=
gv
->
x
();
...
@@ -296,7 +296,7 @@ GMSH_API gmshModelGetBoundary(const vector_pair &inDimTags, vector_pair &outDimT
...
@@ -296,7 +296,7 @@ GMSH_API gmshModelGetBoundary(const vector_pair &inDimTags, vector_pair &outDimT
const
bool
combined
,
const
bool
oriented
,
const
bool
combined
,
const
bool
oriented
,
const
bool
recursive
)
const
bool
recursive
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
outDimTags
.
clear
();
outDimTags
.
clear
();
bool
r
=
GModel
::
current
()
->
getBoundaryTags
(
inDimTags
,
outDimTags
,
combined
,
bool
r
=
GModel
::
current
()
->
getBoundaryTags
(
inDimTags
,
outDimTags
,
combined
,
oriented
,
recursive
);
oriented
,
recursive
);
...
@@ -309,7 +309,7 @@ GMSH_API gmshModelGetEntitiesInBoundingBox(const double x1, const double y1,
...
@@ -309,7 +309,7 @@ GMSH_API gmshModelGetEntitiesInBoundingBox(const double x1, const double y1,
const
double
y2
,
const
double
z2
,
const
double
y2
,
const
double
z2
,
vector_pair
&
dimTags
,
const
int
dim
)
vector_pair
&
dimTags
,
const
int
dim
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
dimTags
.
clear
();
dimTags
.
clear
();
SBoundingBox3d
box
(
x1
,
y1
,
z1
,
x2
,
y2
,
z2
);
SBoundingBox3d
box
(
x1
,
y1
,
z1
,
x2
,
y2
,
z2
);
std
::
vector
<
GEntity
*>
entities
;
std
::
vector
<
GEntity
*>
entities
;
...
@@ -322,7 +322,7 @@ GMSH_API gmshModelGetEntitiesInBoundingBox(const double x1, const double y1,
...
@@ -322,7 +322,7 @@ GMSH_API gmshModelGetEntitiesInBoundingBox(const double x1, const double y1,
GMSH_API
gmshModelGetBoundingBox
(
const
int
dim
,
const
int
tag
,
double
&
x1
,
double
&
y1
,
GMSH_API
gmshModelGetBoundingBox
(
const
int
dim
,
const
int
tag
,
double
&
x1
,
double
&
y1
,
double
&
z1
,
double
&
x2
,
double
&
y2
,
double
&
z2
)
double
&
z1
,
double
&
x2
,
double
&
y2
,
double
&
z2
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GEntity
*
ge
=
GModel
::
current
()
->
getEntityByTag
(
dim
,
tag
);
GEntity
*
ge
=
GModel
::
current
()
->
getEntityByTag
(
dim
,
tag
);
if
(
!
ge
)
return
GMSH_ERROR
(
1
);
if
(
!
ge
)
return
GMSH_ERROR
(
1
);
SBoundingBox3d
box
=
ge
->
bounds
();
SBoundingBox3d
box
=
ge
->
bounds
();
...
@@ -338,14 +338,14 @@ GMSH_API gmshModelGetBoundingBox(const int dim, const int tag, double &x1, doubl
...
@@ -338,14 +338,14 @@ GMSH_API gmshModelGetBoundingBox(const int dim, const int tag, double &x1, doubl
GMSH_API
gmshModelRemove
(
const
vector_pair
&
dimTags
,
const
bool
recursive
)
GMSH_API
gmshModelRemove
(
const
vector_pair
&
dimTags
,
const
bool
recursive
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
remove
(
dimTags
,
recursive
);
GModel
::
current
()
->
remove
(
dimTags
,
recursive
);
return
GMSH_OK
;
return
GMSH_OK
;
}
}
GMSH_API
gmshModelMesh
(
int
dim
)
GMSH_API
gmshModelMesh
(
int
dim
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
*
m
=
GModel
::
current
();
GModel
*
m
=
GModel
::
current
();
if
(
m
){
if
(
m
){
m
->
mesh
(
dim
);
m
->
mesh
(
dim
);
...
@@ -358,7 +358,7 @@ GMSH_API gmshModelGetMeshVertices(const int dim, const int tag,
...
@@ -358,7 +358,7 @@ GMSH_API gmshModelGetMeshVertices(const int dim, const int tag,
std
::
vector
<
int
>
&
vertexTags
,
std
::
vector
<
int
>
&
vertexTags
,
std
::
vector
<
double
>
&
coords
)
std
::
vector
<
double
>
&
coords
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
vertexTags
.
clear
();
vertexTags
.
clear
();
coords
.
clear
();
coords
.
clear
();
GEntity
*
ge
=
GModel
::
current
()
->
getEntityByTag
(
dim
,
tag
);
GEntity
*
ge
=
GModel
::
current
()
->
getEntityByTag
(
dim
,
tag
);
...
@@ -374,7 +374,7 @@ GMSH_API gmshModelGetMeshVertices(const int dim, const int tag,
...
@@ -374,7 +374,7 @@ GMSH_API gmshModelGetMeshVertices(const int dim, const int tag,
}
}
template
<
class
T
>
template
<
class
T
>
static
void
addElementInfo
(
const
std
::
vector
<
T
*>
&
ele
,
static
void
_
addElementInfo
(
const
std
::
vector
<
T
*>
&
ele
,
std
::
vector
<
int
>
&
elementType
,
std
::
vector
<
int
>
&
elementType
,
std
::
vector
<
std
::
vector
<
int
>
>
&
elementTags
,
std
::
vector
<
std
::
vector
<
int
>
>
&
elementTags
,
std
::
vector
<
std
::
vector
<
int
>
>
&
vertexTags
)
std
::
vector
<
std
::
vector
<
int
>
>
&
vertexTags
)
...
@@ -396,7 +396,7 @@ GMSH_API gmshModelGetMeshElements(const int dim, const int tag,
...
@@ -396,7 +396,7 @@ GMSH_API gmshModelGetMeshElements(const int dim, const int tag,
std
::
vector
<
std
::
vector
<
int
>
>
&
elementTags
,
std
::
vector
<
std
::
vector
<
int
>
>
&
elementTags
,
std
::
vector
<
std
::
vector
<
int
>
>
&
vertexTags
)
std
::
vector
<
std
::
vector
<
int
>
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
types
.
clear
();
types
.
clear
();
elementTags
.
clear
();
elementTags
.
clear
();
vertexTags
.
clear
();
vertexTags
.
clear
();
...
@@ -405,23 +405,23 @@ GMSH_API gmshModelGetMeshElements(const int dim, const int tag,
...
@@ -405,23 +405,23 @@ GMSH_API gmshModelGetMeshElements(const int dim, const int tag,
switch
(
dim
){
switch
(
dim
){
case
0
:
{
case
0
:
{
GVertex
*
v
=
static_cast
<
GVertex
*>
(
ge
);
GVertex
*
v
=
static_cast
<
GVertex
*>
(
ge
);
addElementInfo
(
v
->
points
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
v
->
points
,
types
,
elementTags
,
vertexTags
);
break
;
}
break
;
}
case
1
:
{
case
1
:
{
GEdge
*
e
=
static_cast
<
GEdge
*>
(
ge
);
GEdge
*
e
=
static_cast
<
GEdge
*>
(
ge
);
addElementInfo
(
e
->
lines
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
e
->
lines
,
types
,
elementTags
,
vertexTags
);
break
;
}
break
;
}
case
2
:
{
case
2
:
{
GFace
*
f
=
static_cast
<
GFace
*>
(
ge
);
GFace
*
f
=
static_cast
<
GFace
*>
(
ge
);
addElementInfo
(
f
->
triangles
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
f
->
triangles
,
types
,
elementTags
,
vertexTags
);
addElementInfo
(
f
->
quadrangles
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
f
->
quadrangles
,
types
,
elementTags
,
vertexTags
);
break
;
}
break
;
}
case
3
:
{
case
3
:
{
GRegion
*
r
=
static_cast
<
GRegion
*>
(
ge
);
GRegion
*
r
=
static_cast
<
GRegion
*>
(
ge
);
addElementInfo
(
r
->
tetrahedra
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
r
->
tetrahedra
,
types
,
elementTags
,
vertexTags
);
addElementInfo
(
r
->
hexahedra
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
r
->
hexahedra
,
types
,
elementTags
,
vertexTags
);
addElementInfo
(
r
->
prisms
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
r
->
prisms
,
types
,
elementTags
,
vertexTags
);
addElementInfo
(
r
->
pyramids
,
types
,
elementTags
,
vertexTags
);
_
addElementInfo
(
r
->
pyramids
,
types
,
elementTags
,
vertexTags
);
break
;
}
break
;
}
}
}
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -429,7 +429,7 @@ GMSH_API gmshModelGetMeshElements(const int dim, const int tag,
...
@@ -429,7 +429,7 @@ GMSH_API gmshModelGetMeshElements(const int dim, const int tag,
GMSH_API
gmshModelSetMeshSize
(
const
vector_pair
&
dimTags
,
const
double
size
)
GMSH_API
gmshModelSetMeshSize
(
const
vector_pair
&
dimTags
,
const
double
size
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
for
(
unsigned
int
i
=
0
;
i
<
dimTags
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
dimTags
.
size
();
i
++
){
int
dim
=
dimTags
[
i
].
first
,
tag
=
dimTags
[
i
].
second
;
int
dim
=
dimTags
[
i
].
first
,
tag
=
dimTags
[
i
].
second
;
if
(
dim
==
0
){
if
(
dim
==
0
){
...
@@ -443,7 +443,7 @@ GMSH_API gmshModelSetMeshSize(const vector_pair &dimTags, const double size)
...
@@ -443,7 +443,7 @@ GMSH_API gmshModelSetMeshSize(const vector_pair &dimTags, const double size)
GMSH_API
gmshModelSetTransfiniteLine
(
const
int
tag
,
const
int
nPoints
,
GMSH_API
gmshModelSetTransfiniteLine
(
const
int
tag
,
const
int
nPoints
,
const
std
::
string
&
type
,
const
double
coef
)
const
std
::
string
&
type
,
const
double
coef
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GEdge
*
ge
=
GModel
::
current
()
->
getEdgeByTag
(
tag
);
GEdge
*
ge
=
GModel
::
current
()
->
getEdgeByTag
(
tag
);
if
(
ge
){
if
(
ge
){
ge
->
meshAttributes
.
method
=
MESH_TRANSFINITE
;
ge
->
meshAttributes
.
method
=
MESH_TRANSFINITE
;
...
@@ -464,7 +464,7 @@ GMSH_API gmshModelSetTransfiniteSurface(const int tag,
...
@@ -464,7 +464,7 @@ GMSH_API gmshModelSetTransfiniteSurface(const int tag,
const
std
::
string
&
arrangement
,
const
std
::
string
&
arrangement
,
const
std
::
vector
<
int
>
&
cornerTags
)
const
std
::
vector
<
int
>
&
cornerTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
tag
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
tag
);
if
(
gf
){
if
(
gf
){
gf
->
meshAttributes
.
method
=
MESH_TRANSFINITE
;
gf
->
meshAttributes
.
method
=
MESH_TRANSFINITE
;
...
@@ -490,7 +490,7 @@ GMSH_API gmshModelSetTransfiniteSurface(const int tag,
...
@@ -490,7 +490,7 @@ GMSH_API gmshModelSetTransfiniteSurface(const int tag,
GMSH_API
gmshModelSetTransfiniteVolume
(
const
int
tag
,
GMSH_API
gmshModelSetTransfiniteVolume
(
const
int
tag
,
const
std
::
vector
<
int
>
&
cornerTags
)
const
std
::
vector
<
int
>
&
cornerTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GRegion
*
gr
=
GModel
::
current
()
->
getRegionByTag
(
tag
);
GRegion
*
gr
=
GModel
::
current
()
->
getRegionByTag
(
tag
);
if
(
gr
){
if
(
gr
){
gr
->
meshAttributes
.
method
=
MESH_TRANSFINITE
;
gr
->
meshAttributes
.
method
=
MESH_TRANSFINITE
;
...
@@ -508,7 +508,7 @@ GMSH_API gmshModelSetTransfiniteVolume(const int tag,
...
@@ -508,7 +508,7 @@ GMSH_API gmshModelSetTransfiniteVolume(const int tag,
GMSH_API
gmshModelSetRecombine
(
const
int
dim
,
const
int
tag
,
const
double
angle
)
GMSH_API
gmshModelSetRecombine
(
const
int
dim
,
const
int
tag
,
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
tag
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
tag
);
if
(
gf
){
if
(
gf
){
gf
->
meshAttributes
.
recombine
=
1
;
gf
->
meshAttributes
.
recombine
=
1
;
...
@@ -520,7 +520,7 @@ GMSH_API gmshModelSetRecombine(const int dim, const int tag, const double angle)
...
@@ -520,7 +520,7 @@ GMSH_API gmshModelSetRecombine(const int dim, const int tag, const double angle)
GMSH_API
gmshModelSetSmoothing
(
const
int
dim
,
const
int
tag
,
const
int
val
)
GMSH_API
gmshModelSetSmoothing
(
const
int
dim
,
const
int
tag
,
const
int
val
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
dim
!=
2
)
return
GMSH_ERROR
(
1
);
if
(
dim
!=
2
)
return
GMSH_ERROR
(
1
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
tag
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
tag
);
if
(
gf
){
if
(
gf
){
...
@@ -532,7 +532,7 @@ GMSH_API gmshModelSetSmoothing(const int dim, const int tag, const int val)
...
@@ -532,7 +532,7 @@ GMSH_API gmshModelSetSmoothing(const int dim, const int tag, const int val)
GMSH_API
gmshModelSetReverseMesh
(
const
int
dim
,
const
int
tag
,
const
bool
val
)
GMSH_API
gmshModelSetReverseMesh
(
const
int
dim
,
const
int
tag
,
const
bool
val
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
dim
==
1
){
if
(
dim
==
1
){
GEdge
*
ge
=
GModel
::
current
()
->
getEdgeByTag
(
tag
);
GEdge
*
ge
=
GModel
::
current
()
->
getEdgeByTag
(
tag
);
if
(
ge
){
if
(
ge
){
...
@@ -553,7 +553,7 @@ GMSH_API gmshModelSetReverseMesh(const int dim, const int tag, const bool val)
...
@@ -553,7 +553,7 @@ GMSH_API gmshModelSetReverseMesh(const int dim, const int tag, const bool val)
GMSH_API
gmshModelEmbed
(
const
int
dim
,
const
std
::
vector
<
int
>
&
tags
,
GMSH_API
gmshModelEmbed
(
const
int
dim
,
const
std
::
vector
<
int
>
&
tags
,
const
int
inDim
,
const
int
inTag
)
const
int
inDim
,
const
int
inTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
inDim
==
2
){
if
(
inDim
==
2
){
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
inTag
);
GFace
*
gf
=
GModel
::
current
()
->
getFaceByTag
(
inTag
);
if
(
gf
){
if
(
gf
){
...
@@ -601,7 +601,7 @@ GMSH_API gmshModelEmbed(const int dim, const std::vector<int> &tags,
...
@@ -601,7 +601,7 @@ GMSH_API gmshModelEmbed(const int dim, const std::vector<int> &tags,
GMSH_API
gmshModelGeoAddPoint
(
const
int
tag
,
const
double
x
,
const
double
y
,
GMSH_API
gmshModelGeoAddPoint
(
const
int
tag
,
const
double
x
,
const
double
y
,
const
double
z
,
const
double
meshSize
)
const
double
z
,
const
double
meshSize
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
double
xx
=
CTX
::
instance
()
->
geom
.
scalingFactor
*
x
;
double
xx
=
CTX
::
instance
()
->
geom
.
scalingFactor
*
x
;
double
yy
=
CTX
::
instance
()
->
geom
.
scalingFactor
*
y
;
double
yy
=
CTX
::
instance
()
->
geom
.
scalingFactor
*
y
;
...
@@ -616,7 +616,7 @@ GMSH_API gmshModelGeoAddPoint(const int tag, const double x, const double y,
...
@@ -616,7 +616,7 @@ GMSH_API gmshModelGeoAddPoint(const int tag, const double x, const double y,
GMSH_API
gmshModelGeoAddLine
(
const
int
tag
,
const
int
startTag
,
const
int
endTag
)
GMSH_API
gmshModelGeoAddLine
(
const
int
tag
,
const
int
startTag
,
const
int
endTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addLine
(
outTag
,
startTag
,
endTag
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addLine
(
outTag
,
startTag
,
endTag
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -629,7 +629,7 @@ GMSH_API gmshModelGeoAddCircleArc(const int tag, const int startTag,
...
@@ -629,7 +629,7 @@ GMSH_API gmshModelGeoAddCircleArc(const int tag, const int startTag,
const
int
centerTag
,
const
int
endTag
,
const
int
centerTag
,
const
int
endTag
,
const
double
nx
,
const
double
ny
,
const
double
nz
)
const
double
nx
,
const
double
ny
,
const
double
nz
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addCircleArc
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addCircleArc
(
outTag
,
startTag
,
centerTag
,
endTag
,
nx
,
ny
,
nz
)){
(
outTag
,
startTag
,
centerTag
,
endTag
,
nx
,
ny
,
nz
)){
...
@@ -644,7 +644,7 @@ GMSH_API gmshModelGeoAddEllipseArc(const int tag, const int startTag,
...
@@ -644,7 +644,7 @@ GMSH_API gmshModelGeoAddEllipseArc(const int tag, const int startTag,
const
int
endTag
,
const
double
nx
,
const
double
ny
,
const
int
endTag
,
const
double
nx
,
const
double
ny
,
const
double
nz
)
const
double
nz
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addEllipseArc
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addEllipseArc
(
outTag
,
startTag
,
centerTag
,
majorTag
,
endTag
,
nx
,
ny
,
nz
)){
(
outTag
,
startTag
,
centerTag
,
majorTag
,
endTag
,
nx
,
ny
,
nz
)){
...
@@ -656,7 +656,7 @@ GMSH_API gmshModelGeoAddEllipseArc(const int tag, const int startTag,
...
@@ -656,7 +656,7 @@ GMSH_API gmshModelGeoAddEllipseArc(const int tag, const int startTag,
GMSH_API
gmshModelGeoAddSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
GMSH_API
gmshModelGeoAddSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addSpline
(
outTag
,
vertexTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addSpline
(
outTag
,
vertexTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -667,7 +667,7 @@ GMSH_API gmshModelGeoAddSpline(const int tag, const std::vector<int> &vertexTags
...
@@ -667,7 +667,7 @@ GMSH_API gmshModelGeoAddSpline(const int tag, const std::vector<int> &vertexTags
GMSH_API
gmshModelGeoAddBSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
GMSH_API
gmshModelGeoAddBSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addBSpline
(
outTag
,
vertexTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addBSpline
(
outTag
,
vertexTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -678,7 +678,7 @@ GMSH_API gmshModelGeoAddBSpline(const int tag, const std::vector<int> &vertexTag
...
@@ -678,7 +678,7 @@ GMSH_API gmshModelGeoAddBSpline(const int tag, const std::vector<int> &vertexTag
GMSH_API
gmshModelGeoAddBezier
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
GMSH_API
gmshModelGeoAddBezier
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addBezier
(
outTag
,
vertexTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addBezier
(
outTag
,
vertexTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -689,7 +689,7 @@ GMSH_API gmshModelGeoAddBezier(const int tag, const std::vector<int> &vertexTags
...
@@ -689,7 +689,7 @@ GMSH_API gmshModelGeoAddBezier(const int tag, const std::vector<int> &vertexTags
GMSH_API
gmshModelGeoAddLineLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
edgeTags
)
GMSH_API
gmshModelGeoAddLineLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
edgeTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addLineLoop
(
outTag
,
edgeTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addLineLoop
(
outTag
,
edgeTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -700,7 +700,7 @@ GMSH_API gmshModelGeoAddLineLoop(const int tag, const std::vector<int> &edgeTags
...
@@ -700,7 +700,7 @@ GMSH_API gmshModelGeoAddLineLoop(const int tag, const std::vector<int> &edgeTags
GMSH_API
gmshModelGeoAddPlaneSurface
(
const
int
tag
,
const
std
::
vector
<
int
>
&
wireTags
)
GMSH_API
gmshModelGeoAddPlaneSurface
(
const
int
tag
,
const
std
::
vector
<
int
>
&
wireTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addPlaneSurface
(
outTag
,
wireTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addPlaneSurface
(
outTag
,
wireTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -712,7 +712,7 @@ GMSH_API gmshModelGeoAddPlaneSurface(const int tag, const std::vector<int> &wire
...
@@ -712,7 +712,7 @@ GMSH_API gmshModelGeoAddPlaneSurface(const int tag, const std::vector<int> &wire
GMSH_API
gmshModelGeoAddSurfaceFilling
(
const
int
tag
,
const
std
::
vector
<
int
>
&
wireTags
,
GMSH_API
gmshModelGeoAddSurfaceFilling
(
const
int
tag
,
const
std
::
vector
<
int
>
&
wireTags
,
const
int
sphereCenterTag
)
const
int
sphereCenterTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addSurfaceFilling
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addSurfaceFilling
(
outTag
,
wireTags
,
sphereCenterTag
)){
(
outTag
,
wireTags
,
sphereCenterTag
)){
...
@@ -724,7 +724,7 @@ GMSH_API gmshModelGeoAddSurfaceFilling(const int tag, const std::vector<int> &wi
...
@@ -724,7 +724,7 @@ GMSH_API gmshModelGeoAddSurfaceFilling(const int tag, const std::vector<int> &wi
GMSH_API
gmshModelGeoAddSurfaceLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
faceTags
)
GMSH_API
gmshModelGeoAddSurfaceLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
faceTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addSurfaceLoop
(
outTag
,
faceTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addSurfaceLoop
(
outTag
,
faceTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -735,7 +735,7 @@ GMSH_API gmshModelGeoAddSurfaceLoop(const int tag, const std::vector<int> &faceT
...
@@ -735,7 +735,7 @@ GMSH_API gmshModelGeoAddSurfaceLoop(const int tag, const std::vector<int> &faceT
GMSH_API
gmshModelGeoAddVolume
(
const
int
tag
,
const
std
::
vector
<
int
>
&
shellTags
)
GMSH_API
gmshModelGeoAddVolume
(
const
int
tag
,
const
std
::
vector
<
int
>
&
shellTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addVolume
(
outTag
,
shellTags
)){
if
(
GModel
::
current
()
->
getGEOInternals
()
->
addVolume
(
outTag
,
shellTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -744,7 +744,7 @@ GMSH_API gmshModelGeoAddVolume(const int tag, const std::vector<int> &shellTags)
...
@@ -744,7 +744,7 @@ GMSH_API gmshModelGeoAddVolume(const int tag, const std::vector<int> &shellTags)
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
static
ExtrudeParams
*
getExtrudeParams
(
const
std
::
vector
<
int
>
&
numElements
,
static
ExtrudeParams
*
_
getExtrudeParams
(
const
std
::
vector
<
int
>
&
numElements
,
const
std
::
vector
<
double
>
&
heights
,
const
std
::
vector
<
double
>
&
heights
,
const
bool
recombine
)
const
bool
recombine
)
{
{
...
@@ -773,11 +773,11 @@ GMSH_API gmshModelGeoExtrude(const vector_pair &inDimTags,
...
@@ -773,11 +773,11 @@ GMSH_API gmshModelGeoExtrude(const vector_pair &inDimTags,
const
std
::
vector
<
double
>
&
heights
,
const
std
::
vector
<
double
>
&
heights
,
const
bool
recombine
)
const
bool
recombine
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getGEOInternals
()
->
extrude
if
(
GModel
::
current
()
->
getGEOInternals
()
->
extrude
(
inDimTags
,
dx
,
dy
,
dz
,
outDimTags
,
(
inDimTags
,
dx
,
dy
,
dz
,
outDimTags
,
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
_
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
...
@@ -790,11 +790,11 @@ GMSH_API gmshModelGeoRevolve(const vector_pair &inDimTags,
...
@@ -790,11 +790,11 @@ GMSH_API gmshModelGeoRevolve(const vector_pair &inDimTags,
const
std
::
vector
<
double
>
&
heights
,
const
std
::
vector
<
double
>
&
heights
,
const
bool
recombine
)
const
bool
recombine
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getGEOInternals
()
->
revolve
if
(
GModel
::
current
()
->
getGEOInternals
()
->
revolve
(
inDimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
,
outDimTags
,
(
inDimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
,
outDimTags
,
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
_
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
...
@@ -808,11 +808,11 @@ GMSH_API gmshModelGeoTwist(const vector_pair &inDimTags,
...
@@ -808,11 +808,11 @@ GMSH_API gmshModelGeoTwist(const vector_pair &inDimTags,
const
std
::
vector
<
double
>
&
heights
,
const
std
::
vector
<
double
>
&
heights
,
const
bool
recombine
)
const
bool
recombine
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getGEOInternals
()
->
twist
if
(
GModel
::
current
()
->
getGEOInternals
()
->
twist
(
inDimTags
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
ax
,
ay
,
az
,
angle
,
outDimTags
,
(
inDimTags
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
ax
,
ay
,
az
,
angle
,
outDimTags
,
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
_
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
...
@@ -820,7 +820,7 @@ GMSH_API gmshModelGeoTwist(const vector_pair &inDimTags,
...
@@ -820,7 +820,7 @@ GMSH_API gmshModelGeoTwist(const vector_pair &inDimTags,
GMSH_API
gmshModelGeoTranslate
(
const
vector_pair
&
dimTags
,
const
double
dx
,
GMSH_API
gmshModelGeoTranslate
(
const
vector_pair
&
dimTags
,
const
double
dx
,
const
double
dy
,
const
double
dz
)
const
double
dy
,
const
double
dz
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GModel
::
current
()
->
getGEOInternals
()
->
translate
(
dimTags
,
dx
,
dy
,
dz
))
if
(
GModel
::
current
()
->
getGEOInternals
()
->
translate
(
dimTags
,
dx
,
dy
,
dz
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -830,7 +830,7 @@ GMSH_API gmshModelGeoRotate(const vector_pair &dimTags, const double x,
...
@@ -830,7 +830,7 @@ GMSH_API gmshModelGeoRotate(const vector_pair &dimTags, const double x,
const
double
y
,
const
double
z
,
const
double
ax
,
const
double
y
,
const
double
z
,
const
double
ax
,
const
double
ay
,
const
double
az
,
const
double
angle
)
const
double
ay
,
const
double
az
,
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GModel
::
current
()
->
getGEOInternals
()
->
rotate
if
(
GModel
::
current
()
->
getGEOInternals
()
->
rotate
(
dimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
))
(
dimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -841,7 +841,7 @@ GMSH_API gmshModelGeoDilate(const vector_pair &dimTags, const double x,
...
@@ -841,7 +841,7 @@ GMSH_API gmshModelGeoDilate(const vector_pair &dimTags, const double x,
const
double
y
,
const
double
z
,
const
double
a
,
const
double
y
,
const
double
z
,
const
double
a
,
const
double
b
,
const
double
c
)
const
double
b
,
const
double
c
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GModel
::
current
()
->
getGEOInternals
()
->
dilate
if
(
GModel
::
current
()
->
getGEOInternals
()
->
dilate
(
dimTags
,
x
,
y
,
z
,
a
,
b
,
c
))
(
dimTags
,
x
,
y
,
z
,
a
,
b
,
c
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -851,7 +851,7 @@ GMSH_API gmshModelGeoDilate(const vector_pair &dimTags, const double x,
...
@@ -851,7 +851,7 @@ GMSH_API gmshModelGeoDilate(const vector_pair &dimTags, const double x,
GMSH_API
gmshModelGeoSymmetry
(
const
vector_pair
&
dimTags
,
const
double
a
,
GMSH_API
gmshModelGeoSymmetry
(
const
vector_pair
&
dimTags
,
const
double
a
,
const
double
b
,
const
double
c
,
const
double
d
)
const
double
b
,
const
double
c
,
const
double
d
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GModel
::
current
()
->
getGEOInternals
()
->
symmetry
if
(
GModel
::
current
()
->
getGEOInternals
()
->
symmetry
(
dimTags
,
a
,
b
,
c
,
d
))
(
dimTags
,
a
,
b
,
c
,
d
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -860,7 +860,7 @@ GMSH_API gmshModelGeoSymmetry(const vector_pair &dimTags, const double a,
...
@@ -860,7 +860,7 @@ GMSH_API gmshModelGeoSymmetry(const vector_pair &dimTags, const double a,
GMSH_API
gmshModelGeoCopy
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
)
GMSH_API
gmshModelGeoCopy
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getGEOInternals
()
->
copy
(
inDimTags
,
outDimTags
))
if
(
GModel
::
current
()
->
getGEOInternals
()
->
copy
(
inDimTags
,
outDimTags
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -869,7 +869,7 @@ GMSH_API gmshModelGeoCopy(const vector_pair &inDimTags, vector_pair &outDimTags)
...
@@ -869,7 +869,7 @@ GMSH_API gmshModelGeoCopy(const vector_pair &inDimTags, vector_pair &outDimTags)
GMSH_API
gmshModelGeoRemove
(
const
vector_pair
&
dimTags
,
const
bool
recursive
)
GMSH_API
gmshModelGeoRemove
(
const
vector_pair
&
dimTags
,
const
bool
recursive
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
GModel
::
current
()
->
getGEOInternals
()
->
remove
(
dimTags
,
recursive
))
if
(
GModel
::
current
()
->
getGEOInternals
()
->
remove
(
dimTags
,
recursive
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -877,7 +877,7 @@ GMSH_API gmshModelGeoRemove(const vector_pair &dimTags, const bool recursive)
...
@@ -877,7 +877,7 @@ GMSH_API gmshModelGeoRemove(const vector_pair &dimTags, const bool recursive)
GMSH_API
gmshModelGeoRemoveAllDuplicates
()
GMSH_API
gmshModelGeoRemoveAllDuplicates
()
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
getGEOInternals
()
->
removeAllDuplicates
();
GModel
::
current
()
->
getGEOInternals
()
->
removeAllDuplicates
();
return
GMSH_OK
;
return
GMSH_OK
;
}
}
...
@@ -886,7 +886,7 @@ GMSH_API gmshModelGeoSetTransfiniteLine(const int tag, const int nPoints,
...
@@ -886,7 +886,7 @@ GMSH_API gmshModelGeoSetTransfiniteLine(const int tag, const int nPoints,
const
std
::
string
&
type
,
const
std
::
string
&
type
,
const
double
coef
)
const
double
coef
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
t
=
int
t
=
(
type
==
"Progression"
||
type
==
"Power"
)
?
1
:
(
type
==
"Progression"
||
type
==
"Power"
)
?
1
:
(
type
==
"Bump"
)
?
2
:
(
type
==
"Bump"
)
?
2
:
...
@@ -902,7 +902,7 @@ GMSH_API gmshModelGeoSetTransfiniteSurface(const int tag,
...
@@ -902,7 +902,7 @@ GMSH_API gmshModelGeoSetTransfiniteSurface(const int tag,
const
std
::
string
&
arrangement
,
const
std
::
string
&
arrangement
,
const
std
::
vector
<
int
>
&
cornerTags
)
const
std
::
vector
<
int
>
&
cornerTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
int
t
=
int
t
=
(
arrangement
==
"Right"
)
?
1
:
(
arrangement
==
"Right"
)
?
1
:
(
arrangement
==
"Left"
)
?
-
1
:
(
arrangement
==
"Left"
)
?
-
1
:
...
@@ -917,21 +917,21 @@ GMSH_API gmshModelGeoSetTransfiniteSurface(const int tag,
...
@@ -917,21 +917,21 @@ GMSH_API gmshModelGeoSetTransfiniteSurface(const int tag,
GMSH_API
gmshModelGeoSetTransfiniteVolume
(
const
int
tag
,
GMSH_API
gmshModelGeoSetTransfiniteVolume
(
const
int
tag
,
const
std
::
vector
<
int
>
&
cornerTags
)
const
std
::
vector
<
int
>
&
cornerTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
getGEOInternals
()
->
setTransfiniteVolume
(
tag
,
cornerTags
);
GModel
::
current
()
->
getGEOInternals
()
->
setTransfiniteVolume
(
tag
,
cornerTags
);
return
GMSH_OK
;
return
GMSH_OK
;
}
}
GMSH_API
gmshModelGeoSetRecombine
(
const
int
dim
,
const
int
tag
,
const
double
angle
)
GMSH_API
gmshModelGeoSetRecombine
(
const
int
dim
,
const
int
tag
,
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
getGEOInternals
()
->
setRecombine
(
dim
,
tag
,
angle
);
GModel
::
current
()
->
getGEOInternals
()
->
setRecombine
(
dim
,
tag
,
angle
);
return
GMSH_OK
;
return
GMSH_OK
;
}
}
GMSH_API
gmshModelGeoSetSmoothing
(
const
int
dim
,
const
int
tag
,
const
int
val
)
GMSH_API
gmshModelGeoSetSmoothing
(
const
int
dim
,
const
int
tag
,
const
int
val
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
dim
!=
2
)
return
GMSH_ERROR
(
1
);
if
(
dim
!=
2
)
return
GMSH_ERROR
(
1
);
GModel
::
current
()
->
getGEOInternals
()
->
setSmoothing
(
tag
,
val
);
GModel
::
current
()
->
getGEOInternals
()
->
setSmoothing
(
tag
,
val
);
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -939,14 +939,14 @@ GMSH_API gmshModelGeoSetSmoothing(const int dim, const int tag, const int val)
...
@@ -939,14 +939,14 @@ GMSH_API gmshModelGeoSetSmoothing(const int dim, const int tag, const int val)
GMSH_API
gmshModelGeoSetReverseMesh
(
const
int
dim
,
const
int
tag
,
const
bool
val
)
GMSH_API
gmshModelGeoSetReverseMesh
(
const
int
dim
,
const
int
tag
,
const
bool
val
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
getGEOInternals
()
->
setReverseMesh
(
dim
,
tag
,
val
);
GModel
::
current
()
->
getGEOInternals
()
->
setReverseMesh
(
dim
,
tag
,
val
);
return
GMSH_OK
;
return
GMSH_OK
;
}
}
GMSH_API
gmshModelGeoSetMeshSize
(
const
vector_pair
&
dimTags
,
const
double
size
)
GMSH_API
gmshModelGeoSetMeshSize
(
const
vector_pair
&
dimTags
,
const
double
size
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
for
(
unsigned
int
i
=
0
;
i
<
dimTags
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
dimTags
.
size
();
i
++
){
int
dim
=
dimTags
[
i
].
first
,
tag
=
dimTags
[
i
].
second
;
int
dim
=
dimTags
[
i
].
first
,
tag
=
dimTags
[
i
].
second
;
GModel
::
current
()
->
getGEOInternals
()
->
setMeshSize
(
dim
,
tag
,
size
);
GModel
::
current
()
->
getGEOInternals
()
->
setMeshSize
(
dim
,
tag
,
size
);
...
@@ -956,14 +956,14 @@ GMSH_API gmshModelGeoSetMeshSize(const vector_pair &dimTags, const double size)
...
@@ -956,14 +956,14 @@ GMSH_API gmshModelGeoSetMeshSize(const vector_pair &dimTags, const double size)
GMSH_API
gmshModelGeoSynchronize
()
GMSH_API
gmshModelGeoSynchronize
()
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
GModel
::
current
()
->
getGEOInternals
()
->
synchronize
(
GModel
::
current
());
GModel
::
current
()
->
getGEOInternals
()
->
synchronize
(
GModel
::
current
());
return
GMSH_OK
;
return
GMSH_OK
;
}
}
// gmshModelOcc
// gmshModelOcc
static
void
createOcc
()
static
void
_
createOcc
()
{
{
if
(
!
GModel
::
current
()
->
getOCCInternals
())
GModel
::
current
()
->
createOCCInternals
();
if
(
!
GModel
::
current
()
->
getOCCInternals
())
GModel
::
current
()
->
createOCCInternals
();
}
}
...
@@ -971,8 +971,8 @@ static void createOcc()
...
@@ -971,8 +971,8 @@ static void createOcc()
GMSH_API
gmshModelOccAddPoint
(
const
int
tag
,
const
double
x
,
const
double
y
,
GMSH_API
gmshModelOccAddPoint
(
const
int
tag
,
const
double
x
,
const
double
y
,
const
double
z
,
const
double
meshSize
)
const
double
z
,
const
double
meshSize
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addVertex
(
outTag
,
x
,
y
,
z
,
meshSize
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addVertex
(
outTag
,
x
,
y
,
z
,
meshSize
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -983,8 +983,8 @@ GMSH_API gmshModelOccAddPoint(const int tag, const double x, const double y,
...
@@ -983,8 +983,8 @@ GMSH_API gmshModelOccAddPoint(const int tag, const double x, const double y,
GMSH_API
gmshModelOccAddLine
(
const
int
tag
,
const
int
startTag
,
const
int
endTag
)
GMSH_API
gmshModelOccAddLine
(
const
int
tag
,
const
int
startTag
,
const
int
endTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addLine
(
outTag
,
startTag
,
endTag
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addLine
(
outTag
,
startTag
,
endTag
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -996,8 +996,8 @@ GMSH_API gmshModelOccAddLine(const int tag, const int startTag, const int endTag
...
@@ -996,8 +996,8 @@ GMSH_API gmshModelOccAddLine(const int tag, const int startTag, const int endTag
GMSH_API
gmshModelOccAddCircleArc
(
const
int
tag
,
const
int
startTag
,
GMSH_API
gmshModelOccAddCircleArc
(
const
int
tag
,
const
int
startTag
,
const
int
centerTag
,
const
int
endTag
)
const
int
centerTag
,
const
int
endTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCircleArc
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCircleArc
(
outTag
,
startTag
,
centerTag
,
endTag
)){
(
outTag
,
startTag
,
centerTag
,
endTag
)){
...
@@ -1011,8 +1011,8 @@ GMSH_API gmshModelOccAddCircle(const int tag, const double x, const double y,
...
@@ -1011,8 +1011,8 @@ GMSH_API gmshModelOccAddCircle(const int tag, const double x, const double y,
const
double
z
,
const
double
r
,
const
double
angle1
,
const
double
z
,
const
double
r
,
const
double
angle1
,
const
double
angle2
)
const
double
angle2
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCircle
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCircle
(
outTag
,
x
,
y
,
z
,
r
,
angle1
,
angle2
)){
(
outTag
,
x
,
y
,
z
,
r
,
angle1
,
angle2
)){
...
@@ -1025,8 +1025,8 @@ GMSH_API gmshModelOccAddCircle(const int tag, const double x, const double y,
...
@@ -1025,8 +1025,8 @@ GMSH_API gmshModelOccAddCircle(const int tag, const double x, const double y,
GMSH_API
gmshModelOccAddEllipseArc
(
const
int
tag
,
const
int
startTag
,
GMSH_API
gmshModelOccAddEllipseArc
(
const
int
tag
,
const
int
startTag
,
const
int
centerTag
,
const
int
endTag
)
const
int
centerTag
,
const
int
endTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addEllipseArc
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addEllipseArc
(
outTag
,
startTag
,
centerTag
,
endTag
)){
(
outTag
,
startTag
,
centerTag
,
endTag
)){
...
@@ -1040,8 +1040,8 @@ GMSH_API gmshModelOccAddEllipse(const int tag, const double x, const double y,
...
@@ -1040,8 +1040,8 @@ GMSH_API gmshModelOccAddEllipse(const int tag, const double x, const double y,
const
double
z
,
const
double
r1
,
const
double
r2
,
const
double
z
,
const
double
r1
,
const
double
r2
,
const
double
angle1
,
const
double
angle2
)
const
double
angle1
,
const
double
angle2
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addEllipse
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addEllipse
(
outTag
,
x
,
y
,
z
,
r1
,
r2
,
angle1
,
angle2
)){
(
outTag
,
x
,
y
,
z
,
r1
,
r2
,
angle1
,
angle2
)){
...
@@ -1053,8 +1053,8 @@ GMSH_API gmshModelOccAddEllipse(const int tag, const double x, const double y,
...
@@ -1053,8 +1053,8 @@ GMSH_API gmshModelOccAddEllipse(const int tag, const double x, const double y,
GMSH_API
gmshModelOccAddSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
GMSH_API
gmshModelOccAddSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSpline
(
outTag
,
vertexTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSpline
(
outTag
,
vertexTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1065,8 +1065,8 @@ GMSH_API gmshModelOccAddSpline(const int tag, const std::vector<int> &vertexTags
...
@@ -1065,8 +1065,8 @@ GMSH_API gmshModelOccAddSpline(const int tag, const std::vector<int> &vertexTags
GMSH_API
gmshModelOccAddBezier
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
GMSH_API
gmshModelOccAddBezier
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addBezier
(
outTag
,
vertexTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addBezier
(
outTag
,
vertexTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1077,8 +1077,8 @@ GMSH_API gmshModelOccAddBezier(const int tag, const std::vector<int> &vertexTags
...
@@ -1077,8 +1077,8 @@ GMSH_API gmshModelOccAddBezier(const int tag, const std::vector<int> &vertexTags
GMSH_API
gmshModelOccAddBSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
GMSH_API
gmshModelOccAddBSpline
(
const
int
tag
,
const
std
::
vector
<
int
>
&
vertexTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addBSpline
(
outTag
,
vertexTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addBSpline
(
outTag
,
vertexTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1090,8 +1090,8 @@ GMSH_API gmshModelOccAddBSpline(const int tag, const std::vector<int> &vertexTag
...
@@ -1090,8 +1090,8 @@ GMSH_API gmshModelOccAddBSpline(const int tag, const std::vector<int> &vertexTag
GMSH_API
gmshModelOccAddWire
(
const
int
tag
,
const
std
::
vector
<
int
>
&
edgeTags
,
GMSH_API
gmshModelOccAddWire
(
const
int
tag
,
const
std
::
vector
<
int
>
&
edgeTags
,
const
bool
checkClosed
)
const
bool
checkClosed
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addWire
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addWire
(
outTag
,
edgeTags
,
checkClosed
)){
(
outTag
,
edgeTags
,
checkClosed
)){
...
@@ -1103,8 +1103,8 @@ GMSH_API gmshModelOccAddWire(const int tag, const std::vector<int> &edgeTags,
...
@@ -1103,8 +1103,8 @@ GMSH_API gmshModelOccAddWire(const int tag, const std::vector<int> &edgeTags,
GMSH_API
gmshModelOccAddLineLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
edgeTags
)
GMSH_API
gmshModelOccAddLineLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
edgeTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addLineLoop
(
outTag
,
edgeTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addLineLoop
(
outTag
,
edgeTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1117,8 +1117,8 @@ GMSH_API gmshModelOccAddRectangle(const int tag, const double x, const double y,
...
@@ -1117,8 +1117,8 @@ GMSH_API gmshModelOccAddRectangle(const int tag, const double x, const double y,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
roundedRadius
)
const
double
roundedRadius
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addRectangle
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addRectangle
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
roundedRadius
)){
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
roundedRadius
)){
...
@@ -1131,8 +1131,8 @@ GMSH_API gmshModelOccAddRectangle(const int tag, const double x, const double y,
...
@@ -1131,8 +1131,8 @@ GMSH_API gmshModelOccAddRectangle(const int tag, const double x, const double y,
GMSH_API
gmshModelOccAddDisk
(
const
int
tag
,
const
double
xc
,
const
double
yc
,
GMSH_API
gmshModelOccAddDisk
(
const
int
tag
,
const
double
xc
,
const
double
yc
,
const
double
zc
,
const
double
rx
,
const
double
ry
)
const
double
zc
,
const
double
rx
,
const
double
ry
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addDisk
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addDisk
(
outTag
,
xc
,
yc
,
zc
,
rx
,
ry
)){
(
outTag
,
xc
,
yc
,
zc
,
rx
,
ry
)){
...
@@ -1144,8 +1144,8 @@ GMSH_API gmshModelOccAddDisk(const int tag, const double xc, const double yc,
...
@@ -1144,8 +1144,8 @@ GMSH_API gmshModelOccAddDisk(const int tag, const double xc, const double yc,
GMSH_API
gmshModelOccAddPlaneSurface
(
const
int
tag
,
const
std
::
vector
<
int
>
&
wireTags
)
GMSH_API
gmshModelOccAddPlaneSurface
(
const
int
tag
,
const
std
::
vector
<
int
>
&
wireTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addPlaneSurface
(
outTag
,
wireTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addPlaneSurface
(
outTag
,
wireTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1156,8 +1156,8 @@ GMSH_API gmshModelOccAddPlaneSurface(const int tag, const std::vector<int> &wire
...
@@ -1156,8 +1156,8 @@ GMSH_API gmshModelOccAddPlaneSurface(const int tag, const std::vector<int> &wire
GMSH_API
gmshModelOccAddSurfaceFilling
(
const
int
tag
,
const
int
wireTag
)
GMSH_API
gmshModelOccAddSurfaceFilling
(
const
int
tag
,
const
int
wireTag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSurfaceFilling
(
outTag
,
wireTag
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSurfaceFilling
(
outTag
,
wireTag
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1168,8 +1168,8 @@ GMSH_API gmshModelOccAddSurfaceFilling(const int tag, const int wireTag)
...
@@ -1168,8 +1168,8 @@ GMSH_API gmshModelOccAddSurfaceFilling(const int tag, const int wireTag)
GMSH_API
gmshModelOccAddSurfaceLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
faceTags
)
GMSH_API
gmshModelOccAddSurfaceLoop
(
const
int
tag
,
const
std
::
vector
<
int
>
&
faceTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSurfaceLoop
(
outTag
,
faceTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSurfaceLoop
(
outTag
,
faceTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1180,8 +1180,8 @@ GMSH_API gmshModelOccAddSurfaceLoop(const int tag, const std::vector<int> &faceT
...
@@ -1180,8 +1180,8 @@ GMSH_API gmshModelOccAddSurfaceLoop(const int tag, const std::vector<int> &faceT
GMSH_API
gmshModelOccAddVolume
(
const
int
tag
,
const
std
::
vector
<
int
>
&
shellTags
)
GMSH_API
gmshModelOccAddVolume
(
const
int
tag
,
const
std
::
vector
<
int
>
&
shellTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addVolume
(
outTag
,
shellTags
)){
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addVolume
(
outTag
,
shellTags
)){
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
std
::
vector
<
int
>
ret
(
1
,
0
);
ret
.
push_back
(
outTag
);
...
@@ -1195,8 +1195,8 @@ GMSH_API gmshModelOccAddSphere(const int tag, const double xc, const double yc,
...
@@ -1195,8 +1195,8 @@ GMSH_API gmshModelOccAddSphere(const int tag, const double xc, const double yc,
const
double
angle1
,
const
double
angle2
,
const
double
angle1
,
const
double
angle2
,
const
double
angle3
)
const
double
angle3
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSphere
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addSphere
(
outTag
,
xc
,
yc
,
zc
,
radius
,
angle1
,
angle2
,
angle3
)){
(
outTag
,
xc
,
yc
,
zc
,
radius
,
angle1
,
angle2
,
angle3
)){
...
@@ -1210,8 +1210,8 @@ GMSH_API gmshModelOccAddBox(const int tag, const double x, const double y,
...
@@ -1210,8 +1210,8 @@ GMSH_API gmshModelOccAddBox(const int tag, const double x, const double y,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
dz
)
const
double
dz
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addBox
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addBox
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
)){
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
)){
...
@@ -1225,8 +1225,8 @@ GMSH_API gmshModelOccAddCylinder(const int tag, const double x, const double y,
...
@@ -1225,8 +1225,8 @@ GMSH_API gmshModelOccAddCylinder(const int tag, const double x, const double y,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
dz
,
const
double
r
,
const
double
angle
)
const
double
dz
,
const
double
r
,
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCylinder
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCylinder
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
r
,
angle
)){
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
r
,
angle
)){
...
@@ -1241,8 +1241,8 @@ GMSH_API gmshModelOccAddCone(const int tag, const double x, const double y,
...
@@ -1241,8 +1241,8 @@ GMSH_API gmshModelOccAddCone(const int tag, const double x, const double y,
const
double
dz
,
const
double
r1
,
const
double
r2
,
const
double
dz
,
const
double
r1
,
const
double
r2
,
const
double
angle
)
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCone
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addCone
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
r1
,
r2
,
angle
)){
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
r1
,
r2
,
angle
)){
...
@@ -1256,8 +1256,8 @@ GMSH_API gmshModelOccAddWedge(const int tag, const double x, const double y,
...
@@ -1256,8 +1256,8 @@ GMSH_API gmshModelOccAddWedge(const int tag, const double x, const double y,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
z
,
const
double
dx
,
const
double
dy
,
const
double
dz
,
const
double
ltx
)
const
double
dz
,
const
double
ltx
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addWedge
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addWedge
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
ltx
)){
(
outTag
,
x
,
y
,
z
,
dx
,
dy
,
dz
,
ltx
)){
...
@@ -1271,8 +1271,8 @@ GMSH_API gmshModelOccAddTorus(const int tag, const double x, const double y,
...
@@ -1271,8 +1271,8 @@ GMSH_API gmshModelOccAddTorus(const int tag, const double x, const double y,
const
double
z
,
const
double
r1
,
const
double
r2
,
const
double
z
,
const
double
r1
,
const
double
r2
,
const
double
angle
)
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
int
outTag
=
tag
;
int
outTag
=
tag
;
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addTorus
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addTorus
(
outTag
,
x
,
y
,
z
,
r1
,
r2
,
angle
)){
(
outTag
,
x
,
y
,
z
,
r1
,
r2
,
angle
)){
...
@@ -1286,8 +1286,8 @@ GMSH_API gmshModelOccAddThruSections(const int tag, const std::vector<int> &wire
...
@@ -1286,8 +1286,8 @@ GMSH_API gmshModelOccAddThruSections(const int tag, const std::vector<int> &wire
vector_pair
&
outDimTags
,
const
bool
makeSolid
,
vector_pair
&
outDimTags
,
const
bool
makeSolid
,
const
bool
makeRuled
)
const
bool
makeRuled
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addThruSections
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addThruSections
(
tag
,
wireTags
,
makeSolid
,
makeRuled
,
outDimTags
))
(
tag
,
wireTags
,
makeSolid
,
makeRuled
,
outDimTags
))
...
@@ -1299,8 +1299,8 @@ GMSH_API addThickSolid(const int tag, const int solidTag,
...
@@ -1299,8 +1299,8 @@ GMSH_API addThickSolid(const int tag, const int solidTag,
const
std
::
vector
<
int
>
&
excludeFaceTags
,
const
std
::
vector
<
int
>
&
excludeFaceTags
,
const
double
offset
,
vector_pair
&
outDimTags
)
const
double
offset
,
vector_pair
&
outDimTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addThickSolid
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addThickSolid
(
tag
,
solidTag
,
excludeFaceTags
,
offset
,
outDimTags
))
(
tag
,
solidTag
,
excludeFaceTags
,
offset
,
outDimTags
))
...
@@ -1315,12 +1315,12 @@ GMSH_API gmshModelOccExtrude(const vector_pair &inDimTags,
...
@@ -1315,12 +1315,12 @@ GMSH_API gmshModelOccExtrude(const vector_pair &inDimTags,
const
std
::
vector
<
double
>
&
heights
,
const
std
::
vector
<
double
>
&
heights
,
const
bool
recombine
)
const
bool
recombine
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
extrude
if
(
GModel
::
current
()
->
getOCCInternals
()
->
extrude
(
inDimTags
,
dx
,
dy
,
dz
,
outDimTags
,
(
inDimTags
,
dx
,
dy
,
dz
,
outDimTags
,
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
_
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
...
@@ -1333,12 +1333,12 @@ GMSH_API gmshModelOccRevolve(const vector_pair &inDimTags,
...
@@ -1333,12 +1333,12 @@ GMSH_API gmshModelOccRevolve(const vector_pair &inDimTags,
const
std
::
vector
<
double
>
&
heights
,
const
std
::
vector
<
double
>
&
heights
,
const
bool
recombine
)
const
bool
recombine
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
revolve
if
(
GModel
::
current
()
->
getOCCInternals
()
->
revolve
(
inDimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
,
outDimTags
,
(
inDimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
,
outDimTags
,
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
_
getExtrudeParams
(
numElements
,
heights
,
recombine
)))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
}
}
...
@@ -1346,8 +1346,8 @@ GMSH_API gmshModelOccRevolve(const vector_pair &inDimTags,
...
@@ -1346,8 +1346,8 @@ GMSH_API gmshModelOccRevolve(const vector_pair &inDimTags,
GMSH_API
gmshModelOccAddPipe
(
const
vector_pair
&
inDimTags
,
const
int
wireTag
,
GMSH_API
gmshModelOccAddPipe
(
const
vector_pair
&
inDimTags
,
const
int
wireTag
,
vector_pair
&
outDimTags
)
vector_pair
&
outDimTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addPipe
if
(
GModel
::
current
()
->
getOCCInternals
()
->
addPipe
(
inDimTags
,
wireTag
,
outDimTags
))
(
inDimTags
,
wireTag
,
outDimTags
))
...
@@ -1360,8 +1360,8 @@ GMSH_API gmshModelOccFillet(const std::vector<int> ®ionTags,
...
@@ -1360,8 +1360,8 @@ GMSH_API gmshModelOccFillet(const std::vector<int> ®ionTags,
const
double
radius
,
vector_pair
&
outDimTags
,
const
double
radius
,
vector_pair
&
outDimTags
,
const
bool
removeRegion
)
const
bool
removeRegion
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
fillet
if
(
GModel
::
current
()
->
getOCCInternals
()
->
fillet
(
regionTags
,
edgeTags
,
radius
,
outDimTags
,
removeRegion
))
(
regionTags
,
edgeTags
,
radius
,
outDimTags
,
removeRegion
))
...
@@ -1377,8 +1377,8 @@ GMSH_API gmshModelOccBooleanUnion(const int tag,
...
@@ -1377,8 +1377,8 @@ GMSH_API gmshModelOccBooleanUnion(const int tag,
const
bool
removeObject
,
const
bool
removeObject
,
const
bool
removeTool
)
const
bool
removeTool
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
outDimTagsMap
.
clear
();
outDimTagsMap
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanUnion
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanUnion
...
@@ -1396,8 +1396,8 @@ GMSH_API gmshModelOccBooleanIntersection(const int tag,
...
@@ -1396,8 +1396,8 @@ GMSH_API gmshModelOccBooleanIntersection(const int tag,
const
bool
removeObject
,
const
bool
removeObject
,
const
bool
removeTool
)
const
bool
removeTool
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
outDimTagsMap
.
clear
();
outDimTagsMap
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanIntersection
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanIntersection
...
@@ -1415,8 +1415,8 @@ GMSH_API gmshModelOccBooleanDifference(const int tag,
...
@@ -1415,8 +1415,8 @@ GMSH_API gmshModelOccBooleanDifference(const int tag,
const
bool
removeObject
,
const
bool
removeObject
,
const
bool
removeTool
)
const
bool
removeTool
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
outDimTagsMap
.
clear
();
outDimTagsMap
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanDifference
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanDifference
...
@@ -1434,8 +1434,8 @@ GMSH_API gmshModelOccBooleanFragments(const int tag,
...
@@ -1434,8 +1434,8 @@ GMSH_API gmshModelOccBooleanFragments(const int tag,
const
bool
removeObject
,
const
bool
removeObject
,
const
bool
removeTool
)
const
bool
removeTool
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
outDimTagsMap
.
clear
();
outDimTagsMap
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanFragments
if
(
GModel
::
current
()
->
getOCCInternals
()
->
booleanFragments
...
@@ -1448,8 +1448,8 @@ GMSH_API gmshModelOccBooleanFragments(const int tag,
...
@@ -1448,8 +1448,8 @@ GMSH_API gmshModelOccBooleanFragments(const int tag,
GMSH_API
gmshModelOccTranslate
(
const
vector_pair
&
dimTags
,
const
double
dx
,
GMSH_API
gmshModelOccTranslate
(
const
vector_pair
&
dimTags
,
const
double
dx
,
const
double
dy
,
const
double
dz
)
const
double
dy
,
const
double
dz
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
translate
(
dimTags
,
dx
,
dy
,
dz
))
if
(
GModel
::
current
()
->
getOCCInternals
()
->
translate
(
dimTags
,
dx
,
dy
,
dz
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -1459,8 +1459,8 @@ GMSH_API gmshModelOccRotate(const vector_pair &dimTags, const double x,
...
@@ -1459,8 +1459,8 @@ GMSH_API gmshModelOccRotate(const vector_pair &dimTags, const double x,
const
double
y
,
const
double
z
,
const
double
ax
,
const
double
y
,
const
double
z
,
const
double
ax
,
const
double
ay
,
const
double
az
,
const
double
angle
)
const
double
ay
,
const
double
az
,
const
double
angle
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
rotate
if
(
GModel
::
current
()
->
getOCCInternals
()
->
rotate
(
dimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
))
(
dimTags
,
x
,
y
,
z
,
ax
,
ay
,
az
,
angle
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -1471,8 +1471,8 @@ GMSH_API gmshModelOccDilate(const vector_pair &dimTags, const double x,
...
@@ -1471,8 +1471,8 @@ GMSH_API gmshModelOccDilate(const vector_pair &dimTags, const double x,
const
double
y
,
const
double
z
,
const
double
a
,
const
double
y
,
const
double
z
,
const
double
a
,
const
double
b
,
const
double
c
)
const
double
b
,
const
double
c
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
dilate
if
(
GModel
::
current
()
->
getOCCInternals
()
->
dilate
(
dimTags
,
x
,
y
,
z
,
a
,
b
,
c
))
(
dimTags
,
x
,
y
,
z
,
a
,
b
,
c
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -1482,8 +1482,8 @@ GMSH_API gmshModelOccDilate(const vector_pair &dimTags, const double x,
...
@@ -1482,8 +1482,8 @@ GMSH_API gmshModelOccDilate(const vector_pair &dimTags, const double x,
GMSH_API
gmshModelOccSymmetry
(
const
vector_pair
&
dimTags
,
const
double
a
,
GMSH_API
gmshModelOccSymmetry
(
const
vector_pair
&
dimTags
,
const
double
a
,
const
double
b
,
const
double
c
,
const
double
d
)
const
double
b
,
const
double
c
,
const
double
d
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
symmetry
if
(
GModel
::
current
()
->
getOCCInternals
()
->
symmetry
(
dimTags
,
a
,
b
,
c
,
d
))
(
dimTags
,
a
,
b
,
c
,
d
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -1492,8 +1492,8 @@ GMSH_API gmshModelOccSymmetry(const vector_pair &dimTags, const double a,
...
@@ -1492,8 +1492,8 @@ GMSH_API gmshModelOccSymmetry(const vector_pair &dimTags, const double a,
GMSH_API
gmshModelOccCopy
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
)
GMSH_API
gmshModelOccCopy
(
const
vector_pair
&
inDimTags
,
vector_pair
&
outDimTags
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
copy
(
inDimTags
,
outDimTags
))
if
(
GModel
::
current
()
->
getOCCInternals
()
->
copy
(
inDimTags
,
outDimTags
))
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -1502,8 +1502,8 @@ GMSH_API gmshModelOccCopy(const vector_pair &inDimTags, vector_pair &outDimTags)
...
@@ -1502,8 +1502,8 @@ GMSH_API gmshModelOccCopy(const vector_pair &inDimTags, vector_pair &outDimTags)
GMSH_API
gmshModelOccRemove
(
const
vector_pair
&
dimTags
,
const
bool
recursive
)
GMSH_API
gmshModelOccRemove
(
const
vector_pair
&
dimTags
,
const
bool
recursive
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
remove
(
dimTags
,
recursive
))
if
(
GModel
::
current
()
->
getOCCInternals
()
->
remove
(
dimTags
,
recursive
))
return
GMSH_OK
;
return
GMSH_OK
;
return
GMSH_ERROR
(
1
);
return
GMSH_ERROR
(
1
);
...
@@ -1511,8 +1511,8 @@ GMSH_API gmshModelOccRemove(const vector_pair &dimTags, const bool recursive)
...
@@ -1511,8 +1511,8 @@ GMSH_API gmshModelOccRemove(const vector_pair &dimTags, const bool recursive)
GMSH_API
gmshModelOccRemoveAllDuplicates
()
GMSH_API
gmshModelOccRemoveAllDuplicates
()
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
GModel
::
current
()
->
getOCCInternals
()
->
removeAllDuplicates
();
GModel
::
current
()
->
getOCCInternals
()
->
removeAllDuplicates
();
return
GMSH_OK
;
return
GMSH_OK
;
}
}
...
@@ -1522,8 +1522,8 @@ GMSH_API gmshModelOccImportShapes(const std::string &fileName,
...
@@ -1522,8 +1522,8 @@ GMSH_API gmshModelOccImportShapes(const std::string &fileName,
const
bool
highestDimOnly
,
const
bool
highestDimOnly
,
const
std
::
string
&
format
)
const
std
::
string
&
format
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
outDimTags
.
clear
();
outDimTags
.
clear
();
if
(
GModel
::
current
()
->
getOCCInternals
()
->
importShapes
if
(
GModel
::
current
()
->
getOCCInternals
()
->
importShapes
(
fileName
,
highestDimOnly
,
outDimTags
,
format
))
(
fileName
,
highestDimOnly
,
outDimTags
,
format
))
...
@@ -1533,8 +1533,8 @@ GMSH_API gmshModelOccImportShapes(const std::string &fileName,
...
@@ -1533,8 +1533,8 @@ GMSH_API gmshModelOccImportShapes(const std::string &fileName,
GMSH_API
gmshModelOccSetMeshSize
(
const
vector_pair
&
dimTags
,
const
double
size
)
GMSH_API
gmshModelOccSetMeshSize
(
const
vector_pair
&
dimTags
,
const
double
size
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
for
(
unsigned
int
i
=
0
;
i
<
dimTags
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
dimTags
.
size
();
i
++
){
int
dim
=
dimTags
[
i
].
first
,
tag
=
dimTags
[
i
].
second
;
int
dim
=
dimTags
[
i
].
first
,
tag
=
dimTags
[
i
].
second
;
GModel
::
current
()
->
getOCCInternals
()
->
setMeshSize
(
dim
,
tag
,
size
);
GModel
::
current
()
->
getOCCInternals
()
->
setMeshSize
(
dim
,
tag
,
size
);
...
@@ -1544,8 +1544,8 @@ GMSH_API gmshModelOccSetMeshSize(const vector_pair &dimTags, const double size)
...
@@ -1544,8 +1544,8 @@ GMSH_API gmshModelOccSetMeshSize(const vector_pair &dimTags, const double size)
GMSH_API
gmshModelOccSynchronize
()
GMSH_API
gmshModelOccSynchronize
()
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
createOcc
();
_
createOcc
();
GModel
::
current
()
->
getOCCInternals
()
->
synchronize
(
GModel
::
current
());
GModel
::
current
()
->
getOCCInternals
()
->
synchronize
(
GModel
::
current
());
return
GMSH_OK
;
return
GMSH_OK
;
}
}
...
@@ -1554,7 +1554,7 @@ GMSH_API gmshModelOccSynchronize()
...
@@ -1554,7 +1554,7 @@ GMSH_API gmshModelOccSynchronize()
GMSH_API
gmshModelFieldCreate
(
const
int
tag
,
const
std
::
string
&
type
)
GMSH_API
gmshModelFieldCreate
(
const
int
tag
,
const
std
::
string
&
type
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
if
(
!
GModel
::
current
()
->
getFields
()
->
newField
(
tag
,
type
)){
if
(
!
GModel
::
current
()
->
getFields
()
->
newField
(
tag
,
type
)){
Msg
::
Error
(
"Cannot create Field %i of type '%s'"
,
tag
,
type
.
c_str
());
Msg
::
Error
(
"Cannot create Field %i of type '%s'"
,
tag
,
type
.
c_str
());
...
@@ -1566,8 +1566,19 @@ GMSH_API gmshModelFieldCreate(const int tag, const std::string &type)
...
@@ -1566,8 +1566,19 @@ GMSH_API gmshModelFieldCreate(const int tag, const std::string &type)
#endif
#endif
}
}
GMSH_API
gmshModelFieldDelete
(
const
int
tag
)
{
if
(
!
_isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
static
FieldOption
*
getFieldOption
(
const
int
tag
,
const
std
::
string
&
option
)
GModel
::
current
()
->
getFields
()
->
deleteField
(
tag
);
return
GMSH_OK
;
#else
return
GMSH_ERROR
(
1
);
#endif
}
#if defined(HAVE_MESH)
static
FieldOption
*
_getFieldOption
(
const
int
tag
,
const
std
::
string
&
option
)
{
{
Field
*
field
=
GModel
::
current
()
->
getFields
()
->
get
(
tag
);
Field
*
field
=
GModel
::
current
()
->
getFields
()
->
get
(
tag
);
if
(
!
field
){
if
(
!
field
){
...
@@ -1587,9 +1598,9 @@ static FieldOption *getFieldOption(const int tag, const std::string &option)
...
@@ -1587,9 +1598,9 @@ static FieldOption *getFieldOption(const int tag, const std::string &option)
GMSH_API
gmshModelFieldSetNumber
(
const
int
tag
,
const
std
::
string
&
option
,
GMSH_API
gmshModelFieldSetNumber
(
const
int
tag
,
const
std
::
string
&
option
,
const
double
value
)
const
double
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
FieldOption
*
o
=
getFieldOption
(
tag
,
option
);
FieldOption
*
o
=
_
getFieldOption
(
tag
,
option
);
if
(
!
o
)
return
GMSH_ERROR
(
1
);
if
(
!
o
)
return
GMSH_ERROR
(
1
);
try
{
o
->
numericalValue
(
value
);
}
try
{
o
->
numericalValue
(
value
);
}
catch
(...){
catch
(...){
...
@@ -1606,9 +1617,9 @@ GMSH_API gmshModelFieldSetNumber(const int tag, const std::string &option,
...
@@ -1606,9 +1617,9 @@ GMSH_API gmshModelFieldSetNumber(const int tag, const std::string &option,
GMSH_API
gmshModelFieldSetString
(
const
int
tag
,
const
std
::
string
&
option
,
GMSH_API
gmshModelFieldSetString
(
const
int
tag
,
const
std
::
string
&
option
,
const
std
::
string
&
value
)
const
std
::
string
&
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
FieldOption
*
o
=
getFieldOption
(
tag
,
option
);
FieldOption
*
o
=
_
getFieldOption
(
tag
,
option
);
if
(
!
o
)
return
GMSH_ERROR
(
1
);
if
(
!
o
)
return
GMSH_ERROR
(
1
);
try
{
o
->
string
(
value
);
}
try
{
o
->
string
(
value
);
}
catch
(...){
catch
(...){
...
@@ -1625,9 +1636,9 @@ GMSH_API gmshModelFieldSetString(const int tag, const std::string &option,
...
@@ -1625,9 +1636,9 @@ GMSH_API gmshModelFieldSetString(const int tag, const std::string &option,
GMSH_API
gmshModelFieldSetNumbers
(
const
int
tag
,
const
std
::
string
&
option
,
GMSH_API
gmshModelFieldSetNumbers
(
const
int
tag
,
const
std
::
string
&
option
,
const
std
::
vector
<
double
>
&
value
)
const
std
::
vector
<
double
>
&
value
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
FieldOption
*
o
=
getFieldOption
(
tag
,
option
);
FieldOption
*
o
=
_
getFieldOption
(
tag
,
option
);
if
(
!
o
)
return
GMSH_ERROR
(
1
);
if
(
!
o
)
return
GMSH_ERROR
(
1
);
try
{
try
{
if
(
o
->
getType
()
==
FIELD_OPTION_LIST
)
{
if
(
o
->
getType
()
==
FIELD_OPTION_LIST
)
{
...
@@ -1656,7 +1667,7 @@ GMSH_API gmshModelFieldSetNumbers(const int tag, const std::string &option,
...
@@ -1656,7 +1667,7 @@ GMSH_API gmshModelFieldSetNumbers(const int tag, const std::string &option,
GMSH_API
gmshModelFieldSetAsBackground
(
const
int
tag
)
GMSH_API
gmshModelFieldSetAsBackground
(
const
int
tag
)
{
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
if
(
!
_
isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
GModel
::
current
()
->
getFields
()
->
setBackgroundFieldId
(
tag
);
GModel
::
current
()
->
getFields
()
->
setBackgroundFieldId
(
tag
);
return
GMSH_OK
;
return
GMSH_OK
;
...
@@ -1665,13 +1676,3 @@ GMSH_API gmshModelFieldSetAsBackground(const int tag)
...
@@ -1665,13 +1676,3 @@ GMSH_API gmshModelFieldSetAsBackground(const int tag)
#endif
#endif
}
}
GMSH_API
gmshModelFieldDelete
(
const
int
tag
)
{
if
(
!
isInitialized
())
return
GMSH_ERROR
(
-
1
);
#if defined(HAVE_MESH)
GModel
::
current
()
->
getFields
()
->
deleteField
(
tag
);
return
GMSH_OK
;
#else
return
GMSH_ERROR
(
1
);
#endif
}
This diff is collapsed.
Click to expand it.
Common/gmsh.h
+
2
−
2
View file @
93d7a46d
...
@@ -49,8 +49,8 @@ GMSH_API gmshOptionGetString(const std::string &name, std::string &value);
...
@@ -49,8 +49,8 @@ GMSH_API gmshOptionGetString(const std::string &name, std::string &value);
// gmshModel
// gmshModel
GMSH_API
gmshModelCreate
(
const
std
::
string
&
name
);
GMSH_API
gmshModelCreate
(
const
std
::
string
&
name
);
GMSH_API
gmshModelDelete
();
GMSH_API
gmshModelSetCurrent
(
const
std
::
string
&
name
);
GMSH_API
gmshModelSetCurrent
(
const
std
::
string
&
name
);
GMSH_API
gmshModelDestroy
();
GMSH_API
gmshModelGetEntities
(
vector_pair
&
dimTags
,
const
int
dim
=-
1
);
GMSH_API
gmshModelGetEntities
(
vector_pair
&
dimTags
,
const
int
dim
=-
1
);
GMSH_API
gmshModelGetPhysicalGroups
(
vector_pair
&
dimTags
,
const
int
dim
=-
1
);
GMSH_API
gmshModelGetPhysicalGroups
(
vector_pair
&
dimTags
,
const
int
dim
=-
1
);
GMSH_API
gmshModelAddPhysicalGroup
(
const
int
dim
,
const
int
tag
,
GMSH_API
gmshModelAddPhysicalGroup
(
const
int
dim
,
const
int
tag
,
...
@@ -293,6 +293,7 @@ GMSH_API gmshModelOccSynchronize();
...
@@ -293,6 +293,7 @@ GMSH_API gmshModelOccSynchronize();
// gmshModelField
// gmshModelField
GMSH_API
gmshModelFieldCreate
(
const
int
tag
,
const
std
::
string
&
type
);
GMSH_API
gmshModelFieldCreate
(
const
int
tag
,
const
std
::
string
&
type
);
GMSH_API
gmshModelFieldDelete
(
const
int
tag
);
GMSH_API
gmshModelFieldSetNumber
(
const
int
tag
,
const
std
::
string
&
option
,
GMSH_API
gmshModelFieldSetNumber
(
const
int
tag
,
const
std
::
string
&
option
,
const
double
value
);
const
double
value
);
GMSH_API
gmshModelFieldSetString
(
const
int
tag
,
const
std
::
string
&
option
,
GMSH_API
gmshModelFieldSetString
(
const
int
tag
,
const
std
::
string
&
option
,
...
@@ -300,7 +301,6 @@ GMSH_API gmshModelFieldSetString(const int tag, const std::string &option,
...
@@ -300,7 +301,6 @@ GMSH_API gmshModelFieldSetString(const int tag, const std::string &option,
GMSH_API
gmshModelFieldSetNumbers
(
const
int
tag
,
const
std
::
string
&
option
,
GMSH_API
gmshModelFieldSetNumbers
(
const
int
tag
,
const
std
::
string
&
option
,
const
std
::
vector
<
double
>
&
value
);
const
std
::
vector
<
double
>
&
value
);
GMSH_API
gmshModelFieldSetAsBackground
(
const
int
tag
);
GMSH_API
gmshModelFieldSetAsBackground
(
const
int
tag
);
GMSH_API
gmshModelFieldDelete
(
const
int
tag
);
// gmshView
// gmshView
...
...
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