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
797f2dbf
Unverified
Commit
797f2dbf
authored
7 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[boundaryinfo.normalbased] add reflecting boundaries
parent
92f41eb1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/xt/grid/boundaryinfo/normalbased.hh
+30
-0
30 additions, 0 deletions
dune/xt/grid/boundaryinfo/normalbased.hh
with
30 additions
and
0 deletions
dune/xt/grid/boundaryinfo/normalbased.hh
+
30
−
0
View file @
797f2dbf
...
@@ -98,6 +98,30 @@ public:
...
@@ -98,6 +98,30 @@ public:
}
}
}
// NormalBased(...)
}
// NormalBased(...)
NormalBasedBoundaryInfo
(
const
std
::
vector
<
WorldType
>
dirichlet_normals
,
const
std
::
vector
<
WorldType
>
neumann_normals
,
const
std
::
vector
<
WorldType
>
reflecting_normals
,
const
DomainFieldType
tol
=
1e-10
)
:
NormalBasedBoundaryInfo
(
true
,
dirichlet_normals
,
neumann_normals
,
tol
)
{
reflecting_normals_
=
reflecting_normals
;
// normalize
for
(
auto
&
normal
:
reflecting_normals_
)
normal
/=
normal
.
two_norm
();
// sanity checks
for
(
auto
&
dirichletNormal
:
dirichlet_normals_
)
{
if
(
contains
(
dirichletNormal
,
reflecting_normals_
))
DUNE_THROW
(
Common
::
Exceptions
::
wrong_input_given
,
"Given normals are too close for given tolerance '"
<<
tol
<<
"'!"
);
}
for
(
auto
&
neumannNormal
:
neumann_normals_
)
{
if
(
contains
(
neumannNormal
,
reflecting_normals_
))
DUNE_THROW
(
Common
::
Exceptions
::
wrong_input_given
,
"Given normals are too close for given tolerance '"
<<
tol
<<
"'!"
);
}
}
// NormalBased(...)
virtual
const
BoundaryType
&
type
(
const
IntersectionType
&
intersection
)
const
override
final
virtual
const
BoundaryType
&
type
(
const
IntersectionType
&
intersection
)
const
override
final
{
{
if
(
!
intersection
.
boundary
())
if
(
!
intersection
.
boundary
())
...
@@ -107,6 +131,8 @@ public:
...
@@ -107,6 +131,8 @@ public:
return
dirichlet_boundary_
;
return
dirichlet_boundary_
;
else
if
(
contains
(
outerNormal
,
neumann_normals_
))
else
if
(
contains
(
outerNormal
,
neumann_normals_
))
return
neumann_boundary_
;
return
neumann_boundary_
;
else
if
(
contains
(
outerNormal
,
reflecting_normals_
))
return
reflecting_boundary_
;
else
else
return
dirichlet_boundary_
;
return
dirichlet_boundary_
;
}
// ... type(...)
}
// ... type(...)
...
@@ -142,10 +168,12 @@ protected:
...
@@ -142,10 +168,12 @@ protected:
const
bool
default_to_dirichlet_
;
const
bool
default_to_dirichlet_
;
std
::
vector
<
WorldType
>
dirichlet_normals_
;
std
::
vector
<
WorldType
>
dirichlet_normals_
;
std
::
vector
<
WorldType
>
neumann_normals_
;
std
::
vector
<
WorldType
>
neumann_normals_
;
std
::
vector
<
WorldType
>
reflecting_normals_
;
const
DomainFieldType
tol_
;
const
DomainFieldType
tol_
;
static
constexpr
NoBoundary
no_boundary_
{};
static
constexpr
NoBoundary
no_boundary_
{};
static
constexpr
DirichletBoundary
dirichlet_boundary_
{};
static
constexpr
DirichletBoundary
dirichlet_boundary_
{};
static
constexpr
NeumannBoundary
neumann_boundary_
{};
static
constexpr
NeumannBoundary
neumann_boundary_
{};
static
constexpr
ReflectingBoundary
reflecting_boundary_
{};
};
// class NormalBasedBoundaryInfo
};
// class NormalBasedBoundaryInfo
#if (defined(BOOST_CLANG) && BOOST_CLANG) || (defined(BOOST_GCC) && BOOST_GCC)
#if (defined(BOOST_CLANG) && BOOST_CLANG) || (defined(BOOST_GCC) && BOOST_GCC)
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
...
@@ -157,6 +185,8 @@ template <class I>
...
@@ -157,6 +185,8 @@ template <class I>
constexpr
DirichletBoundary
NormalBasedBoundaryInfo
<
I
>::
dirichlet_boundary_
;
constexpr
DirichletBoundary
NormalBasedBoundaryInfo
<
I
>::
dirichlet_boundary_
;
template
<
class
I
>
template
<
class
I
>
constexpr
NeumannBoundary
NormalBasedBoundaryInfo
<
I
>::
neumann_boundary_
;
constexpr
NeumannBoundary
NormalBasedBoundaryInfo
<
I
>::
neumann_boundary_
;
template
<
class
I
>
constexpr
ReflectingBoundary
NormalBasedBoundaryInfo
<
I
>::
reflecting_boundary_
;
template
<
class
I
>
template
<
class
I
>
...
...
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