Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-pdelab
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
COPASI
dune-pdelab
Commits
6a91df81
Commit
6a91df81
authored
4 years ago
by
Santiago Ospina De Los Ríos
Committed by
Santiago Ospina De Los Ríos
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix vtk data manager to work with multidomain settings
parent
acc6ebc9
No related branches found
No related tags found
No related merge requests found
Pipeline
#33788
failed
3 years ago
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/pdelab/gridfunctionspace/vtk.hh
+91
-13
91 additions, 13 deletions
dune/pdelab/gridfunctionspace/vtk.hh
with
91 additions
and
13 deletions
dune/pdelab/gridfunctionspace/vtk.hh
+
91
−
13
View file @
6a91df81
...
...
@@ -6,6 +6,7 @@
#include
<functional>
#include
<dune/common/exceptions.hh>
#include
<dune/common/shared_ptr.hh>
#include
<dune/common/std/functional.hh>
#include
<dune/geometry/typeindex.hh>
...
...
@@ -134,14 +135,14 @@ namespace Dune {
* @param gv grid view used for entity binding
* @param entity_transf entity transformation to the grid view used in the gfs
*/
DGFTreeCommonData
(
const
GFS
&
gfs
,
const
X
&
x
,
const
GV
&
gv
,
const
ET
&
entity_transf
)
DGFTreeCommonData
(
std
::
shared_ptr
<
const
GFS
>
gfs
,
std
::
shared_ptr
<
const
X
>
x
,
const
GV
&
gv
,
const
ET
&
entity_transf
)
:
_entity_transf
(
entity_transf
)
,
_gv
(
gv
)
,
_lfs
(
gfs
)
,
_lfs_cache
(
_lfs
)
,
_x_view
(
x
)
,
_x_local
(
_lfs
.
maxSize
())
,
_index_set
(
gfs
.
entitySet
().
indexSet
())
,
_index_set
(
gfs
->
entitySet
().
indexSet
())
,
_current_cell_index
(
std
::
numeric_limits
<
size_type
>::
max
())
,
x
(
x
)
{}
...
...
@@ -156,7 +157,33 @@ namespace Dune {
* @note Only available if entity transformation is default constructible
*/
template
<
class
T
=
int
,
class
=
std
::
enable_if_t
<
std
::
is_default_constructible_v
<
ET
>,
T
>>
DGFTreeCommonData
(
const
GFS
&
gfs
,
const
X
&
x
,
const
GV
&
gv
)
DGFTreeCommonData
(
std
::
shared_ptr
<
const
GFS
>
gfs
,
std
::
shared_ptr
<
const
X
>
x
,
const
GV
&
gv
)
:
DGFTreeCommonData
(
gfs
,
x
,
gv
,
ET
{})
{}
/**
* @brief Construct a new DGFTreeCommonData object
*
* @param gfs grid function space
* @param x coefficient vector associated with the gfs
* @param gv grid view used for entity binding
* @param entity_transf entity transformation to the grid view used in the gfs
*/
DGFTreeCommonData
(
const
GFS
&
gfs
,
const
X
&
x
,
const
GV
&
gv
,
const
ET
&
entity_transf
)
:
DGFTreeCommonData
(
stackobject_to_shared_ptr
(
gfs
),
stackobject_to_shared_ptr
(
x
),
gv
,
entity_transf
)
{}
/**
* @brief Construct a new DGFTreeCommonData object
*
* @param gfs grid function space
* @param x coefficient vector associated with the gfs
* @param gv grid view used for entity binding
*
* @note Only available if entity transformation is default constructible
*/
template
<
class
T
=
int
,
class
=
std
::
enable_if_t
<
std
::
is_default_constructible_v
<
ET
>,
T
>>
DGFTreeCommonData
(
const
GFS
&
gfs
,
const
X
&
x
,
const
GV
&
gv
)
:
DGFTreeCommonData
(
gfs
,
x
,
gv
,
ET
{})
{}
...
...
@@ -488,6 +515,7 @@ namespace Dune {
struct
add_solution_to_vtk_writer_visitor
:
public
TypeTree
::
DefaultVisitor
,
public
TypeTree
::
DynamicTraversal
,
public
TypeTree
::
VisitTreeDynamic
{
using
GV
=
typename
Data
::
GridView
;
...
...
@@ -505,14 +533,6 @@ namespace Dune {
};
template
<
typename
LFS
,
typename
Child
,
typename
TreePath
>
inline
bool
visitChild
(
const
LFS
&
n
,
const
Child
&
c
,
const
TreePath
&
p
)
{
return
true
;
}
//! Helper function for extracting (or building) the component name and adding
//! the component to the VTKWriter.
template
<
typename
DGF
,
typename
TreePath
>
...
...
@@ -552,6 +572,40 @@ namespace Dune {
// do nothing here - not a vector space
}
// **********************************************************************
// Visitor functions for adding DiscreteGridFunctions to VTKWriter
//
// The visitor functions contain a switch that will make them ignore
// function spaces with a different underlying GridView type than
// the VTKWriter.
// This cannot happen in vanilla PDELab, but is required for MultiDomain
// support
// **********************************************************************
// don't do anything if GridView types differ
template
<
typename
LFS
,
typename
TreePath
>
typename
std
::
enable_if
<
!
std
::
is_same
<
typename
LFS
::
Traits
::
GridFunctionSpace
::
Traits
::
GridView
,
typename
vtk_writer_traits
<
VTKWriter
>::
GridView
>::
value
>::
type
post
(
const
LFS
&
lfs
,
TreePath
tp
)
{
}
// don't do anything if GridView types differ
template
<
typename
LFS
,
typename
TreePath
>
typename
std
::
enable_if
<
!
std
::
is_same
<
typename
LFS
::
Traits
::
GridFunctionSpace
::
Traits
::
GridView
,
typename
vtk_writer_traits
<
VTKWriter
>::
GridView
>::
value
>::
type
leaf
(
const
LFS
&
lfs
,
TreePath
tp
)
{
}
//! Handle VectorGridFunctionSpace components in here.
template
<
typename
LFS
,
typename
TreePath
>
void
post
(
const
LFS
&
lfs
,
TreePath
tp
)
...
...
@@ -562,7 +616,13 @@ namespace Dune {
//! Create a standard leaf function for leaf GridFunctionSpaces.
template
<
typename
LFS
,
typename
TreePath
>
void
leaf
(
const
LFS
&
lfs
,
TreePath
tp
)
typename
std
::
enable_if
<
std
::
is_same
<
typename
LFS
::
Traits
::
GridFunctionSpace
::
Traits
::
GridView
,
typename
vtk_writer_traits
<
VTKWriter
>::
GridView
>::
value
>::
type
leaf
(
const
LFS
&
lfs
,
TreePath
tp
)
{
if
(
predicate
(
lfs
,
tp
))
add_to_vtk_writer
(
std
::
make_shared
<
DGFTreeLeafFunction
<
LFS
,
Data
,
GV
>
>
(
lfs
,
data
),
tp
);
...
...
@@ -696,9 +756,27 @@ namespace Dune {
const
X
&
x
,
const
NameGenerator
&
name_generator
=
vtk
::
defaultNameScheme
(),
const
Predicate
&
predicate
=
Predicate
())
{
auto
gfs_ptr
=
Dune
::
stackobject_to_shared_ptr
(
gfs
);
auto
x_ptr
=
Dune
::
stackobject_to_shared_ptr
(
x
);
return
addSolutionToVTKWriter
(
vtk_writer
,
gfs_ptr
,
x_ptr
,
name_generator
,
predicate
);
}
template
<
typename
VTKWriter
,
typename
GFS
,
typename
X
,
typename
NameGenerator
=
vtk
::
DefaultFunctionNameGenerator
,
typename
Predicate
=
vtk
::
DefaultPredicate
>
auto
addSolutionToVTKWriter
(
VTKWriter
&
vtk_writer
,
std
::
shared_ptr
<
GFS
>
gfs
,
std
::
shared_ptr
<
X
>
x
,
const
NameGenerator
&
name_generator
=
vtk
::
defaultNameScheme
(),
const
Predicate
&
predicate
=
Predicate
())
{
typedef
vtk
::
DGFTreeCommonData
<
GFS
,
X
,
Predicate
>
Data
;
vtk
::
OutputCollector
<
VTKWriter
,
Data
>
collector
(
vtk_writer
,
std
::
make_shared
<
Data
>
(
gfs
,
x
,
gfs
.
gridView
()),
predicate
);
vtk
::
OutputCollector
<
VTKWriter
,
Data
>
collector
(
vtk_writer
,
std
::
make_shared
<
Data
>
(
gfs
,
x
,
gfs
->
gridView
()),
predicate
);
collector
.
addSolution
(
name_generator
);
return
collector
;
}
...
...
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