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
3441176f
Commit
3441176f
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make assemble_nonlinearity a factory method
parent
63444a39
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
src/one-body-sample.cc
+6
-10
6 additions, 10 deletions
src/one-body-sample.cc
with
6 additions
and
10 deletions
src/one-body-sample.cc
+
6
−
10
View file @
3441176f
...
@@ -140,10 +140,9 @@ void assemble_frictional(
...
@@ -140,10 +140,9 @@ void assemble_frictional(
}
}
template
<
class
VectorType
,
class
MatrixType
>
template
<
class
VectorType
,
class
MatrixType
>
void
assemble_nonlinearity
(
Dune
::
shared_ptr
<
Dune
::
GlobalNonlinearity
<
VectorType
,
MatrixType
>
const
>
assemble_nonlinearity
(
int
size
,
Dune
::
ParameterTree
const
&
parset
,
int
size
,
Dune
::
ParameterTree
const
&
parset
,
Dune
::
shared_ptr
<
Dune
::
GlobalNonlinearity
<
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
;
...
@@ -164,11 +163,11 @@ void assemble_nonlinearity(
...
@@ -164,11 +163,11 @@ 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
=
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
);
}
else
if
(
friction_model
==
std
::
string
(
"Laursen"
))
{
}
else
if
(
friction_model
==
std
::
string
(
"Laursen"
))
{
myGlobalNonlinearity
=
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
,
nodalIntegrals
);
nodalIntegrals
);
}
else
{
}
else
{
...
@@ -272,11 +271,8 @@ int main(int argc, char *argv[]) {
...
@@ -272,11 +271,8 @@ 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
<
VectorType
,
OperatorType
>
const
>
auto
myGlobalNonlinearity
=
assemble_nonlinearity
<
VectorType
,
OperatorType
>
(
myGlobalNonlinearity
;
grid
->
size
(
grid
->
maxLevel
(),
dim
),
parset
,
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