Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Timo Koch
dune-common
Commits
0d8b0995
Commit
0d8b0995
authored
20 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
some cleanup in communicate()
[[Imported from SVN: r1773]]
parent
b624e2cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grid/uggrid/uggrid.cc
+14
-41
14 additions, 41 deletions
grid/uggrid/uggrid.cc
with
14 additions
and
41 deletions
grid/uggrid/uggrid.cc
+
14
−
41
View file @
0d8b0995
...
...
@@ -561,35 +561,23 @@ void UGGrid < dim, dimworld >::loadBalance(int strategy, int minlevel, int depth
}
#ifdef ModelP
template
<
class
T
,
template
<
class
>
class
P
>
class
Foo
{
template
<
class
T
,
template
<
class
>
class
P
,
int
GridDim
>
class
UGDataCollector
{
public:
static
int
gather
(
DDD_OBJ
obj
,
void
*
data
)
{
int
codim
=
0
;
#ifdef _2
enum
{
dim
=
2
};
#else
enum
{
dim
=
3
};
#endif
P
<
T
>*
p
=
(
P
<
T
>*
)
data
;
int
index
=
0
;
switch
(
codim
)
{
case
0
:
#ifdef _2
index
=
((
UG2d
::
element
*
)
obj
)
->
ge
.
id
;
#else
index
=
((
UG3d
::
element
*
)
obj
)
->
ge
.
id
;
#endif
index
=
UG_NS
<
GridDim
>::
index
((
typename
TargetType
<
0
,
GridDim
>::
T
*
)
obj
);
break
;
case
dim
:
#ifdef _2
index
=
((
UG2d
::
node
*
)
obj
)
->
id
;
#else
index
=
((
UG3d
::
node
*
)
obj
)
->
id
;
#endif
case
GridDim
:
index
=
UG_NS
<
GridDim
>::
index
((
typename
TargetType
<
GridDim
,
GridDim
>::
T
*
)
obj
);
break
;
default
:
DUNE_THROW
(
GridError
,
"UGGrid::communicate only implemented for this codim"
);
...
...
@@ -603,29 +591,16 @@ public:
static
int
scatter
(
DDD_OBJ
obj
,
void
*
data
)
{
int
codim
=
0
;
#ifdef _2
enum
{
dim
=
2
};
#else
enum
{
dim
=
3
};
#endif
P
<
T
>*
p
=
(
P
<
T
>*
)
data
;
int
index
=
0
;
switch
(
codim
)
{
case
0
:
#ifdef _2
index
=
((
UG2d
::
element
*
)
obj
)
->
ge
.
id
;
#else
index
=
((
UG3d
::
element
*
)
obj
)
->
ge
.
id
;
#endif
index
=
UG_NS
<
GridDim
>::
index
((
typename
TargetType
<
0
,
GridDim
>::
T
*
)
obj
);
break
;
case
dim
:
#ifdef _2
index
=
((
UG2d
::
node
*
)
obj
)
->
id
;
#else
index
=
((
UG3d
::
node
*
)
obj
)
->
id
;
#endif
case
GridDim
:
index
=
UG_NS
<
GridDim
>::
index
((
typename
TargetType
<
GridDim
,
GridDim
>::
T
*
)
obj
);
break
;
default
:
DUNE_THROW
(
GridError
,
"UGGrid::communicate only implemented for codim 0 and dim"
);
...
...
@@ -640,8 +615,8 @@ public:
};
template
<
class
T
,
template
<
class
>
class
P
>
T
*
Foo
<
T
,
P
>::
dataArray
=
0
;
template
<
class
T
,
template
<
class
>
class
P
,
int
GridDim
>
T
*
UGDataCollector
<
T
,
P
,
GridDim
>::
dataArray
=
0
;
#endif
template
<
int
dim
,
int
dimworld
>
...
...
@@ -649,16 +624,14 @@ template<class T, template<class> class P, int codim>
void
UGGrid
<
dim
,
dimworld
>::
communicate
(
T
&
t
,
InterfaceType
iftype
,
CommunicationDirection
dir
,
int
level
)
{
#ifdef ModelP
Foo
<
T
,
P
>
foo
;
Foo
<
T
,
P
>::
dataArray
=
&
t
;
UGDataCollector
<
T
,
P
,
dim
>::
dataArray
=
&
t
;
/** \todo Should be in a namespace */
DDD_IFAExchange
(
UG
::
ElementIF
,
UG_NS
<
dim
>::
Grid_Attr
(
multigrid_
->
grids
[
level
]),
sizeof
(
P
<
T
>
),
&
Foo
<
T
,
P
>::
gather
,
&
Foo
<
T
,
P
>::
scatter
);
&
UGDataCollector
<
T
,
P
,
dim
>::
gather
,
&
UGDataCollector
<
T
,
P
,
dim
>::
scatter
);
#endif
}
...
...
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