Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
d3b1dce3
Commit
d3b1dce3
authored
May 16, 2017
by
student
Browse files
Change test
parent
fc825d55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Examples/Octree/main_light.cpp
View file @
d3b1dce3
...
...
@@ -202,7 +202,7 @@ void redistribute(int type)
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
n
[
3
]
=
{
2
,
4
,
1
};
int
n
[
3
]
=
{
2
0
,
4
0
,
1
};
thegrid
.
transformation
=
transformation
;
thegrid
.
rev_transformation
=
rev_transformation
;
...
...
@@ -222,7 +222,8 @@ int main(int argc, char ** argv)
std
::
cout
<<
"gridAMR"
<<
std
::
endl
;
gridAMR
(
&
thegrid
,
0
);
std
::
cout
<<
"redistribute"
<<
std
::
endl
;
redistribute
(
3
);
redistribute
(
1
);
std
::
cout
<<
"after redistribute "
<<
thegrid
.
mesh
->
NumberOfCells
()
<<
std
::
endl
;
thegrid
.
mesh
->
Save
(
"end.pvtk"
);
Partitioner
::
Finalize
();
Mesh
::
Finalize
();
...
...
Examples/Octree/main_test.cpp
View file @
d3b1dce3
...
...
@@ -248,7 +248,7 @@ void print_help()
cout
<<
" x - redistribute grid"
<<
endl
;
}
void
parse_arguments
(
int
argc
,
char
**
argv
,
int
*
n
,
double
*
R
,
int
*
L
,
int
*
log
)
void
parse_arguments
(
int
argc
,
char
**
argv
,
int
*
n
,
double
*
R
,
int
*
L
,
int
*
log
,
int
*
iters_count
,
double
*
h
)
{
if
(
argc
<
2
)
return
;
...
...
@@ -291,10 +291,18 @@ void parse_arguments(int argc, char** argv, int* n, double* R, int* L, int* log)
{
*
L
=
atoi
(
str2
.
c_str
());
}
else
if
(
str1
==
"-h"
)
{
sscanf
(
str2
.
c_str
(),
"%lf"
,
h
);
}
else
if
(
str1
==
"-log"
)
{
*
log
=
atoi
(
str2
.
c_str
());
}
else
if
(
str1
==
"-i"
)
{
*
iters_count
=
atoi
(
str2
.
c_str
());
}
else
{
cout
<<
"Invalid command: "
<<
str1
<<
endl
;
...
...
@@ -307,6 +315,8 @@ int main(int argc, char ** argv)
{
int
i
;
int
n
[
3
]
=
{
10
,
10
,
1
};
int
iters_count
=
10
;
double
h
=
0.02
;
thegrid
.
transformation
=
transformation
;
thegrid
.
rev_transformation
=
rev_transformation
;
...
...
@@ -316,7 +326,7 @@ int main(int argc, char ** argv)
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&::
rank
);
if
(
::
rank
==
0
)
print_help
();
parse_arguments
(
argc
,
argv
,
n
,
&
base_radius
,
&
refine_depth
,
&
log_level
);
parse_arguments
(
argc
,
argv
,
n
,
&
base_radius
,
&
refine_depth
,
&
log_level
,
&
iters_count
,
&
h
);
all_cells_count
=
n
[
0
]
*
n
[
1
]
*
n
[
2
]
*
2
;
gridInit
(
&
thegrid
,
n
);
...
...
@@ -327,15 +337,22 @@ int main(int argc, char ** argv)
//dump_to_vtk();
if
(
::
rank
==
0
)
cout
<<
"Test start"
<<
endl
;
if
(
::
rank
==
0
)
{
cout
<<
"Test start: "
<<
endl
;
cout
<<
"Size: "
<<
n
[
0
]
<<
"x"
<<
n
[
1
]
<<
"x"
<<
n
[
2
]
<<
endl
;
cout
<<
"Radius: "
<<
base_radius
<<
endl
;
cout
<<
"Refine depth: "
<<
refine_depth
<<
endl
;
cout
<<
"Iters count: "
<<
iters_count
<<
endl
;
cout
<<
"Step: "
<<
h
<<
endl
;
cout
<<
"Processors: "
<<
::
size
<<
endl
;
}
{
{
mx
=
0.1
;
my
=
0.5
;
int
iters_count
=
10
;
// double h = 0.8 / iters_count;
// double h = 0.03;
double
h
=
0.05
;
int
i
=
0
;
BARRIER
double
st
=
Timer
();
...
...
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