Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
dd2a9870
Commit
dd2a9870
authored
12 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
corrections to the time step selection.
Former-commit-id: ad42c06acc3d785ba5d38293a27e6f37b48b109c
parent
430f0209
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/const.h
+1
-1
1 addition, 1 deletion
src/const.h
src/engine.c
+3
-3
3 additions, 3 deletions
src/engine.c
src/runner.c
+8
-3
8 additions, 3 deletions
src/runner.c
src/runner_iact.h
+2
-2
2 additions, 2 deletions
src/runner_iact.h
with
14 additions
and
9 deletions
src/const.h
+
1
−
1
View file @
dd2a9870
...
...
@@ -25,7 +25,7 @@
/* Time integration constants. */
#define const_cfl 0.3f
#define const_ln_max_h_change
log(1.26f)
/* Particle can't change volume by more than a factor of 2=1.26^3 over one time step */
#define const_ln_max_h_change
0.231111721f
/* Particle can't change volume by more than a factor of 2=1.26^3 over one time step */
/* Neighbour search constants. */
#define const_eta_kernel 1.1272f
/* Corresponds to 48 ngbs with the cubic spline kernel */
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
3
−
3
View file @
dd2a9870
...
...
@@ -514,7 +514,7 @@ void engine_step ( struct engine *e , int sort_queues ) {
}
}
// engine_single_density( e->s->dim ,
494748
, e->s->parts , e->s->nr_parts , e->s->periodic );
// engine_single_density( e->s->dim ,
7503966371841
, e->s->parts , e->s->nr_parts , e->s->periodic );
/* Start the clock. */
TIMER_TIC_ND
...
...
@@ -532,12 +532,12 @@ void engine_step ( struct engine *e , int sort_queues ) {
/* Stop the clock. */
TIMER_TOC
(
timer_runners
);
// engine_single_force( e->s->dim ,
494748
, e->s->parts , e->s->nr_parts , e->s->periodic );
// engine_single_force( e->s->dim ,
7503966371841
, e->s->parts , e->s->nr_parts , e->s->periodic );
// for(k=0; k<10; ++k)
// printParticle(parts, k);
// printParticle( parts , 432626 );
// printParticle( e->s->parts ,
494748
, e->s->nr_parts );
// printParticle( e->s->parts ,
7503966371841
, e->s->nr_parts );
/* Collect the cell data from the second kick. */
for
(
k
=
0
;
k
<
e
->
s
->
nr_cells
;
k
++
)
{
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
8
−
3
View file @
dd2a9870
...
...
@@ -545,9 +545,14 @@ void runner_dokick2 ( struct runner *r , struct cell *c ) {
}
/* Update the particle's time step. */
dt_cfl
=
const_cfl
*
h
/
p
->
force
.
v_sig
;
dt_h_change
=
const_ln_max_h_change
*
h
/
p
->
force
.
h_dt
;
p
->
dt
=
pdt
=
fminf
(
dt_cfl
,
dt_h_change
);
dt_cfl
=
const_cfl
*
h
/
p
->
force
.
v_sig
;
dt_h_change
=
fabsf
(
const_ln_max_h_change
*
h
/
p
->
force
.
h_dt
);
if
(
pdt
==
0
.
0
f
)
p
->
dt
=
pdt
=
fminf
(
dt_cfl
,
dt_h_change
);
else
if
(
pdt
<=
dt_step
)
p
->
dt
=
pdt
=
fminf
(
fminf
(
dt_cfl
,
dt_h_change
)
,
2
.
0
f
*
pdt
);
else
p
->
dt
=
pdt
=
fminf
(
fminf
(
dt_cfl
,
dt_h_change
)
,
pdt
);
/* Update positions and energies at the half-step. */
p
->
v
[
0
]
=
v
[
0
]
=
xp
->
v_old
[
0
]
+
hdt
*
p
->
a
[
0
];
...
...
This diff is collapsed.
Click to expand it.
src/runner_iact.h
+
2
−
2
View file @
dd2a9870
...
...
@@ -409,7 +409,7 @@ __attribute__ ((always_inline)) INLINE static void runner_iact_force ( float r2
/* Volker's modified viscosity */
dt_max
=
fmaxf
(
pi
->
dt
,
pj
->
dt
);
if
(
dt_max
>
0
&&
(
wi_dr
+
wj_dr
)
<
0
.)
Pi_ij
=
fminf
(
Pi_ij
,
2
.
f
*
omega_ij
/
(
(
mi
+
mj
)
*
(
wi_dr
+
wj_dr
)
*
dt_max
)
);
Pi_ij
=
fminf
(
Pi_ij
,
2
.
f
*
omega_ij
/
(
(
mi
+
mj
)
*
(
wi_dr
+
wj_dr
)
*
dt_max
)
);
/* Get the common factor out. */
w
=
ri
*
(
(
POrho2i
*
wi_dr
+
POrho2j
*
wj_dr
)
+
0
.
25
f
*
Pi_ij
*
(
wi_dr
+
wj_dr
)
);
...
...
@@ -645,7 +645,7 @@ __attribute__ ((always_inline)) INLINE static void runner_iact_nonsym_force ( fl
/* Volker's modified viscosity */
dt_max
=
fmaxf
(
pi
->
dt
,
pj
->
dt
);
if
(
dt_max
>
0
&&
(
wi_dr
+
wj_dr
)
<
0
.)
Pi_ij
=
fminf
(
Pi_ij
,
2
.
f
*
omega_ij
/
(
(
mi
+
mj
)
*
(
wi_dr
+
wj_dr
)
*
dt_max
)
);
Pi_ij
=
fminf
(
Pi_ij
,
2
.
f
*
omega_ij
/
(
(
mi
+
mj
)
*
(
wi_dr
+
wj_dr
)
*
dt_max
)
);
/* Get the common factor out. */
w
=
ri
*
(
(
POrho2i
*
wi_dr
+
POrho2j
*
wj_dr
)
+
0
.
25
f
*
Pi_ij
*
(
wi_dr
+
wj_dr
)
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment