Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_pdata
Commits
8d63cbb3
Commit
8d63cbb3
authored
Dec 09, 2014
by
incardon
Browse files
Added CartesianGraphFactory
parent
8da66acc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Graph/CartesianGraphFactory.hpp
View file @
8d63cbb3
...
...
@@ -48,7 +48,7 @@ public:
*
*/
template
<
unsigned
int
se
,
typename
T
,
unsigned
int
dim_c
>
static
void
construct
(
std
::
vector
<
size_t
>
sz
,
Box
<
dim
,
T
>
dom
)
static
Graph
construct
(
std
::
vector
<
size_t
>
sz
,
Box
<
dim
,
T
>
dom
)
{
#ifdef DEBUG
//! The size is wrong signal it
...
...
@@ -91,7 +91,7 @@ public:
//! Iterate through all the elements
while
(
k_it
.
is
End
())
while
(
k_it
.
is
Next
())
{
grid_key_dx
<
dim
>
key
=
k_it
.
get
();
...
...
@@ -115,25 +115,24 @@ public:
for
(
int
s
=
0
;
s
<
dim
;
s
++
)
{
ele_sz
+=
szd
[
s
]
*
c
[
j
][
s
];
ele_sz
+=
szd
[
s
]
*
abs
(
c
[
j
][
s
]
)
;
}
// Calculate the end point vertex id
// Calculate the start point id
size_t
start_v
=
g
.
LinId
(
key
);
size_t
end_v
=
g
.
template
LinId
<
CheckExistence
>(
key
,
c
[
j
]);
size_t
end_v
=
g
.
template
LinId
<
CheckExistence
>(
key
,
c
[
j
]
.
getComb
()
);
// set up the edge
gp
.
template
addEdge
<
CheckExistence
>(
start_v
,
end_v
).
set
<
se
>
(
ele_sz
);
// Add an edge and set the se edge property to the size of the face (communication weight)
gp
.
template
addEdge
<
CheckExistence
>(
start_v
,
end_v
).
template
get
<
se
>()
=
ele_sz
;
}
}
++
k_it
;
}
return
;
return
gp
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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