Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
eb763953
Commit
eb763953
authored
Jun 06, 2016
by
Peter W. Draper
Browse files
Make the domain decomposition parameters optional
parent
0119a458
Changes
7
Hide whitespace changes
Inline
Side-by-side
examples/CosmoVolume/cosmoVolume.yml
View file @
eb763953
...
...
@@ -46,11 +46,3 @@ SPH:
InitialConditions
:
file_name
:
./cosmoVolume.hdf5
# The file to read
# Parameters govering domain decomposition
DomainDecomposition
:
initial_type
:
m
# The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x
:
10
# Grid size if the 'g' strategy is chosen.
initial_grid_y
:
10
initial_grid_z
:
10
repartition_type
:
b
# The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
examples/ExternalPointMass/externalPointMass.yml
View file @
eb763953
...
...
@@ -44,15 +44,6 @@ InitialConditions:
shift_y
:
50.
shift_z
:
50.
# Parameters govering domain decomposition
DomainDecomposition
:
initial_type
:
m
# The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x
:
10
# Grid size if the 'g' strategy is chosen.
initial_grid_y
:
10
initial_grid_z
:
10
repartition_type
:
b
# The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
# External potential parameters
PointMass
:
position_x
:
50.
# location of external point mass in internal units
...
...
examples/SedovBlast/sedov.yml
View file @
eb763953
...
...
@@ -41,11 +41,3 @@ SPH:
InitialConditions
:
file_name
:
./sedov.hdf5
# The file to read
# Parameters govering domain decomposition
DomainDecomposition
:
initial_type
:
m
# The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x
:
10
# Grid size if the 'g' strategy is chosen.
initial_grid_y
:
10
initial_grid_z
:
10
repartition_type
:
b
# The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
examples/SodShock/sodShock.yml
View file @
eb763953
...
...
@@ -41,11 +41,3 @@ SPH:
InitialConditions
:
file_name
:
./sodShock.hdf5
# The file to read
# Parameters govering domain decomposition
DomainDecomposition
:
initial_type
:
m
# The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x
:
10
# Grid size if the 'g' strategy is chosen.
initial_grid_y
:
10
initial_grid_z
:
10
repartition_type
:
b
# The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
examples/UniformBox/uniformBox.yml
View file @
eb763953
...
...
@@ -40,12 +40,3 @@ SPH:
# Parameters related to the initial conditions
InitialConditions
:
file_name
:
./uniformBox.hdf5
# The file to read
# Parameters govering domain decomposition
DomainDecomposition
:
initial_type
:
m
# The initial strategy ("g", "m", "w", or "v"). See documentation for details.
initial_grid_x
:
10
# Grid size if the 'g' strategy is chosen.
initial_grid_y
:
10
initial_grid_z
:
10
repartition_type
:
b
# The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
examples/parameter_example.yml
View file @
eb763953
...
...
@@ -54,11 +54,11 @@ InitialConditions:
# Parameters govering domain decomposition
DomainDecomposition
:
initial_type
:
m
# The initial strategy ("g", "m", "w", or "v").
See documentation for details.
initial_grid_x
:
10
# Grid size if the
'g'
strategy is chosen.
initial_type
:
m
#
(Optional)
The initial strategy ("g", "m", "w", or "v").
initial_grid_x
:
10
#
(Optional)
Grid size if the
"g"
strategy is chosen.
initial_grid_y
:
10
initial_grid_z
:
10
repartition_type
:
b
# The re-decomposition strategy ("n", "b", "v", "e" or "x").
See documentation for details.
repartition_type
:
b
#
(Optional)
The re-decomposition strategy ("n", "b", "v", "e" or "x").
# Parameters related to external potentials
...
...
src/partition.c
View file @
eb763953
...
...
@@ -921,11 +921,11 @@ void partition_init(struct partition *partition,
/* Defaults make use of METIS if available */
#ifdef HAVE_METIS
*
reparttype
=
REPART_METIS_BOTH
;
partition
->
type
=
INITPART_METIS_NOWEIGHT
;
char
default_repart
=
'b'
;
;
char
default_part
=
'm'
;
#else
*
reparttype
=
REPART_NONE
;
partition
->
type
=
INITPART_GRID
;
char
default_repart
=
'n'
;
char
default_part
=
'g'
;
#endif
/* Set a default grid so that grid[0]*grid[1]*grid[2] == nr_nodes. */
...
...
@@ -935,9 +935,10 @@ void partition_init(struct partition *partition,
factor
(
partition
->
grid
[
0
]
*
partition
->
grid
[
1
],
&
partition
->
grid
[
1
],
&
partition
->
grid
[
0
]);
/* Now let's check what the user wants as an initial domain*/
/* Now let's check what the user wants as an initial domain
.
*/
const
char
part_type
=
parser_get_param_char
(
params
,
"DomainDecomposition:initial_type"
);
parser_get_opt_param_char
(
params
,
"DomainDecomposition:initial_type"
,
default_part
);
switch
(
part_type
)
{
case
'g'
:
...
...
@@ -966,16 +967,21 @@ void partition_init(struct partition *partition,
/* In case of grid, read more parameters */
if
(
part_type
==
'g'
)
{
partition
->
grid
[
0
]
=
parser_get_param_int
(
params
,
"DomainDecomposition:initial_grid_x"
);
parser_get_opt_param_int
(
params
,
"DomainDecomposition:initial_grid_x"
,
partition
->
grid
[
0
]);
partition
->
grid
[
1
]
=
parser_get_param_int
(
params
,
"DomainDecomposition:initial_grid_y"
);
parser_get_opt_param_int
(
params
,
"DomainDecomposition:initial_grid_y"
,
partition
->
grid
[
1
]);
partition
->
grid
[
2
]
=
parser_get_param_int
(
params
,
"DomainDecomposition:initial_grid_z"
);
parser_get_opt_param_int
(
params
,
"DomainDecomposition:initial_grid_z"
,
partition
->
grid
[
2
]);
}
/* Now let's check what the user wants as a repartition strategy */
const
char
repart_type
=
parser_get_param_char
(
params
,
"DomainDecomposition:repartition_type"
);
parser_get_opt_param_char
(
params
,
"DomainDecomposition:repartition_type"
,
default_repart
);
switch
(
repart_type
)
{
case
'n'
:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment