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
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
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
agnumpde
dune-tectonic
Commits
847b6e43
Commit
847b6e43
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Integrate a state variable
We now re-assemble the global nonlinearity for every step
parent
58726d34
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/tectonic/globalruinanonlinearity.hh
+5
-2
5 additions, 2 deletions
dune/tectonic/globalruinanonlinearity.hh
dune/tectonic/nicefunction.hh
+8
-6
8 additions, 6 deletions
dune/tectonic/nicefunction.hh
src/one-body-sample.cc
+15
-4
15 additions, 4 deletions
src/one-body-sample.cc
with
28 additions
and
12 deletions
dune/tectonic/globalruinanonlinearity.hh
+
5
−
2
View file @
847b6e43
...
@@ -25,12 +25,14 @@ class GlobalRuinaNonlinearity
...
@@ -25,12 +25,14 @@ class GlobalRuinaNonlinearity
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
a
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
a
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
mu
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
mu
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
eta
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
eta
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
normalStress
)
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
normalStress
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
state
)
:
nodalIntegrals
(
nodalIntegrals
),
:
nodalIntegrals
(
nodalIntegrals
),
a
(
a
),
a
(
a
),
mu
(
mu
),
mu
(
mu
),
eta
(
eta
),
eta
(
eta
),
normalStress
(
normalStress
),
normalStress
(
normalStress
),
state
(
state
),
trivialNonlinearity
(
trivialNonlinearity
(
new
LocalNonlinearity
<
dim
>
(
make_shared
<
TrivialFunction
const
>
())),
new
LocalNonlinearity
<
dim
>
(
make_shared
<
TrivialFunction
const
>
())),
restrictions
(
nodalIntegrals
->
size
())
// TODO: can we get the size from
restrictions
(
nodalIntegrals
->
size
())
// TODO: can we get the size from
...
@@ -52,7 +54,7 @@ class GlobalRuinaNonlinearity
...
@@ -52,7 +54,7 @@ class GlobalRuinaNonlinearity
auto
const
func
=
make_shared
<
RuinaFunction
const
>
(
auto
const
func
=
make_shared
<
RuinaFunction
const
>
(
(
*
nodalIntegrals
)[
i
][
0
],
(
*
a
)[
i
][
0
],
(
*
mu
)[
i
][
0
],
(
*
eta
)[
i
][
0
],
(
*
nodalIntegrals
)[
i
][
0
],
(
*
a
)[
i
][
0
],
(
*
mu
)[
i
][
0
],
(
*
eta
)[
i
][
0
],
(
*
normalStress
)[
i
][
0
]);
(
*
normalStress
)[
i
][
0
]
,
(
*
state
)[
i
][
0
]
);
restrictions
[
i
]
=
make_shared
<
LocalNonlinearity
<
dim
>
const
>
(
func
);
restrictions
[
i
]
=
make_shared
<
LocalNonlinearity
<
dim
>
const
>
(
func
);
return
restrictions
[
i
];
return
restrictions
[
i
];
}
}
...
@@ -65,6 +67,7 @@ class GlobalRuinaNonlinearity
...
@@ -65,6 +67,7 @@ class GlobalRuinaNonlinearity
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
mu
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
mu
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
eta
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
eta
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
normalStress
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
normalStress
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
state
;
std
::
vector
<
shared_ptr
<
LocalNonlinearity
<
dim
>
const
>>
mutable
restrictions
;
std
::
vector
<
shared_ptr
<
LocalNonlinearity
<
dim
>
const
>>
mutable
restrictions
;
};
};
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/nicefunction.hh
+
8
−
6
View file @
847b6e43
...
@@ -31,13 +31,14 @@ class NiceFunction : public VirtualFunction<double, double> {
...
@@ -31,13 +31,14 @@ class NiceFunction : public VirtualFunction<double, double> {
class
RuinaFunction
:
public
NiceFunction
{
class
RuinaFunction
:
public
NiceFunction
{
public:
public:
RuinaFunction
(
double
coefficient
,
double
a
,
double
mu
,
double
eta
,
RuinaFunction
(
double
coefficient
,
double
a
,
double
mu
,
double
eta
,
double
normalStress
)
double
normalStress
,
double
state
)
:
coefficient
(
coefficient
),
:
coefficient
(
coefficient
),
a
(
a
),
a
(
a
),
mu
(
mu
),
mu
(
mu
),
rho
(
exp
(
-
mu
/
a
)),
rho
(
exp
(
-
mu
/
a
)),
eta
(
eta
),
eta
(
eta
),
normalStress
(
normalStress
)
{}
normalStress
(
normalStress
),
state
(
state
)
{}
/*
/*
If mu and sigma_n denote the coefficient of friction and the
If mu and sigma_n denote the coefficient of friction and the
...
@@ -55,8 +56,8 @@ class RuinaFunction : public NiceFunction {
...
@@ -55,8 +56,8 @@ class RuinaFunction : public NiceFunction {
*/
*/
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
double
const
arg
=
std
::
max
(
eta
*
x
,
rho
);
double
const
arg
=
std
::
max
(
eta
*
x
,
rho
);
double
const
h
=
arg
*
(
a
*
(
std
::
log
(
arg
)
-
1
)
+
mu
);
double
const
h
=
arg
*
(
a
*
(
std
::
log
(
arg
)
-
1
)
+
mu
+
state
);
y
=
1
/
eta
*
normalStress
*
h
+
a
*
rho
+
mu
;
y
=
1
/
eta
*
normalStress
*
h
+
a
*
rho
+
mu
+
state
;
y
*=
coefficient
;
y
*=
coefficient
;
}
}
...
@@ -71,7 +72,7 @@ class RuinaFunction : public NiceFunction {
...
@@ -71,7 +72,7 @@ class RuinaFunction : public NiceFunction {
if
(
eta
*
s
<=
rho
)
if
(
eta
*
s
<=
rho
)
return
0
;
return
0
;
return
coefficient
*
normalStress
*
(
a
*
std
::
log
(
eta
*
s
)
+
mu
);
return
coefficient
*
normalStress
*
(
a
*
std
::
log
(
eta
*
s
)
+
mu
+
state
);
}
}
/* see above */
/* see above */
...
@@ -79,7 +80,7 @@ class RuinaFunction : public NiceFunction {
...
@@ -79,7 +80,7 @@ class RuinaFunction : public NiceFunction {
if
(
eta
*
s
<=
rho
)
if
(
eta
*
s
<=
rho
)
return
0
;
return
0
;
return
coefficient
*
normalStress
*
(
a
*
std
::
log
(
eta
*
s
)
+
mu
);
return
coefficient
*
normalStress
*
(
a
*
std
::
log
(
eta
*
s
)
+
mu
+
state
);
}
}
/*
/*
...
@@ -108,6 +109,7 @@ class RuinaFunction : public NiceFunction {
...
@@ -108,6 +109,7 @@ class RuinaFunction : public NiceFunction {
double
const
mu
;
double
const
mu
;
double
const
eta
;
double
const
eta
;
double
const
normalStress
;
double
const
normalStress
;
double
const
state
;
double
const
rho
;
double
const
rho
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.cc
+
15
−
4
View file @
847b6e43
...
@@ -144,7 +144,8 @@ Dune::shared_ptr<Dune::GlobalNonlinearity<VectorType, MatrixType> const>
...
@@ -144,7 +144,8 @@ Dune::shared_ptr<Dune::GlobalNonlinearity<VectorType, MatrixType> const>
assemble_nonlinearity
(
assemble_nonlinearity
(
int
size
,
Dune
::
ParameterTree
const
&
parset
,
int
size
,
Dune
::
ParameterTree
const
&
parset
,
Dune
::
shared_ptr
<
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>>
Dune
::
shared_ptr
<
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>>
nodalIntegrals
)
{
nodalIntegrals
,
Dune
::
shared_ptr
<
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>>
state
)
{
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>
SingletonVectorType
;
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>
SingletonVectorType
;
// {{{ Assemble terms for the nonlinearity
// {{{ Assemble terms for the nonlinearity
...
@@ -165,7 +166,7 @@ assemble_nonlinearity(
...
@@ -165,7 +166,7 @@ assemble_nonlinearity(
return
Dune
::
make_shared
<
return
Dune
::
make_shared
<
Dune
::
GlobalRuinaNonlinearity
<
VectorType
,
MatrixType
>
const
>
(
Dune
::
GlobalRuinaNonlinearity
<
VectorType
,
MatrixType
>
const
>
(
nodalIntegrals
,
a
,
mu
,
eta
,
normalStress
);
nodalIntegrals
,
a
,
mu
,
eta
,
normalStress
,
state
);
}
else
if
(
friction_model
==
std
::
string
(
"Laursen"
))
{
}
else
if
(
friction_model
==
std
::
string
(
"Laursen"
))
{
return
Dune
::
make_shared
<
Dune
::
GlobalLaursenNonlinearity
<
return
Dune
::
make_shared
<
Dune
::
GlobalLaursenNonlinearity
<
Dune
::
LinearFunction
,
VectorType
,
MatrixType
>
const
>
(
mu
,
normalStress
,
Dune
::
LinearFunction
,
VectorType
,
MatrixType
>
const
>
(
mu
,
normalStress
,
...
@@ -269,8 +270,10 @@ int main(int argc, char *argv[]) {
...
@@ -269,8 +270,10 @@ int main(int argc, char *argv[]) {
auto
nodalIntegrals
=
auto
nodalIntegrals
=
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
leafView
,
p1Basis
,
frictionalNodes
);
leafView
,
p1Basis
,
frictionalNodes
);
auto
myGlobalNonlinearity
=
assemble_nonlinearity
<
VectorType
,
OperatorType
>
(
auto
state
=
grid
->
size
(
grid
->
maxLevel
(),
dim
),
parset
,
nodalIntegrals
);
Dune
::
make_shared
<
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>>
(
grid
->
size
(
grid
->
maxLevel
(),
dim
));
*
state
=
0.0
;
// {{{ Set up TNNMG solver
// {{{ Set up TNNMG solver
// linear iteration step components
// linear iteration step components
...
@@ -334,6 +337,10 @@ int main(int argc, char *argv[]) {
...
@@ -334,6 +337,10 @@ int main(int argc, char *argv[]) {
stiffnessMatrix
.
mmv
(
u4
,
b4
);
stiffnessMatrix
.
mmv
(
u4
,
b4
);
if
(
parset
.
get
<
bool
>
(
"solver.nonlineargs.use"
))
{
if
(
parset
.
get
<
bool
>
(
"solver.nonlineargs.use"
))
{
auto
myGlobalNonlinearity
=
assemble_nonlinearity
<
VectorType
,
OperatorType
>
(
grid
->
size
(
grid
->
maxLevel
(),
dim
),
parset
,
nodalIntegrals
,
state
);
MyConvexProblemType
myConvexProblem
(
stiffnessMatrix
,
MyConvexProblemType
myConvexProblem
(
stiffnessMatrix
,
*
myGlobalNonlinearity
,
b1
);
*
myGlobalNonlinearity
,
b1
);
MyBlockProblemType
myBlockProblem
(
parset
,
myConvexProblem
);
MyBlockProblemType
myBlockProblem
(
parset
,
myConvexProblem
);
...
@@ -349,6 +356,10 @@ int main(int argc, char *argv[]) {
...
@@ -349,6 +356,10 @@ int main(int argc, char *argv[]) {
u1
+=
u1_diff
;
u1
+=
u1_diff
;
if
(
parset
.
get
<
bool
>
(
"solver.tnnmg.use"
))
{
if
(
parset
.
get
<
bool
>
(
"solver.tnnmg.use"
))
{
auto
myGlobalNonlinearity
=
assemble_nonlinearity
<
VectorType
,
OperatorType
>
(
grid
->
size
(
grid
->
maxLevel
(),
dim
),
parset
,
nodalIntegrals
,
state
);
MyConvexProblemType
myConvexProblem
(
stiffnessMatrix
,
MyConvexProblemType
myConvexProblem
(
stiffnessMatrix
,
*
myGlobalNonlinearity
,
b4
);
*
myGlobalNonlinearity
,
b4
);
...
...
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