Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
podlesny
dune-tectonic
Commits
7bfbe7e8
Commit
7bfbe7e8
authored
4 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
relative velocities in mortar basis yield small but non-zero normal contributions, remove them here
parent
9baf7d4b
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/tectonic/data-structures/friction/localfriction.hh
+23
-10
23 additions, 10 deletions
dune/tectonic/data-structures/friction/localfriction.hh
with
23 additions
and
10 deletions
dune/tectonic/data-structures/friction/localfriction.hh
+
23
−
10
View file @
7bfbe7e8
...
@@ -40,19 +40,28 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
...
@@ -40,19 +40,28 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
using
VectorType
=
typename
LocalFriction
<
dimension
>::
VectorType
;
using
VectorType
=
typename
LocalFriction
<
dimension
>::
VectorType
;
using
MatrixType
=
typename
LocalFriction
<
dimension
>::
MatrixType
;
using
MatrixType
=
typename
LocalFriction
<
dimension
>::
MatrixType
;
private:
VectorType
removeNormal
(
const
VectorType
&
x
)
{
VectorType
res
=
x
;
res
[
0
]
=
0.0
;
return
res
;
}
public
:
public
:
template
<
typename
...
Args
>
template
<
typename
...
Args
>
WrappedScalarFriction
(
Args
...
args
)
WrappedScalarFriction
(
Args
...
args
)
:
func_
(
args
...)
{}
:
func_
(
args
...)
{}
double
operator
()(
VectorType
const
&
x
)
const
override
{
double
operator
()(
VectorType
const
&
x
)
const
override
{
return
func_
.
evaluate
(
x
.
two_norm
());
auto
tangential_x
=
removeNormal
(
x
);
return
func_
.
evaluate
(
tangential_x
.
two_norm
());
}
}
void
updateAlpha
(
double
alpha
)
override
{
func_
.
updateAlpha
(
alpha
);
}
void
updateAlpha
(
double
alpha
)
override
{
func_
.
updateAlpha
(
alpha
);
}
double
regularity
(
VectorType
const
&
x
)
const
override
{
double
regularity
(
VectorType
const
&
x
)
const
override
{
double
const
xnorm
=
x
.
two_norm
();
auto
tangential_x
=
removeNormal
(
x
);
double
const
xnorm
=
tangential_x
.
two_norm
();
if
(
xnorm
<=
0.0
)
if
(
xnorm
<=
0.0
)
return
std
::
numeric_limits
<
double
>::
infinity
();
return
std
::
numeric_limits
<
double
>::
infinity
();
...
@@ -60,18 +69,21 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
...
@@ -60,18 +69,21 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
}
}
double
coefficientOfFriction
(
VectorType
const
&
x
)
const
override
{
double
coefficientOfFriction
(
VectorType
const
&
x
)
const
override
{
return
func_
.
coefficientOfFriction
(
x
.
two_norm
());
auto
tangential_x
=
removeNormal
(
x
);
return
func_
.
coefficientOfFriction
(
tangential_x
.
two_norm
());
}
}
// directional subdifferential: at u on the line u + t*v
// directional subdifferential: at u on the line u + t*v
// u and v are assumed to be non-zero
// u and v are assumed to be non-zero
void
directionalSubDiff
(
VectorType
const
&
x
,
VectorType
const
&
v
,
void
directionalSubDiff
(
VectorType
const
&
x
,
VectorType
const
&
v
,
Dune
::
Solvers
::
Interval
<
double
>
&
D
)
const
override
{
Dune
::
Solvers
::
Interval
<
double
>
&
D
)
const
override
{
double
const
xnorm
=
x
.
two_norm
();
auto
tangential_x
=
removeNormal
(
x
);
double
const
xnorm
=
tangential_x
.
two_norm
();
if
(
xnorm
<=
0.0
)
if
(
xnorm
<=
0.0
)
D
[
0
]
=
D
[
1
]
=
func_
.
differential
(
0.0
)
*
v
.
two_norm
();
D
[
0
]
=
D
[
1
]
=
func_
.
differential
(
0.0
)
*
v
.
two_norm
();
else
else
D
[
0
]
=
D
[
1
]
=
func_
.
differential
(
xnorm
)
*
(
x
*
v
)
/
xnorm
;
D
[
0
]
=
D
[
1
]
=
func_
.
differential
(
xnorm
)
*
(
tangential_
x
*
v
)
/
xnorm
;
}
}
/** Formula for the derivative:
/** Formula for the derivative:
...
@@ -122,12 +134,12 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
...
@@ -122,12 +134,12 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
double const entry = tensorweight * x[k] * x[k];
double const entry = tensorweight * x[k] * x[k];
A[k][k] += entry + idweight;
A[k][k] += entry + idweight;
}*/
}*/
auto
tangential_x
=
removeNormal
(
x
);
const
double
xnorm
=
x
.
two_norm
();
const
double
xnorm
=
tangential_
x
.
two_norm
();
if
(
xnorm
<=
0.0
)
if
(
xnorm
<=
0.0
)
return
;
return
;
VectorType
y
=
x
;
VectorType
y
=
tangential_
x
;
y
/=
xnorm
;
y
/=
xnorm
;
double
const
H1
=
func_
.
differential
(
xnorm
);
double
const
H1
=
func_
.
differential
(
xnorm
);
...
@@ -154,12 +166,13 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
...
@@ -154,12 +166,13 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
}
}
void
addGradient
(
VectorType
const
&
x
,
VectorType
&
y
)
const
override
{
void
addGradient
(
VectorType
const
&
x
,
VectorType
&
y
)
const
override
{
double
const
xnorm
=
x
.
two_norm
();
auto
tangential_x
=
removeNormal
(
x
);
double
const
xnorm
=
tangential_x
.
two_norm
();
if
(
std
::
isinf
(
func_
.
regularity
(
xnorm
)))
if
(
std
::
isinf
(
func_
.
regularity
(
xnorm
)))
return
;
return
;
if
(
xnorm
>
0.0
)
if
(
xnorm
>
0.0
)
Arithmetic
::
addProduct
(
y
,
func_
.
differential
(
xnorm
)
/
xnorm
,
x
);
Arithmetic
::
addProduct
(
y
,
func_
.
differential
(
xnorm
)
/
xnorm
,
tangential_
x
);
}
}
void
directionalDomain
(
VectorType
const
&
,
VectorType
const
&
,
void
directionalDomain
(
VectorType
const
&
,
VectorType
const
&
,
...
...
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