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
98b0b7dd
Commit
98b0b7dd
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Be explicit about templates
parent
799fd55f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/tectonic/myblockproblem.hh
+5
-3
5 additions, 3 deletions
dune/tectonic/myblockproblem.hh
dune/tectonic/myconvexproblem.hh
+5
-4
5 additions, 4 deletions
dune/tectonic/myconvexproblem.hh
src/one-body-sample.cc
+14
-9
14 additions, 9 deletions
src/one-body-sample.cc
with
24 additions
and
16 deletions
dune/tectonic/myblockproblem.hh
+
5
−
3
View file @
98b0b7dd
...
@@ -123,8 +123,9 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
...
@@ -123,8 +123,9 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
localb = <b - Au, v>
localb = <b - Au, v>
*/
*/
MyDirectionalConvexFunction
<
Dune
::
GlobalNonlinearity
<
block_size
>>
const
psi
(
MyDirectionalConvexFunction
<
localA
,
localb
,
problem
.
phi
,
u
,
v
);
Dune
::
GlobalNonlinearity
<
block_size
,
VectorType
,
MatrixType
>>
const
psi
(
localA
,
localb
,
problem
.
phi
,
u
,
v
);
Interval
<
double
>
D
;
Interval
<
double
>
D
;
psi
.
subDiff
(
0
,
D
);
psi
.
subDiff
(
0
,
D
);
...
@@ -197,7 +198,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
...
@@ -197,7 +198,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
linearization
.
A
.
mv
(
direction
,
tmp
);
// Av
linearization
.
A
.
mv
(
direction
,
tmp
);
// Av
double
const
localb
=
tmp
*
direction
;
// <Av,v>
double
const
localb
=
tmp
*
direction
;
// <Av,v>
MyDirectionalConvexFunction
<
Dune
::
GlobalNonlinearity
<
block_size
>>
const
MyDirectionalConvexFunction
<
Dune
::
GlobalNonlinearity
<
block_size
,
VectorType
,
MatrixType
>>
const
psi
(
localA
,
localb
,
problem
.
phi
,
u
,
direction
);
psi
(
localA
,
localb
,
problem
.
phi
,
u
,
direction
);
Interval
<
double
>
D
;
Interval
<
double
>
D
;
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/myconvexproblem.hh
+
5
−
4
View file @
98b0b7dd
...
@@ -21,13 +21,14 @@ class MyConvexProblem {
...
@@ -21,13 +21,14 @@ class MyConvexProblem {
\param f The linear functional
\param f The linear functional
\param u The solution vector
\param u The solution vector
*/
*/
MyConvexProblem
(
MatrixType
const
&
A
,
MyConvexProblem
(
Dune
::
GlobalNonlinearity
<
block_size
>
const
&
phi
,
MatrixType
const
&
A
,
VectorType
const
&
f
)
Dune
::
GlobalNonlinearity
<
block_size
,
VectorType
,
MatrixType
>
const
&
phi
,
VectorType
const
&
f
)
:
A
(
A
),
phi
(
phi
),
f
(
f
)
{};
:
A
(
A
),
phi
(
phi
),
f
(
f
)
{};
MatrixType
const
&
A
;
MatrixType
const
&
A
;
Dune
::
GlobalNonlinearity
<
block_size
>
const
&
phi
;
Dune
::
GlobalNonlinearity
<
block_size
,
VectorType
,
MatrixType
>
const
&
phi
;
VectorType
const
&
f
;
VectorType
const
&
f
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.cc
+
14
−
9
View file @
98b0b7dd
...
@@ -136,9 +136,11 @@ void assemble_frictional(
...
@@ -136,9 +136,11 @@ void assemble_frictional(
true
);
// whether to resize the output vector and zero all of its entries
true
);
// whether to resize the output vector and zero all of its entries
}
}
template
<
class
VectorType
,
class
MatrixType
>
void
assemble_nonlinearity
(
void
assemble_nonlinearity
(
int
size
,
Dune
::
ParameterTree
const
&
parset
,
int
size
,
Dune
::
ParameterTree
const
&
parset
,
Dune
::
shared_ptr
<
Dune
::
GlobalNonlinearity
<
dim
>
const
>
&
myGlobalNonlinearity
,
Dune
::
shared_ptr
<
Dune
::
GlobalNonlinearity
<
dim
,
VectorType
,
MatrixType
>
const
>
&
myGlobalNonlinearity
,
Dune
::
shared_ptr
<
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>>
Dune
::
shared_ptr
<
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>>
nodalIntegrals
)
{
nodalIntegrals
)
{
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>
SingletonVectorType
;
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
1
>>
SingletonVectorType
;
...
@@ -159,13 +161,14 @@ void assemble_nonlinearity(
...
@@ -159,13 +161,14 @@ void assemble_nonlinearity(
auto
eta
=
Dune
::
make_shared
<
SingletonVectorType
>
(
size
);
auto
eta
=
Dune
::
make_shared
<
SingletonVectorType
>
(
size
);
*
eta
=
parset
.
get
<
double
>
(
"boundary.friction.eta"
);
*
eta
=
parset
.
get
<
double
>
(
"boundary.friction.eta"
);
myGlobalNonlinearity
=
myGlobalNonlinearity
=
Dune
::
make_shared
<
Dune
::
make_shared
<
Dune
::
GlobalRuinaNonlinearity
<
dim
>
const
>
(
Dune
::
GlobalRuinaNonlinearity
<
dim
,
VectorType
,
MatrixType
>
const
>
(
nodalIntegrals
,
a
,
mu
,
eta
,
normalStress
);
nodalIntegrals
,
a
,
mu
,
eta
,
normalStress
);
}
else
if
(
friction_model
==
std
::
string
(
"Laursen"
))
{
}
else
if
(
friction_model
==
std
::
string
(
"Laursen"
))
{
myGlobalNonlinearity
=
Dune
::
make_shared
<
myGlobalNonlinearity
=
Dune
::
make_shared
<
Dune
::
GlobalLaursenNonlinearity
<
dim
,
Dune
::
LinearFunction
>
const
>
(
Dune
::
GlobalLaursenNonlinearity
<
dim
,
Dune
::
LinearFunction
,
VectorType
,
mu
,
normalStress
,
nodalIntegrals
);
MatrixType
>
const
>
(
mu
,
normalStress
,
nodalIntegrals
);
}
else
{
}
else
{
assert
(
false
);
assert
(
false
);
}
}
...
@@ -266,9 +269,11 @@ int main(int argc, char *argv[]) {
...
@@ -266,9 +269,11 @@ int main(int argc, char *argv[]) {
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
assemble_frictional
<
GridType
,
GridView
,
SmallVector
,
P1Basis
>
(
leafView
,
p1Basis
,
frictionalNodes
,
*
nodalIntegrals
);
leafView
,
p1Basis
,
frictionalNodes
,
*
nodalIntegrals
);
Dune
::
shared_ptr
<
Dune
::
GlobalNonlinearity
<
dim
>
const
>
myGlobalNonlinearity
;
Dune
::
shared_ptr
<
Dune
::
GlobalNonlinearity
<
assemble_nonlinearity
(
grid
.
size
(
grid
.
maxLevel
(),
dim
),
parset
,
dim
,
VectorType
,
OperatorType
>
const
>
myGlobalNonlinearity
;
myGlobalNonlinearity
,
nodalIntegrals
);
assemble_nonlinearity
<
VectorType
,
OperatorType
>
(
grid
.
size
(
grid
.
maxLevel
(),
dim
),
parset
,
myGlobalNonlinearity
,
nodalIntegrals
);
// {{{ Set up TNNMG solver
// {{{ Set up TNNMG solver
// linear iteration step components
// linear iteration step components
...
...
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