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
636cfd6e
Commit
636cfd6e
authored
12 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
fix comments.
Former-commit-id: 6ebc43a797faeab64f73ae9665142dff5e3a0633
parent
4148e298
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/debug.h
+1
-0
1 addition, 0 deletions
src/debug.h
src/engine.c
+3
-4
3 additions, 4 deletions
src/engine.c
src/part.h
+1
-1
1 addition, 1 deletion
src/part.h
src/runner.c
+5
-2
5 additions, 2 deletions
src/runner.c
with
10 additions
and
7 deletions
src/debug.h
+
1
−
0
View file @
636cfd6e
...
...
@@ -21,3 +21,4 @@
void
printParticle
(
struct
part
*
parts
,
long
long
int
i
,
int
N
);
void
printParticle_single
(
struct
part
*
p
);
This diff is collapsed.
Click to expand it.
src/engine.c
+
3
−
4
View file @
636cfd6e
...
...
@@ -506,8 +506,7 @@ void engine_step ( struct engine *e , int sort_queues ) {
// for(k=0; k<10; ++k)
// printParticle(parts, k);
// printParticle( parts , 432626 );
// printParticle( parts , 432628 );
// printParticle( e->s->parts , 382557 , e->s->nr_parts );
/* Prepare the space. */
engine_prepare
(
e
);
...
...
@@ -538,7 +537,7 @@ void engine_step ( struct engine *e , int sort_queues ) {
/* Stop the clock. */
TIMER_TOC
(
timer_runners
);
// engine_single_force( e->s->dim , 6178 , e->s->parts , e->s->nr_parts , e->s->periodic );
// for(k=0; k<10; ++k)
...
...
@@ -560,7 +559,7 @@ void engine_step ( struct engine *e , int sort_queues ) {
}
e
->
dt_min
=
dt_min
;
// printParticle( parts ,
432626
);
// printParticle(
e->s->
parts ,
382557 , e->s->nr_parts
);
printf
(
"engine_step: dt_min/dt_max is %e/%e.
\n
"
,
dt_min
,
dt_max
);
fflush
(
stdout
);
printf
(
"engine_step: etot is %e (ekin=%e, epot=%e).
\n
"
,
ekin
+
epot
,
ekin
,
epot
);
fflush
(
stdout
);
printf
(
"engine_step: total momentum is [ %e , %e , %e ].
\n
"
,
mom
[
0
]
,
mom
[
1
]
,
mom
[
2
]
);
fflush
(
stdout
);
...
...
This diff is collapsed.
Click to expand it.
src/part.h
+
1
−
1
View file @
636cfd6e
...
...
@@ -119,7 +119,7 @@ struct part {
/* Sound speed */
float
c
;
}
force
;
};
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
5
−
2
View file @
636cfd6e
...
...
@@ -382,18 +382,21 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
wcount
=
(
p
->
density
.
wcount
+
kernel_root
)
*
(
4
.
0
f
/
3
.
0
*
M_PI
*
kernel_gamma3
);
wcount_dh
=
p
->
density
.
wcount_dh
*
ih
*
(
4
.
0
f
/
3
.
0
*
M_PI
*
kernel_gamma3
);
/*
Comput
e the smoothing length
update (Newton step)
. */
/*
If no derivative, doubl
e the smoothing length. */
if
(
wcount_dh
==
0
.
0
f
)
h_corr
=
p
->
h
;
/* Otherwise, compute the smoothing length update (Newton step). */
else
{
h_corr
=
(
const_nwneigh
-
wcount
)
/
wcount_dh
;
/* Truncate to the range [ -p->h/2 , p->h ]. */
h_corr
=
fminf
(
h_corr
,
h
);
h_corr
=
fmaxf
(
h_corr
,
-
h
/
2
);
}
/* Apply the correction to p->h. */
/* Apply the correction to p->h
and to the compact part
. */
p
->
h
+=
h_corr
;
cp
->
h
=
p
->
h
;
...
...
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