Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
2117ed10
Unverified
Commit
2117ed10
authored
5 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[visualization] add functor for partition type
parent
e6930b15
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
dune/xt/grid/output/entity_visualization.hh
+20
-1
20 additions, 1 deletion
dune/xt/grid/output/entity_visualization.hh
dune/xt/grid/test/output.tpl
+32
-0
32 additions, 0 deletions
dune/xt/grid/test/output.tpl
with
52 additions
and
1 deletion
dune/xt/grid/output/entity_visualization.hh
+
20
−
1
View file @
2117ed10
...
@@ -54,7 +54,7 @@ struct ElementVisualization
...
@@ -54,7 +54,7 @@ struct ElementVisualization
std
::
vector
<
double
>
values
(
mapper
.
size
());
std
::
vector
<
double
>
values
(
mapper
.
size
());
for
(
auto
&&
entity
:
elements
(
gridView
))
{
for
(
auto
&&
entity
:
elements
(
gridView
))
{
values
[
mapper
.
map
(
entity
)]
=
f
(
entity
);
values
[
mapper
.
index
(
entity
)]
=
f
(
entity
);
}
}
Dune
::
VTKWriter
<
typename
Grid
::
LeafGridView
>
vtkwriter
(
gridView
);
Dune
::
VTKWriter
<
typename
Grid
::
LeafGridView
>
vtkwriter
(
gridView
);
...
@@ -208,6 +208,23 @@ struct ElementVisualization
...
@@ -208,6 +208,23 @@ struct ElementVisualization
}
}
};
};
class
PartitionTypeFunctor
:
public
FunctorBase
{
public:
PartitionTypeFunctor
(
const
std
::
string
fname
,
const
std
::
string
dname
)
:
FunctorBase
(
fname
,
dname
)
{}
template
<
class
Entity
>
double
operator
()(
const
Entity
&
ent
)
const
{
const
typename
Entity
::
Geometry
&
geo
=
ent
.
geometry
();
const
int
type
{
static_cast
<
int
>
(
ent
.
partitionType
())};
DXTC_LOG_ERROR
<<
"TYPE "
<<
type
<<
std
::
endl
;
return
static_cast
<
double
>
(
type
);
}
};
//! supply functor
//! supply functor
template
<
class
Grid
>
template
<
class
Grid
>
static
void
all
(
const
Grid
&
grid
,
const
std
::
string
outputDir
=
"visualisation"
)
static
void
all
(
const
Grid
&
grid
,
const
std
::
string
outputDir
=
"visualisation"
)
...
@@ -218,6 +235,7 @@ struct ElementVisualization
...
@@ -218,6 +235,7 @@ struct ElementVisualization
GeometryFunctor
geometryFunctor
(
"geometryFunctor"
,
outputDir
);
GeometryFunctor
geometryFunctor
(
"geometryFunctor"
,
outputDir
);
ProcessIdFunctor
processIdFunctor
(
"ProcessIdFunctor"
,
outputDir
);
ProcessIdFunctor
processIdFunctor
(
"ProcessIdFunctor"
,
outputDir
);
VolumeFunctor
volumeFunctor
(
"volumeFunctor"
,
outputDir
);
VolumeFunctor
volumeFunctor
(
"volumeFunctor"
,
outputDir
);
PartitionTypeFunctor
partitionTypeFunctor
(
"partitionTypeFunctor"
,
outputDir
);
// call the visualization functions
// call the visualization functions
elementdata
(
grid
,
boundaryFunctor
);
elementdata
(
grid
,
boundaryFunctor
);
...
@@ -225,6 +243,7 @@ struct ElementVisualization
...
@@ -225,6 +243,7 @@ struct ElementVisualization
elementdata
(
grid
,
geometryFunctor
);
elementdata
(
grid
,
geometryFunctor
);
elementdata
(
grid
,
processIdFunctor
);
elementdata
(
grid
,
processIdFunctor
);
elementdata
(
grid
,
volumeFunctor
);
elementdata
(
grid
,
volumeFunctor
);
elementdata
(
grid
,
partitionTypeFunctor
);
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
dune/xt/grid/test/output.tpl
0 → 100644
+
32
−
0
View file @
2117ed10
// This file is part of the dune-xt-grid project:
// https://github.com/dune-community/dune-xt-grid
// Copyright 2009-2018 dune-xt-grid developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Rene Milk (2018)
#include
<dune
/
xt
/
common
/
test
/
main.hxx
>
#include
<dune
/
xt
/
grid
/
gridprovider
/
eoc.hh
>
#include
<dune
/
xt
/
grid
/
grids.hh
>
#include
<dune
/
xt
/
grid
/
output
/
entity_visualization.hh
>
#include
<dune
/
grid
/
uggrid.hh
>
{% for name, type in config.all_grids %}
GTEST_TEST(GridProvider_{
{
name
}
}, layers)
{
using ProviderFactory = Dune::XT::Grid::GridProviderFactory
<
{
{
type
}
}
>
;
const auto type = ProviderFactory::available()[0];
const auto config = ProviderFactory::default_config(type);
auto global_provider = ProviderFactory::create(config, Dune::MPIHelper::getCommunicator());
auto
&
global_grid = global_provider.grid();
Dune::XT::Grid::ElementVisualization::all(global_grid, boost::filesystem::temp_directory_path().string());
}
{% endfor %}
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