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
a578e7d2
Commit
a578e7d2
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
move writeTXT into generic IO
parent
99fd4e7a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Post/PViewData.h
+2
-2
2 additions, 2 deletions
Post/PViewData.h
Post/PViewDataIO.cpp
+32
-1
32 additions, 1 deletion
Post/PViewDataIO.cpp
Post/PViewDataList.h
+0
-1
0 additions, 1 deletion
Post/PViewDataList.h
Post/PViewDataListIO.cpp
+1
-52
1 addition, 52 deletions
Post/PViewDataListIO.cpp
with
35 additions
and
56 deletions
Post/PViewData.h
+
2
−
2
View file @
a578e7d2
...
...
@@ -85,7 +85,7 @@ class PViewData {
// Returns the comp-th component (at the step-th time step)
// associated with the node-th node from the ele-th element in the
// ent-th entity
virtual
void
getValue
(
int
ent
,
int
ele
,
int
nod
e
,
int
comp
,
int
step
,
double
&
val
)
=
0
;
virtual
void
getValue
(
int
ent
,
int
ele
,
int
nod
,
int
comp
,
int
step
,
double
&
val
)
=
0
;
// Returns the number of edges of the ele-th element in the ent-th
// entity
virtual
int
getNumEdges
(
int
ent
,
int
ele
)
=
0
;
...
...
@@ -105,9 +105,9 @@ class PViewData {
// I/O routines
virtual
bool
writeSTL
(
std
::
string
name
);
virtual
bool
writeTXT
(
std
::
string
name
);
virtual
bool
writePOS
(
std
::
string
name
,
bool
binary
=
false
,
bool
parsed
=
true
,
bool
append
=
false
){
return
false
;
}
virtual
bool
writeTXT
(
std
::
string
name
){
return
false
;
}
virtual
bool
writeMSH
(
std
::
string
name
){
return
false
;
}
};
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataIO.cpp
+
32
−
1
View file @
a578e7d2
// $Id: PViewDataIO.cpp,v 1.
1
2008-02-24
19:59:03
geuzaine Exp $
// $Id: PViewDataIO.cpp,v 1.
2
2008-02-24
21:37:46
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -82,3 +82,34 @@ bool PViewData::writeSTL(std::string name)
fclose
(
fp
);
return
true
;
}
bool
PViewDataList
::
writeTXT
(
std
::
string
name
)
{
FILE
*
fp
=
fopen
(
name
.
c_str
(),
"w"
);
if
(
!
fp
){
Msg
(
GERROR
,
"Unable to open file '%s'"
,
name
.
c_str
());
return
false
;
}
for
(
int
ent
=
0
;
ent
<
getNumEntities
();
ent
++
){
for
(
int
ele
=
0
;
ele
<
getNumElements
(
ent
);
ele
++
){
for
(
int
nod
=
0
;
nod
<
getNumNodes
(
ent
,
ele
);
nod
++
){
double
x
,
y
,
z
;
getNode
(
ent
,
ele
,
nod
,
x
,
y
,
z
);
fprintf
(
file
,
"%.16g %.16g %.16g "
,
x
,
y
,
z
);
for
(
int
step
=
0
;
step
<
getNumTimeSteps
();
step
++
){
for
(
int
comp
=
0
;
comp
<
getNumComponents
(
ent
,
ele
);
comp
++
){
double
val
;
getValue
(
ent
,
ele
,
nod
,
comp
,
step
,
val
);
fprintf
(
file
,
"%.16g "
,
val
);
}
}
}
fprintf
(
file
,
"
\n
"
);
}
fprintf
(
file
,
"
\n
"
);
}
fclose
(
fp
);
return
true
;
}
This diff is collapsed.
Click to expand it.
Post/PViewDataList.h
+
0
−
1
View file @
a578e7d2
...
...
@@ -118,7 +118,6 @@ class PViewDataList : public PViewData {
bool
readPOS
(
FILE
*
fp
,
double
version
,
int
format
,
int
size
);
bool
writePOS
(
std
::
string
name
,
bool
binary
=
false
,
bool
parsed
=
true
,
bool
append
=
false
);
bool
writeTXT
(
std
::
string
name
);
bool
writeMSH
(
std
::
string
name
);
};
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataListIO.cpp
+
1
−
52
View file @
a578e7d2
// $Id: PViewDataListIO.cpp,v 1.1
0
2008-02-24
19:59:03
geuzaine Exp $
// $Id: PViewDataListIO.cpp,v 1.1
1
2008-02-24
21:37:46
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -396,57 +396,6 @@ bool PViewDataList::writePOS(std::string name, bool binary, bool parsed, bool ap
return
true
;
}
static
void
writeElementTXT
(
FILE
*
file
,
int
nbelm
,
List_T
*
list
,
int
nbnod
,
int
nbcomp
,
int
nbtime
)
{
if
(
!
nbelm
)
return
;
int
nb
=
List_Nbr
(
list
)
/
nbelm
;
for
(
int
i
=
0
;
i
<
List_Nbr
(
list
);
i
+=
nb
){
double
*
x
=
(
double
*
)
List_Pointer
(
list
,
i
);
for
(
int
j
=
0
;
j
<
nbnod
*
(
3
+
nbcomp
*
nbtime
);
j
++
)
fprintf
(
file
,
"%.16g "
,
x
[
j
]);
fprintf
(
file
,
"
\n
"
);
}
fprintf
(
file
,
"
\n
"
);
}
bool
PViewDataList
::
writeTXT
(
std
::
string
name
)
{
FILE
*
fp
=
fopen
(
name
.
c_str
(),
"w"
);
if
(
!
fp
){
Msg
(
GERROR
,
"Unable to open file '%s'"
,
name
.
c_str
());
return
false
;
}
writeElementTXT
(
fp
,
NbSP
,
SP
,
1
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVP
,
VP
,
1
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTP
,
TP
,
1
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbSL
,
SL
,
2
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVL
,
VL
,
2
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTL
,
TL
,
2
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbST
,
ST
,
3
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVT
,
VT
,
3
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTT
,
TT
,
3
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbSQ
,
SQ
,
4
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVQ
,
VQ
,
4
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTQ
,
TQ
,
4
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbSS
,
SS
,
4
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVS
,
VS
,
4
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTS
,
TS
,
4
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbSH
,
SH
,
8
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVH
,
VH
,
8
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTH
,
TH
,
8
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbSI
,
SI
,
6
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVI
,
VI
,
6
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTI
,
TI
,
6
,
9
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbSY
,
SY
,
5
,
1
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbVY
,
VY
,
5
,
3
,
NbTimeStep
);
writeElementTXT
(
fp
,
NbTY
,
TY
,
5
,
9
,
NbTimeStep
);
fclose
(
fp
);
return
true
;
}
class
pVertex
{
public:
int
Num
;
...
...
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