Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-grid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Core Modules
dune-grid
Commits
07269e47
There was a problem fetching the pipeline summary.
Commit
07269e47
authored
8 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
Use range-based for loops
parent
971773b5
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/grid/uggrid/uglbgatherscatter.hh
+11
-15
11 additions, 15 deletions
dune/grid/uggrid/uglbgatherscatter.hh
with
11 additions
and
15 deletions
dune/grid/uggrid/uglbgatherscatter.hh
+
11
−
15
View file @
07269e47
...
...
@@ -32,7 +32,7 @@ namespace Dune {
}
LBMessageBuffer
()
:
count_
(
0
),
data_
(
0
)
:
count_
(
0
),
data_
(
nullptr
)
{}
private
:
...
...
@@ -55,19 +55,17 @@ namespace Dune {
// write the data into a global vector on process 0
// write the macrogrid index of each entity into the corresponding UG vector
typedef
typename
GridView
::
template
Codim
<
codim
>
::
Iterator
Iterator
;
Iterator
it
=
gridView
.
template
begin
<
codim
>();
const
Iterator
&
endIt
=
gridView
.
template
end
<
codim
>();
for
(;
it
!=
endIt
;
++
it
)
{
int
numberOfParams
=
dataHandle
.
size
(
*
it
);
for
(
const
auto
entity
:
entities
(
gridView
,
Codim
<
codim
>
()))
{
int
numberOfParams
=
dataHandle
.
size
(
entity
);
if
(
!
numberOfParams
)
continue
;
// obtain data from DUNE handle and write it into the UG message buffer
LBMessageBuffer
lbMessageBuffer
;
dataHandle
.
gather
(
lbMessageBuffer
,
*
it
);
dataHandle
.
gather
(
lbMessageBuffer
,
ent
it
y
);
char
*&
buffer
=
gridView
.
grid
().
getRealImplementation
(
*
it
).
getTarget
()
->
message_buffer
;
char
*&
buffer
=
gridView
.
grid
().
getRealImplementation
(
ent
it
y
).
getTarget
()
->
message_buffer
;
assert
(
not
buffer
);
typedef
typename
DataHandle
::
DataType
DataType
;
...
...
@@ -95,16 +93,14 @@ namespace Dune {
// obtain the data from the global vector with help of
// the macro index and scatter it
typedef
typename
GridView
::
template
Codim
<
codim
>
::
Iterator
Iterator
;
Iterator
it
=
gridView
.
template
begin
<
codim
>();
const
Iterator
&
endIt
=
gridView
.
template
end
<
codim
>();
for
(;
it
!=
endIt
;
++
it
)
{
int
numberOfParams
=
dataHandle
.
size
(
*
it
);
for
(
const
auto
entity
:
entities
(
gridView
,
Codim
<
codim
>
()))
{
int
numberOfParams
=
dataHandle
.
size
(
entity
);
if
(
!
numberOfParams
)
continue
;
// get data from UG message buffer and write to DUNE message buffer
char
*&
buffer
=
gridView
.
grid
().
getRealImplementation
(
*
it
).
getTarget
()
->
message_buffer
;
char
*&
buffer
=
gridView
.
grid
().
getRealImplementation
(
ent
it
y
).
getTarget
()
->
message_buffer
;
assert
(
buffer
);
LBMessageBuffer
lbMessageBuffer
;
...
...
@@ -117,7 +113,7 @@ namespace Dune {
}
// call the data handle with the message buffer
dataHandle
.
scatter
(
lbMessageBuffer
,
*
it
,
numberOfParams
);
dataHandle
.
scatter
(
lbMessageBuffer
,
ent
it
y
,
numberOfParams
);
// free object's local message buffer
free
(
buffer
);
...
...
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