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
37130671
Commit
37130671
authored
4 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[grid] add print.hh, collecting specializations of commons Printer
parent
1128eead
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!20
Update bindings
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/xt/grid/intersection.hh
+4
-7
4 additions, 7 deletions
dune/xt/grid/intersection.hh
dune/xt/grid/print.hh
+62
-0
62 additions, 0 deletions
dune/xt/grid/print.hh
with
66 additions
and
7 deletions
dune/xt/grid/intersection.hh
+
4
−
7
View file @
37130671
...
...
@@ -30,6 +30,7 @@
#include
<dune/xt/common/type_traits.hh>
#include
<dune/xt/grid/type_traits.hh>
#include
<python/dune/xt/grid/grids.bindings.hh>
namespace
Dune
{
namespace
XT
{
...
...
@@ -172,14 +173,10 @@ contains(const Dune::Intersection<G, I>& intersection,
template
<
class
G
,
class
I
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
Dune
::
Intersection
<
G
,
I
>&
intersection
)
std
::
ostream
&
DUNE_DEPRECATED_MSG
(
"Use out << print(intersection) from <dune/xt/grid/print.hh> instead (05.07.2020)!"
)
operator
<<
(
std
::
ostream
&
out
,
const
Dune
::
Intersection
<
G
,
I
>&
intersection
)
{
const
auto
&
geometry
=
intersection
.
geometry
();
const
auto
num_corners
=
geometry
.
corners
();
out
<<
G
::
dimension
-
1
<<
"d-intersection{["
<<
geometry
.
corner
(
0
)
<<
"]"
;
for
(
int
ii
=
1
;
ii
<
num_corners
;
++
ii
)
out
<<
", ["
<<
geometry
.
corner
(
ii
)
<<
"]"
;
out
<<
"}"
;
XT
::
Common
::
print
(
intersection
);
return
out
;
}
...
...
This diff is collapsed.
Click to expand it.
dune/xt/grid/print.hh
0 → 100644
+
62
−
0
View file @
37130671
// This file is part of the dune-xt project:
// https://github.com/dune-community/dune-xt
// Copyright 2009-2020 dune-xt 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:
// Felix Schindler (2020)
#ifndef DUNE_XT_GRID_PRINT_HH
#define DUNE_XT_GRID_PRINT_HH
#include
<dune/grid/common/intersection.hh>
#include
<dune/xt/common/print.hh>
namespace
Dune
{
namespace
XT
{
namespace
Common
{
/// \sa Common::Printer
template
<
class
G
,
class
I
,
bool
use_repr
,
typename
anything
>
class
Printer
<
Dune
::
Intersection
<
G
,
I
>
,
use_repr
,
anything
>
:
public
internal
::
DefaultPrinter
<
Dune
::
Intersection
<
G
,
I
>
,
use_repr
>
{
public:
using
T
=
Dune
::
Intersection
<
G
,
I
>
;
const
std
::
string
grid_name
;
Printer
(
const
T
&
val
,
const
Configuration
&
cfg
=
{})
:
internal
::
DefaultPrinter
<
T
,
use_repr
>
(
val
,
cfg
)
{}
void
repr
(
std
::
ostream
&
out
)
const
override
final
{
const
auto
&
geometry
=
this
->
value
.
geometry
();
const
auto
num_corners
=
geometry
.
corners
();
out
<<
G
::
dimension
-
1
<<
"d-intersection{corners="
<<
print
(
geometry
.
corner
(
0
));
for
(
int
ii
=
1
;
ii
<
num_corners
;
++
ii
)
out
<<
", "
<<
print
(
geometry
.
corner
(
ii
));
out
<<
", normal="
<<
this
->
value
.
centerUnitOuterNormal
()
<<
"}"
;
}
void
str
(
std
::
ostream
&
out
)
const
override
final
{
const
auto
&
geometry
=
this
->
value
.
geometry
();
const
auto
num_corners
=
geometry
.
corners
();
out
<<
G
::
dimension
-
1
<<
"d-intersection{"
<<
print
(
geometry
.
corner
(
0
));
for
(
int
ii
=
1
;
ii
<
num_corners
;
++
ii
)
out
<<
", "
<<
print
(
geometry
.
corner
(
ii
));
out
<<
"}"
;
}
// ... str(...)
};
// class Printer
}
// namespace Common
}
// namespace XT
}
// namespace Dune
#endif // DUNE_XT_GRID_PRINT_HH
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