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
2183e1f8
Commit
2183e1f8
authored
Aug 19, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add output in cube format
parent
dc27c68b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
testFunction3d.C
src/testFunction3d.C
+26
-5
No files found.
src/testFunction3d.C
View file @
2183e1f8
...
...
@@ -16,11 +16,14 @@
//
////////////////////////////////////////////////////////////////////////////////
#include<iostream>
#include<iomanip>
#include "Function3d.h"
using
namespace
std
;
// usage: ./testFunction3d file.xml
// Read a Function3d from an XML file and print contents as a cube file
int
main
(
int
argc
,
char
**
argv
)
{
Function3d
f
;
...
...
@@ -42,12 +45,30 @@ int main(int argc, char** argv)
}
cout
<<
"function norm2: "
<<
sum
/
f
.
val
.
size
()
<<
endl
;
// modify function
f
.
name
=
"output"
;
f
.
write
(
"output.xml"
);
// output data in cube format on stdout
cout
<<
"Created by testFunction3d"
<<
endl
;
cout
<<
endl
;
cout
<<
"8 0 0 0"
<<
endl
;
cout
<<
f
.
nx
<<
" "
<<
f
.
a
/
f
.
nx
<<
endl
;
cout
<<
f
.
ny
<<
" "
<<
f
.
b
/
f
.
ny
<<
endl
;
cout
<<
f
.
nz
<<
" "
<<
f
.
c
/
f
.
nz
<<
endl
;
cout
<<
"1 1 0.0 0.0 0.0"
<<
endl
;
cout
<<
"1 1 "
<<
f
.
a
<<
endl
;
cout
<<
"1 1 "
<<
f
.
b
<<
endl
;
cout
<<
"1 1 "
<<
f
.
c
<<
endl
;
cout
<<
"1 1 "
<<
f
.
a
+
f
.
b
<<
endl
;
cout
<<
"1 1 "
<<
f
.
b
+
f
.
c
<<
endl
;
cout
<<
"1 1 "
<<
f
.
c
+
f
.
a
<<
endl
;
cout
<<
"1 1 "
<<
f
.
a
+
f
.
b
+
f
.
c
<<
endl
;
cout
.
setf
(
ios
::
scientific
,
ios
::
floatfield
);
cout
.
precision
(
5
);
for
(
int
i
=
0
;
i
<
f
.
val
.
size
();
i
++
)
{
f
.
val
[
i
]
*=
0
.
5
;
cout
<<
setw
(
13
)
<<
f
.
val
[
i
];
if
(
(
(
i
+
1
)
%
6
)
==
0
)
cout
<<
endl
;
}
f
.
write
(
"output.xml"
);
cout
<<
endl
;
}
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