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
5561e6fc
Commit
5561e6fc
authored
4 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[test.grid] fix undefined behavior
parent
77b658f8
No related branches found
No related tags found
1 merge request
!44
ccache and clang sanitizer flags for CI
Pipeline
#65238
canceled
4 years ago
Stage: images
Stage: cpp
Stage: python
Stage: headercheck
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/xt/grid/boundaryinfo/factory.hh
+1
-1
1 addition, 1 deletion
dune/xt/grid/boundaryinfo/factory.hh
dune/xt/grid/boundaryinfo/normalbased.hh
+19
-9
19 additions, 9 deletions
dune/xt/grid/boundaryinfo/normalbased.hh
with
20 additions
and
10 deletions
dune/xt/grid/boundaryinfo/factory.hh
+
1
−
1
View file @
5561e6fc
...
...
@@ -44,7 +44,7 @@ public:
else
if
(
type
==
BoundarySegmentIndexBasedBoundaryInfo
<
I
>::
static_id
())
return
boundarysegment_boundaryinfo_default_config
();
else
if
(
type
==
NormalBasedBoundaryInfo
<
I
>::
static_id
())
return
normalbased_boundaryinfo_default_config
();
return
normalbased_boundaryinfo_default_config
<
I
::
Entity
::
dimension
>
();
else
DUNE_THROW
(
Common
::
Exceptions
::
wrong_input_given
,
"'"
<<
type
<<
"' is not a valid "
<<
BoundaryInfo
<
I
>::
static_id
()
<<
"!"
);
...
...
This diff is collapsed.
Click to expand it.
dune/xt/grid/boundaryinfo/normalbased.hh
+
19
−
9
View file @
5561e6fc
...
...
@@ -30,6 +30,7 @@ namespace XT {
namespace
Grid
{
template
<
size_t
d
>
static
inline
Common
::
Configuration
normalbased_boundaryinfo_default_config
()
{
Common
::
Configuration
config
;
...
...
@@ -38,12 +39,18 @@ static inline Common::Configuration normalbased_boundaryinfo_default_config()
config
[
"compare_tolerance"
]
=
"1e-10"
;
config
[
"0."
+
DirichletBoundary
().
id
()]
=
"[1 0 0 0]"
;
config
[
"1."
+
DirichletBoundary
().
id
()]
=
"[-1 0 0 0]"
;
config
[
"2."
+
DirichletBoundary
().
id
()]
=
"[0 1 0 0]"
;
config
[
"3."
+
DirichletBoundary
().
id
()]
=
"[0 -1 0 0]"
;
config
[
"4."
+
DirichletBoundary
().
id
()]
=
"[0 0 1 0]"
;
config
[
"5."
+
DirichletBoundary
().
id
()]
=
"[0 0 -1 0]"
;
config
[
"6."
+
DirichletBoundary
().
id
()]
=
"[0 0 0 1]"
;
config
[
"7."
+
DirichletBoundary
().
id
()]
=
"[0 0 0 -1]"
;
if
constexpr
(
d
>=
2
)
{
config
[
"2."
+
DirichletBoundary
().
id
()]
=
"[0 1 0 0]"
;
config
[
"3."
+
DirichletBoundary
().
id
()]
=
"[0 -1 0 0]"
;
}
if
constexpr
(
d
>=
3
)
{
config
[
"4."
+
DirichletBoundary
().
id
()]
=
"[0 0 1 0]"
;
config
[
"5."
+
DirichletBoundary
().
id
()]
=
"[0 0 -1 0]"
;
}
if
constexpr
(
d
>=
4
)
{
config
[
"6."
+
DirichletBoundary
().
id
()]
=
"[0 0 0 1]"
;
config
[
"7."
+
DirichletBoundary
().
id
()]
=
"[0 0 0 -1]"
;
}
return
config
;
}
...
...
@@ -79,12 +86,12 @@ public:
static
std
::
string
static_id
()
{
return
normalbased_boundaryinfo_default_config
().
template
get
<
std
::
string
>(
"type"
);
return
normalbased_boundaryinfo_default_config
<
I
::
Entity
::
dimension
>
().
template
get
<
std
::
string
>(
"type"
);
}
static
std
::
unique_ptr
<
ThisType
>
create
(
const
Common
::
Configuration
&
cfg
)
{
const
Common
::
Configuration
default_cfg
=
normalbased_boundaryinfo_default_config
();
const
Common
::
Configuration
default_cfg
=
normalbased_boundaryinfo_default_config
<
I
::
Entity
::
dimension
>
();
// get tolerance and default
const
auto
tol
=
cfg
.
get
(
"compare_tolerance"
,
default_cfg
.
get
<
DomainFieldType
>
(
"compare_tolerance"
));
const
auto
default_type
=
cfg
.
get
(
"default"
,
default_cfg
.
get
<
std
::
string
>
(
"default"
));
...
...
@@ -186,7 +193,10 @@ public:
*/
void
register_new_normal
(
const
WorldType
&
normal
,
BoundaryType
*&&
boundary_type
)
{
const
auto
normalized_normal
=
normal
/
normal
.
two_norm
();
const
auto
two_norm
=
normal
.
two_norm
();
if
(
XT
::
Common
::
FloatCmp
::
eq
(
two_norm
,
0.
,
tol_
))
DUNE_THROW
(
InvalidStateException
,
"Given normal has norm 0 (up to tolerance '"
<<
tol_
<<
"')!"
);
const
auto
normalized_normal
=
normal
/
two_norm
;
LOG_
(
info
)
<<
"register_new_normal(normal="
<<
normal
<<
", boundary_type="
<<
*
boundary_type
<<
")"
<<
std
::
endl
;
for
(
const
auto
&
normal_and_type_pair
:
normal_to_type_map_
)
{
const
auto
&
existing_normal
=
normal_and_type_pair
.
first
;
...
...
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