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
Sten Delos
Gadget4
Commits
745db9f5
Commit
745db9f5
authored
Mar 18, 2021
by
Volker Springel
Browse files
fix for joint use of SECOND_ORDER_LPT_ICS and GENERATE_GAS_IN_ICS
parent
01e6b156
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/init.cc
View file @
745db9f5
...
...
@@ -129,7 +129,6 @@ void sim::init(int RestartSnapNum)
Mem
.
myfree
(
tmp
);
int
count
=
0
;
for
(
int
i
=
0
;
i
<
Sp
.
NumPart
;
i
++
)
#ifdef SPLIT_PARTICLE_TYPE
...
...
@@ -190,6 +189,11 @@ void sim::init(int RestartSnapNum)
Sp
.
P
[
j
].
setMass
(
Sp
.
P
[
j
].
getMass
()
*
fac
);
Sp
.
P
[
i
].
setMass
(
Sp
.
P
[
i
].
getMass
()
*
(
1
-
fac
));
#ifdef SECOND_ORDER_LPT_ICS
Sp
.
P
[
j
].
OldAcc
*=
fac
;
Sp
.
P
[
i
].
OldAcc
*=
(
1
-
fac
);
#endif
Sp
.
P
[
j
].
setType
(
0
);
#if NSOFTCLASSES > 1
Sp
.
P
[
j
].
setSofteningClass
(
All
.
SofteningClassOfPartType
[
0
]);
...
...
@@ -477,7 +481,7 @@ void sim::init(int RestartSnapNum)
*/
#ifdef PRESSURE_ENTROPY_SPH
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
NgbTree
.
setup_entropy_to_invgamma
();
NgbTree
.
setup_entropy_to_invgamma
();
#endif
#endif
...
...
@@ -485,15 +489,15 @@ void sim::init(int RestartSnapNum)
for
(
int
i
=
0
;
i
<
Sp
.
NumGas
;
i
++
)
{
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
if
(
ThisTask
==
0
&&
i
==
0
)
printf
(
"INIT: Converting u -> entropy
\n
"
);
if
(
ThisTask
==
0
&&
i
==
0
)
printf
(
"INIT: Converting u -> entropy
\n
"
);
#if !defined(PRESSURE_ENTROPY_SPH) && !defined(ISOTHERM_EQS)
Sp
.
SphP
[
i
].
Entropy
=
GAMMA_MINUS1
*
Sp
.
SphP
[
i
].
Entropy
/
pow
(
Sp
.
SphP
[
i
].
Density
*
All
.
cf_a3inv
,
GAMMA_MINUS1
);
Sp
.
SphP
[
i
].
Entropy
=
GAMMA_MINUS1
*
Sp
.
SphP
[
i
].
Entropy
/
pow
(
Sp
.
SphP
[
i
].
Density
*
All
.
cf_a3inv
,
GAMMA_MINUS1
);
#endif
Sp
.
SphP
[
i
].
EntropyPred
=
Sp
.
SphP
[
i
].
Entropy
;
Sp
.
SphP
[
i
].
EntropyPred
=
Sp
.
SphP
[
i
].
Entropy
;
#endif
/* The predicted entropy values have been already set for all SPH formulation */
/* so it should be ok computing pressure and csound now */
...
...
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