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
b1e918c5
Commit
b1e918c5
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
adapted combined displays to new changes of evaluation process.
[[Imported from SVN: r3541]]
parent
65a0983d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io/visual/combinedgrapedisplay.hh
+16
-4
16 additions, 4 deletions
io/visual/combinedgrapedisplay.hh
io/visual/grape/combinedgrapedisplay.cc
+56
-11
56 additions, 11 deletions
io/visual/grape/combinedgrapedisplay.cc
with
72 additions
and
15 deletions
io/visual/combinedgrapedisplay.hh
+
16
−
4
View file @
b1e918c5
...
...
@@ -15,6 +15,10 @@
namespace
Dune
{
/*! \brief
* Combines GrapeDataDisplays to one so that visualisation for parallel
* grid is more easy to handle.
*/
template
<
class
DisplayType
>
class
CombinedGrapeDisplay
{
...
...
@@ -36,12 +40,14 @@ namespace Dune
DisplayListIteratorType
grditer_
;
DisplayListIteratorType
enditer_
;
// pointer to actual display
DisplayType
*
disp_
;
DUNE_ELEM
*
dhel_
;
// actual element data
DUNE_ELEM
hel_
;
public
:
// no better way than this canot export HMESH structure to here
...
...
@@ -123,10 +129,19 @@ namespace Dune
inline
static
int
fst_child
(
DUNE_ELEM
*
he
);
inline
static
int
nxt_child
(
DUNE_ELEM
*
he
);
//! calles evalCoord for data of actual display
inline
void
evalCoord
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
df
,
const
double
*
coord
,
double
*
val
);
//! calles evalDof for data of actual display
inline
void
evalDof
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
df
,
int
localNum
,
double
*
val
);
//! functions pointer for calling evaluate in ghmesh
//! just calles evalCoord for actual display
inline
static
void
evalCoordWrap
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
df
,
const
double
*
coord
,
double
*
val
);
//! functions pointer for calling evaluate in ghmesh
//! just calles evalDof for actual display
inline
static
void
evalDofWrap
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
df
,
int
localNum
,
double
*
val
);
// function to evaluate data
inline
static
void
func_real
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
fe
,
int
ind
,
...
...
@@ -134,11 +149,8 @@ namespace Dune
};
// end class GrapeGridDisplay
}
// end namespace Dune
#include
"grape/combinedgrapedisplay.cc"
#endif
This diff is collapsed.
Click to expand it.
io/visual/grape/combinedgrapedisplay.cc
+
56
−
11
View file @
b1e918c5
...
...
@@ -14,13 +14,24 @@ namespace Dune
CombinedGrapeDisplay
()
:
disp_
(
0
)
,
hmesh_
(
0
)
{
GrapeInterface
<
dim
,
dimworld
>::
init
();
//if(!hmesh_) hmesh_ = setupHmesh();
}
template
<
class
DisplayType
>
inline
CombinedGrapeDisplay
<
DisplayType
>::
~
CombinedGrapeDisplay
()
{}
{
for
(
unsigned
int
i
=
0
;
i
<
vecFdata_
.
size
();
i
++
)
{
DUNE_FDATA
*
fd
=
vecFdata_
[
i
];
if
(
fd
)
{
int
*
comps
=
fd
->
comp
;
if
(
comps
)
delete
[]
comps
;
delete
fd
;
vecFdata_
[
i
]
=
0
;
}
}
}
//****************************************************************
...
...
@@ -266,7 +277,7 @@ namespace Dune
{
assert
(
disp_
);
std
::
vector
<
DUNE_FDATA
*
>
&
vec
=
disp_
->
getFdataVec
();
disp_
->
evalCoord
(
he
,
vec
[
df
->
mynum
],
coord
,
val
);
vec
[
df
->
mynum
]
->
evalCoord
(
he
,
vec
[
df
->
mynum
],
coord
,
val
);
return
;
}
...
...
@@ -276,7 +287,27 @@ namespace Dune
{
assert
(
disp_
);
std
::
vector
<
DUNE_FDATA
*
>
&
vec
=
disp_
->
getFdataVec
();
disp_
->
evalDof
(
he
,
vec
[
df
->
mynum
],
localNum
,
val
);
vec
[
df
->
mynum
]
->
evalDof
(
he
,
vec
[
df
->
mynum
],
localNum
,
val
);
return
;
}
template
<
class
DisplayType
>
inline
void
CombinedGrapeDisplay
<
DisplayType
>::
evalCoordWrap
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
df
,
const
double
*
coord
,
double
*
val
)
{
MyDisplayType
*
disp
=
(
MyDisplayType
*
)
he
->
display
;
assert
(
disp
);
disp
->
evalCoord
(
he
,
df
,
coord
,
val
);
return
;
}
template
<
class
DisplayType
>
inline
void
CombinedGrapeDisplay
<
DisplayType
>::
evalDofWrap
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
df
,
int
localNum
,
double
*
val
)
{
MyDisplayType
*
disp
=
(
MyDisplayType
*
)
he
->
display
;
assert
(
disp
);
disp
->
evalDof
(
he
,
df
,
localNum
,
val
);
return
;
}
...
...
@@ -285,10 +316,9 @@ namespace Dune
func_real
(
DUNE_ELEM
*
he
,
DUNE_FDATA
*
fe
,
int
ind
,
const
double
*
coord
,
double
*
val
)
{
MyDisplayType
*
disp
=
(
MyDisplayType
*
)
he
->
display
;
if
(
coord
)
disp
[
0
].
evalCoord
(
he
,
fe
,
coord
,
val
);
else
disp
[
0
].
evalDof
(
he
,
fe
,
ind
,
val
);
// this methtod is to be removed
assert
(
false
);
abort
();
return
;
}
...
...
@@ -299,14 +329,29 @@ namespace Dune
if
(
!
hmesh_
)
hmesh_
=
setupHmesh
();
if
(
disp
.
hasData
())
{
// get functions data vector of given display
std
::
vector
<
DUNE_FDATA
*
>
&
vec
=
disp
.
getFdataVec
();
if
(
vec
.
size
()
!=
vecFdata_
.
size
())
// only copy functions for the first partition, because
// all functions should be the same on every partition
if
(
vec
.
size
()
>
vecFdata_
.
size
())
{
// copy information
vecFdata_
=
vec
;
vecFdata_
.
resize
(
vec
.
size
()
);
for
(
unsigned
int
n
=
0
;
n
<
vecFdata_
.
size
();
n
++
)
{
vecFdata_
[
n
]
=
new
DUNE_FDATA
()
;
assert
(
vecFdata_
[
n
]
);
std
::
memcpy
(
vecFdata_
[
n
],
vec
[
n
],
sizeof
(
DUNE_FDATA
));
// we only need the two new functions for evaluation
vecFdata_
[
n
]
->
evalCoord
=
this
->
evalCoordWrap
;
vecFdata_
[
n
]
->
evalDof
=
this
->
evalDofWrap
;
// not needed here
vecFdata_
[
n
]
->
comp
=
0
;
// add function data to hmesh
GrapeInterface
<
dim
,
dimworld
>::
addDataToHmesh
(
hmesh_
,
vecFdata_
[
n
],
&
func_real
);
}
...
...
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