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
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide 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,14 +533,11 @@ int GModel::writeMSH(const std::string &name, double version, bool binary,
std
::
vector
<
GEntity
*>
entities
;
getEntities
(
entities
);
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
mesh_vertices
.
size
();
j
++
){
if
(
!
saveParametric
)
entities
[
i
]
->
mesh_vertices
[
j
]
->
writeMSH
(
fp
,
binary
,
scalingFactor
);
else
entities
[
i
]
->
mesh_vertices
[
j
]
->
writeMSH3
(
fp
,
binary
,
scalingFactor
);
}
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
mesh_vertices
.
size
();
j
++
)
entities
[
i
]
->
mesh_vertices
[
j
]
->
writeMSH
(
fp
,
binary
,
saveParametric
,
scalingFactor
);
if
(
binary
)
fprintf
(
fp
,
"
\n
"
);
if
(
version
>=
2.0
){
if
(
saveParametric
)
fprintf
(
fp
,
"$EndParametricNodes
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Geo/MVertex.cpp
+
40
−
50
View file @
6ee6a598
...
...
@@ -25,69 +25,59 @@ bool MVertexLessThanLexicographic::operator()(const MVertex *v1, const MVertex *
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
int
myDim
=
onWhat
()
->
dim
();
int
myTag
=
onWhat
()
->
tag
();
if
(
!
binary
){
fprintf
(
fp
,
"%d %.16g %.16g %.16g %d %d"
,
_index
,
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
,
myDim
,
myTag
);
}
else
{
fwrite
(
&
_index
,
sizeof
(
int
),
1
,
fp
);
double
data
[
3
]
=
{
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
};
fwrite
(
data
,
sizeof
(
double
),
3
,
fp
);
fwrite
(
&
myDim
,
sizeof
(
int
),
1
,
fp
);
fwrite
(
&
myTag
,
sizeof
(
int
),
1
,
fp
);
}
if
(
myDim
==
1
){
double
_u
;
getParameter
(
0
,
_u
);
if
(
!
binary
)
fprintf
(
fp
,
" %.16g
\n
"
,
_u
);
else
fwrite
(
&
_u
,
sizeof
(
double
),
1
,
fp
);
}
else
if
(
myDim
==
2
){
double
_u
,
_v
;
getParameter
(
0
,
_u
);
getParameter
(
1
,
_v
);
if
(
!
binary
)
fprintf
(
fp
,
" %.16g %.16g
\n
"
,
_u
,
_v
);
else
{
fwrite
(
&
_u
,
sizeof
(
double
),
1
,
fp
);
fwrite
(
&
_v
,
sizeof
(
double
),
1
,
fp
);
}
int
myDim
=
0
,
myTag
=
0
;
if
(
saveParametric
&&
onWhat
()){
myDim
=
onWhat
()
->
dim
();
myTag
=
onWhat
()
->
tag
();
}
else
if
(
!
binary
)
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
);
if
(
!
saveParametric
)
fprintf
(
fp
,
"%d %.16g %.16g %.16g
\n
"
,
_index
,
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
);
else
fprintf
(
fp
,
"%d %.16g %.16g %.16g %d %d"
,
_index
,
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
,
myDim
,
myTag
);
}
else
{
fwrite
(
&
_index
,
sizeof
(
int
),
1
,
fp
);
double
data
[
3
]
=
{
x
()
*
scalingFactor
,
y
()
*
scalingFactor
,
z
()
*
scalingFactor
};
fwrite
(
data
,
sizeof
(
double
),
3
,
fp
);
if
(
saveParametric
){
fwrite
(
&
myDim
,
sizeof
(
int
),
1
,
fp
);
fwrite
(
&
myTag
,
sizeof
(
int
),
1
,
fp
);
}
}
}
if
(
saveParametric
){
if
(
myDim
==
1
){
double
_u
;
getParameter
(
0
,
_u
);
if
(
!
binary
)
fprintf
(
fp
,
" %.16g
\n
"
,
_u
);
else
fwrite
(
&
_u
,
sizeof
(
double
),
1
,
fp
);
}
else
if
(
myDim
==
2
){
double
_u
,
_v
;
getParameter
(
0
,
_u
);
getParameter
(
1
,
_v
);
if
(
!
binary
)
fprintf
(
fp
,
" %.16g %.16g
\n
"
,
_u
,
_v
);
else
{
fwrite
(
&
_u
,
sizeof
(
double
),
1
,
fp
);
fwrite
(
&
_v
,
sizeof
(
double
),
1
,
fp
);
}
}
else
if
(
!
binary
)
fprintf
(
fp
,
"
\n
"
);
}
}
void
MVertex
::
writeVRML
(
FILE
*
fp
,
double
scalingFactor
)
{
...
...
This diff is collapsed.
Click to expand it.
Geo/MVertex.h
+
2
−
2
View file @
6ee6a598
...
...
@@ -106,8 +106,8 @@ class MVertex{
linearSearch
(
std
::
set
<
MVertex
*
,
MVertexLessThanLexicographic
>
&
pos
);
// IO routines
void
writeMSH
(
FILE
*
fp
,
bool
binary
=
false
,
double
scalingFactor
=
1.0
);
void
writeMSH3
(
FILE
*
fp
,
bool
binary
=
false
,
double
scalingFactor
=
1.0
);
void
writeMSH
(
FILE
*
fp
,
bool
binary
=
false
,
bool
saveParametric
=
false
,
double
scalingFactor
=
1.0
);
void
writeVRML
(
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
,
...
...
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)
gf
->
meshStatistics
.
nbTriangle
=
gf
->
meshStatistics
.
nbEdge
=
0
;
}
const
int
debugSurface
=
-
1
00
;
const
int
debugSurface
=
-
1
;
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