Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
4a9ee3eb
Commit
4a9ee3eb
authored
Aug 13, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorganize print and output of Function3d
parent
94c8878f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
Function3d.C
src/Function3d.C
+15
-3
Function3d.h
src/Function3d.h
+2
-0
No files found.
src/Function3d.C
View file @
4a9ee3eb
...
...
@@ -169,7 +169,14 @@ void Function3d::read(string filename)
}
////////////////////////////////////////////////////////////////////////////////
void
Function3d
::
write
(
std
::
string
filename
)
const
void
Function3d
::
write
(
string
filename
)
const
{
ofstream
os
(
filename
.
c_str
());
print
(
os
);
}
////////////////////////////////////////////////////////////////////////////////
void
Function3d
::
print
(
ostream
&
os
)
const
{
Base64Transcoder
xcdr
;
#if PLT_BIG_ENDIAN
...
...
@@ -181,7 +188,6 @@ void Function3d::write(std::string filename) const
char
*
wbuf
=
new
char
[
nchars
];
xcdr
.
encode
(
nbytes
,
(
byte
*
)
&
val
[
0
],
wbuf
);
ofstream
os
(
filename
.
c_str
());
os
<<
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>
\n
"
<<
"<fpmd:function3d xmlns:fpmd=
\"
"
<<
qbox_xmlns
()
...
...
@@ -202,6 +208,12 @@ void Function3d::write(std::string filename) const
xcdr
.
print
(
nchars
,
wbuf
,
os
);
os
<<
"</grid_function>"
<<
endl
;
os
<<
"</fpmd:function3d>"
<<
endl
;
os
.
close
();
delete
[]
wbuf
;
}
////////////////////////////////////////////////////////////////////////////////
ostream
&
operator
<<
(
ostream
&
os
,
const
Function3d
&
f
)
{
f
.
print
(
os
);
return
os
;
}
src/Function3d.h
View file @
4a9ee3eb
...
...
@@ -34,5 +34,7 @@ class Function3d
std
::
vector
<
double
>
val
;
void
read
(
std
::
string
filename
);
void
write
(
std
::
string
filename
)
const
;
void
print
(
std
::
ostream
&
os
)
const
;
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Function3d
&
f
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment