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
08722574
Commit
08722574
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enable caching for the laursen nonlinearity
parent
56648e34
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/globallaursennonlinearity.hh
+23
-2
23 additions, 2 deletions
dune/tectonic/globallaursennonlinearity.hh
with
23 additions
and
2 deletions
dune/tectonic/globallaursennonlinearity.hh
+
23
−
2
View file @
08722574
...
...
@@ -23,7 +23,17 @@ class GlobalLaursenNonlinearity
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
mu
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
normalStress
,
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
nodalIntegrals
)
:
mu
(
mu
),
normalStress
(
normalStress
),
nodalIntegrals
(
nodalIntegrals
)
{}
:
mu
(
mu
),
normalStress
(
normalStress
),
nodalIntegrals
(
nodalIntegrals
),
trivialNonlinearity
(
new
LocalNonlinearity
<
dim
>
(
make_shared
<
TrivialFunction
const
>
())),
restrictions
(
nodalIntegrals
->
size
())
// TODO: can we get the size from
// another place?
{
for
(
auto
&
x
:
restrictions
)
x
=
shared_ptr
<
LocalNonlinearity
<
dim
>
const
>
();
}
/*
Return a restriction of the outer function to the i'th node. If
...
...
@@ -40,18 +50,29 @@ class GlobalLaursenNonlinearity
sigma_n [id + mu id] = sigma_n (1 + mu) id
*/
virtual
shared_ptr
<
LocalNonlinearity
<
dim
>
const
>
restriction
(
int
i
)
const
{
if
((
*
nodalIntegrals
)[
i
][
0
]
==
0
)
return
trivialNonlinearity
;
if
(
restrictions
[
i
]
!=
nullptr
)
return
restrictions
[
i
];
double
coefficient
=
(
*
nodalIntegrals
)[
i
][
0
];
coefficient
*=
(
*
normalStress
)[
i
];
coefficient
*=
1
+
(
*
mu
)[
i
];
auto
const
func
=
make_shared
<
OuterFunctionType
const
>
(
coefficient
);
return
make_shared
<
LocalNonlinearity
<
dim
>
const
>
(
func
);
restrictions
[
i
]
=
make_shared
<
LocalNonlinearity
<
dim
>
const
>
(
func
);
return
restrictions
[
i
];
}
private
:
shared_ptr
<
LocalNonlinearity
<
dim
>
const
>
const
trivialNonlinearity
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
mu
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
normalStress
;
shared_ptr
<
BlockVector
<
FieldVector
<
double
,
1
>>
const
>
nodalIntegrals
;
std
::
vector
<
shared_ptr
<
LocalNonlinearity
<
dim
>
const
>>
mutable
restrictions
;
};
}
#endif
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