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
add04d34
Commit
add04d34
authored
10 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
fix rounding errors in initial gridding.
Former-commit-id: 168b1f7d0cf58c029fd92aaf1f0726c24734af2e
parent
dbe01a6d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+3
-6
3 additions, 6 deletions
src/engine.c
with
3 additions
and
6 deletions
src/engine.c
+
3
−
6
View file @
add04d34
...
@@ -1948,7 +1948,6 @@ void engine_makeproxies ( struct engine *e ) {
...
@@ -1948,7 +1948,6 @@ void engine_makeproxies ( struct engine *e ) {
void
engine_split
(
struct
engine
*
e
,
int
*
grid
)
{
void
engine_split
(
struct
engine
*
e
,
int
*
grid
)
{
int
j
,
k
;
int
j
,
k
;
float
scale
[
3
];
int
ind
[
3
];
int
ind
[
3
];
struct
space
*
s
=
e
->
s
;
struct
space
*
s
=
e
->
s
;
struct
cell
*
c
;
struct
cell
*
c
;
...
@@ -1957,16 +1956,14 @@ void engine_split ( struct engine *e , int *grid ) {
...
@@ -1957,16 +1956,14 @@ void engine_split ( struct engine *e , int *grid ) {
if
(
e
->
nr_nodes
!=
grid
[
0
]
*
grid
[
1
]
*
grid
[
2
]
)
if
(
e
->
nr_nodes
!=
grid
[
0
]
*
grid
[
1
]
*
grid
[
2
]
)
error
(
"Grid size does not match number of nodes."
);
error
(
"Grid size does not match number of nodes."
);
/* Get the scale. */
for
(
j
=
0
;
j
<
3
;
j
++
)
scale
[
j
]
=
((
float
)
grid
[
j
])
/
s
->
cdim
[
j
];
/* Run through the cells and set their nodeID. */
/* Run through the cells and set their nodeID. */
// message("s->dim = [%e,%e,%e]", s->dim[0], s->dim[1], s->dim[2]);
for
(
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
{
for
(
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
{
c
=
&
s
->
cells
[
k
];
c
=
&
s
->
cells
[
k
];
for
(
j
=
0
;
j
<
3
;
j
++
)
for
(
j
=
0
;
j
<
3
;
j
++
)
ind
[
j
]
=
c
->
loc
[
j
]
*
s
->
ih
[
j
]
*
scale
[
j
];
ind
[
j
]
=
c
->
loc
[
j
]
/
s
->
dim
[
j
]
*
grid
[
j
];
c
->
nodeID
=
ind
[
0
]
+
grid
[
0
]
*
(
ind
[
1
]
+
grid
[
1
]
*
ind
[
2
]
);
c
->
nodeID
=
ind
[
0
]
+
grid
[
0
]
*
(
ind
[
1
]
+
grid
[
1
]
*
ind
[
2
]
);
// message("cell at [%e,%e,%e]: ind = [%i,%i,%i], nodeID = %i", c->loc[0], c->loc[1], c->loc[2], ind[0], ind[1], ind[2], c->nodeID);
}
}
/* Make the proxies. */
/* Make the proxies. */
...
...
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