Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lisa_julia.nebel_at_tu-dresden.de
dune-elasticity
Commits
24374806
Commit
24374806
authored
Jul 03, 2012
by
akbib
Committed by
akbib@FU-BERLIN.DE
Jul 03, 2012
Browse files
store local linearization and hessian in shared_ptr and add a setup method
[[Imported from SVN: r11183]]
parent
8f3d8d99
Changes
1
Hide whitespace changes
Inline
Side-by-side
dune/elasticity/materials/geomexactstvenantkirchhoffmaterial.hh
View file @
24374806
...
...
@@ -36,6 +36,10 @@ private:
typedef
typename
GridType
::
template
Codim
<
0
>
::
LeafIterator
ElementIterator
;
public:
GeomExactStVenantMaterial
()
:
E_
(
1.0
),
nu_
(
0.3
)
{}
GeomExactStVenantMaterial
(
const
Basis
&
basis
,
ctype
E
,
ctype
nu
)
:
localLinearization_
(
E
,
nu
),
...
...
@@ -45,6 +49,20 @@ public:
nu_
(
nu
)
{}
void
setup
(
ctype
E
,
ctype
nu
)
{
E_
=
E
;
nu_
=
nu
;
if
(
localLinearization_
)
localLinearization_
.
reset
();
if
(
localHessian_
)
localHessian_
.
reset
();
localLinearization_
=
Dune
::
shared_ptr
<
LocalLinearization
>
(
new
LocalLinearization
(
E
,
nu
));
localHessian_
=
Dune
::
shared_ptr
<
LocalHessian
>
(
new
LocalHessian
(
E
,
nu
));
}
//! Evaluate the strain energy
template
<
class
CoeffType
>
ctype
energy
(
const
CoeffType
&
coeff
)
...
...
@@ -100,20 +118,20 @@ public:
}
//! Return the local assembler of the first derivative of the strain energy
LocalLinearization
&
firstDerivative
()
{
return
localLinearization_
;}
LocalLinearization
&
firstDerivative
()
{
return
*
localLinearization_
;}
//! Return the local assembler of the second derivative of the strain energy
LocalHessian
&
secondDerivative
()
{
return
localHessian_
;}
LocalHessian
&
secondDerivative
()
{
return
*
localHessian_
;}
//! Return the global basis
const
Basis
&
basis
()
{
return
basis_
;}
private:
//! First derivative of the strain energy
LocalLinearization
localLinearization_
;
Dune
::
shared_ptr
<
LocalLinearization
>
localLinearization_
;
//! Second derivative of the strain energy
LocalHessian
localHessian_
;
Dune
::
shared_ptr
<
LocalHessian
>
localHessian_
;
//! Global basis used for the spatial discretization
const
Basis
&
basis_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment