Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
6ee6a598
Commit
6ee6a598
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
merge both writeMSH routines
parent
a0ff1498
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/GModelIO_Mesh.cpp
+4
-7
4 additions, 7 deletions
Geo/GModelIO_Mesh.cpp
Geo/MVertex.cpp
+40
-50
40 additions, 50 deletions
Geo/MVertex.cpp
Geo/MVertex.h
+2
-2
2 additions, 2 deletions
Geo/MVertex.h
Mesh/meshGFace.cpp
+1
-1
1 addition, 1 deletion
Mesh/meshGFace.cpp
with
47 additions
and
60 deletions
Geo/GModelIO_Mesh.cpp
+
4
−
7
View file @
6ee6a598
...
@@ -533,12 +533,9 @@ int GModel::writeMSH(const std::string &name, double version, bool binary,
...
@@ -533,12 +533,9 @@ int GModel::writeMSH(const std::string &name, double version, bool binary,
std
::
vector
<
GEntity
*>
entities
;
std
::
vector
<
GEntity
*>
entities
;
getEntities
(
entities
);
getEntities
(
entities
);
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
mesh_vertices
.
size
();
j
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
mesh_vertices
.
size
();
j
++
)
if
(
!
saveParametric
)
entities
[
i
]
->
mesh_vertices
[
j
]
->
writeMSH
(
fp
,
binary
,
saveParametric
,
entities
[
i
]
->
mesh_vertices
[
j
]
->
writeMSH
(
fp
,
binary
,
scalingFactor
);
scalingFactor
);
else
entities
[
i
]
->
mesh_vertices
[
j
]
->
writeMSH3
(
fp
,
binary
,
scalingFactor
);
}
if
(
binary
)
fprintf
(
fp
,
"
\n
"
);
if
(
binary
)
fprintf
(
fp
,
"
\n
"
);
if
(
version
>=
2.0
){
if
(
version
>=
2.0
){
...
...
This diff is collapsed.
Click to expand it.
Geo/MVertex.cpp
+
40
−
50
View file @
6ee6a598
...
@@ -25,26 +25,35 @@ bool MVertexLessThanLexicographic::operator()(const MVertex *v1, const MVertex *
...
@@ -25,26 +25,35 @@ bool MVertexLessThanLexicographic::operator()(const MVertex *v1, const MVertex *
return
false
;
return
false
;
}
}
void
MVertex
::
writeMSH
3
(
FILE
*
fp
,
bool
binary
,
double
scalingFactor
)
void
MVertex
::
writeMSH
(
FILE
*
fp
,
bool
binary
,
bool
saveParametric
,
double
scalingFactor
)
{
{
if
(
_index
<
0
)
return
;
// negative index vertices are never saved
if
(
_index
<
0
)
return
;
// negative index vertices are never saved
int
myDim
=
onWhat
()
->
dim
();
int
myTag
=
onWhat
()
->
tag
();
int
myDim
=
0
,
myTag
=
0
;
if
(
saveParametric
&&
onWhat
()){
myDim
=
onWhat
()
->
dim
();
myTag
=
onWhat
()
->
tag
();
}
if
(
!
binary
){
if
(
!
binary
){
fprintf
(
fp
,
"%d %.16g %.16g %.16g %d %d"
,
_index
,
if
(
!
saveParametric
)
x
()
*
scalingFactor
,
fprintf
(
fp
,
"%d %.16g %.16g %.16g
\n
"
,
_index
,
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
);
z
()
*
scalingFactor
,
else
myDim
,
myTag
);
fprintf
(
fp
,
"%d %.16g %.16g %.16g %d %d"
,
_index
,
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
,
myDim
,
myTag
);
}
}
else
{
else
{
fwrite
(
&
_index
,
sizeof
(
int
),
1
,
fp
);
fwrite
(
&
_index
,
sizeof
(
int
),
1
,
fp
);
double
data
[
3
]
=
{
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
};
double
data
[
3
]
=
{
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
};
fwrite
(
data
,
sizeof
(
double
),
3
,
fp
);
fwrite
(
data
,
sizeof
(
double
),
3
,
fp
);
if
(
saveParametric
){
fwrite
(
&
myDim
,
sizeof
(
int
),
1
,
fp
);
fwrite
(
&
myDim
,
sizeof
(
int
),
1
,
fp
);
fwrite
(
&
myTag
,
sizeof
(
int
),
1
,
fp
);
fwrite
(
&
myTag
,
sizeof
(
int
),
1
,
fp
);
}
}
}
if
(
saveParametric
){
if
(
myDim
==
1
){
if
(
myDim
==
1
){
double
_u
;
double
_u
;
getParameter
(
0
,
_u
);
getParameter
(
0
,
_u
);
...
@@ -68,27 +77,8 @@ void MVertex::writeMSH3(FILE *fp, bool binary, double scalingFactor)
...
@@ -68,27 +77,8 @@ void MVertex::writeMSH3(FILE *fp, bool binary, double scalingFactor)
if
(
!
binary
)
if
(
!
binary
)
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"
\n
"
);
}
}
void
MVertex
::
writeMSH
(
FILE
*
fp
,
bool
binary
,
double
scalingFactor
)
{
if
(
_index
<
0
)
return
;
// negative index vertices are never saved
if
(
!
binary
){
fprintf
(
fp
,
"%d %.16g %.16g %.16g
\n
"
,
_index
,
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
);
}
else
{
fwrite
(
&
_index
,
sizeof
(
int
),
1
,
fp
);
double
data
[
3
]
=
{
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
};
fwrite
(
data
,
sizeof
(
double
),
3
,
fp
);
}
}
}
void
MVertex
::
writeVRML
(
FILE
*
fp
,
double
scalingFactor
)
void
MVertex
::
writeVRML
(
FILE
*
fp
,
double
scalingFactor
)
{
{
if
(
_index
<
0
)
return
;
// negative index vertices are never saved
if
(
_index
<
0
)
return
;
// negative index vertices are never saved
...
...
This diff is collapsed.
Click to expand it.
Geo/MVertex.h
+
2
−
2
View file @
6ee6a598
...
@@ -106,8 +106,8 @@ class MVertex{
...
@@ -106,8 +106,8 @@ class MVertex{
linearSearch
(
std
::
set
<
MVertex
*
,
MVertexLessThanLexicographic
>
&
pos
);
linearSearch
(
std
::
set
<
MVertex
*
,
MVertexLessThanLexicographic
>
&
pos
);
// IO routines
// IO routines
void
writeMSH
(
FILE
*
fp
,
bool
binary
=
false
,
double
scalingFactor
=
1.0
);
void
writeMSH
(
FILE
*
fp
,
bool
binary
=
false
,
bool
saveParametric
=
false
,
void
writeMSH3
(
FILE
*
fp
,
bool
binary
=
false
,
double
scalingFactor
=
1.0
);
double
scalingFactor
=
1.0
);
void
writeVRML
(
FILE
*
fp
,
double
scalingFactor
=
1.0
);
void
writeVRML
(
FILE
*
fp
,
double
scalingFactor
=
1.0
);
void
writeUNV
(
FILE
*
fp
,
double
scalingFactor
=
1.0
);
void
writeUNV
(
FILE
*
fp
,
double
scalingFactor
=
1.0
);
void
writeVTK
(
FILE
*
fp
,
bool
binary
=
false
,
double
scalingFactor
=
1.0
,
void
writeVTK
(
FILE
*
fp
,
bool
binary
=
false
,
double
scalingFactor
=
1.0
,
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGFace.cpp
+
1
−
1
View file @
6ee6a598
...
@@ -1279,7 +1279,7 @@ void deMeshGFace::operator() (GFace *gf)
...
@@ -1279,7 +1279,7 @@ void deMeshGFace::operator() (GFace *gf)
gf
->
meshStatistics
.
nbTriangle
=
gf
->
meshStatistics
.
nbEdge
=
0
;
gf
->
meshStatistics
.
nbTriangle
=
gf
->
meshStatistics
.
nbEdge
=
0
;
}
}
const
int
debugSurface
=
-
1
00
;
const
int
debugSurface
=
-
1
;
void
meshGFace
::
operator
()
(
GFace
*
gf
)
void
meshGFace
::
operator
()
(
GFace
*
gf
)
{
{
...
...
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