Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-elasticity
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
agnumpde
dune-elasticity
Commits
1190401c
Commit
1190401c
authored
Jan 16, 2014
by
akbib
Committed by
akbib
Jan 16, 2014
Browse files
Options
Downloads
Patches
Plain Diff
Inherit from new abstract base class + cleanup and renaming.
[[Imported from SVN: r12666]]
parent
76ee7b69
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/elasticity/materials/geomexactstvenantkirchhoffmaterial.hh
+56
-95
56 additions, 95 deletions
...lasticity/materials/geomexactstvenantkirchhoffmaterial.hh
with
56 additions
and
95 deletions
dune/elasticity/materials/geomexactstvenantkirchhoffmaterial.hh
+
56
−
95
View file @
1190401c
#ifndef GEOMETRICALLY_EXACT_ST_VENANT_KIRCHHOFF_MATERIAL
// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#define GEOMETRICALLY_EXACT_ST_VENANT_KIRCHHOFF_MATERIAL
// vi: set ts=8 sw=4 et sts=4:
#ifndef DUNE_ELASTICITY_MATERIALS_GEOMETRICALLY_EXACT_ST_VENANT_KIRCHHOFF_MATERIAL_HH
#define DUNE_ELASTICITY_MATERIALS_GEOMETRICALLY_EXACT_ST_VENANT_KIRCHHOFF_MATERIAL_HH
#include
<dune/fufem/quadraturerules/quadraturerulecache.hh>
#include
<dune/fufem/quadraturerules/quadraturerulecache.hh>
#include
<dune/fufem/symmetrictensor.hh>
#include
<dune/fufem/symmetrictensor.hh>
#include
<dune/fufem/functions/virtualgridfunction.hh>
#include
<dune/fufem/functions/virtualgridfunction.hh>
#include
<dune/fufem/functions/basisgridfunction.hh>
#include
<dune/fufem/assemblers/localassemblers/geononlinstvenantfunctionalassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/geononlinstvenantfunctionalassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/geononlinlinearizedstvenantassembler.hh>
#include
<dune/fufem/assemblers/localassemblers/geononlinlinearizedstvenantassembler.hh>
#include
<dune/elasticity/materials/material.hh>
#include
<dune/elasticity/common/elasticityhelpers.hh>
/* \brief Class representing a hyperelastic geometrically exact St.Venant Kirchhoff material.
/* \brief Class representing a hyperelastic geometrically exact St.Venant Kirchhoff material.
*
*
* \tparam Basis Global basis that is used for the spatial discretization.
* \tparam Basis Global basis that is used for the spatial discretization.
* (This is not nice but I need a LocalFiniteElement for the local Hessian assembler :-( )
* (This is not nice but I need a LocalFiniteElement for the local Hessian assembler :-( )
*/
*/
template
<
class
Basis
>
template
<
class
Basis
>
class
GeomExactStVenantMaterial
class
GeomExactStVenantMaterial
:
public
Material
<
Basis
>
{
{
typedef
Material
<
Basis
>
Base
;
public:
public:
typedef
typename
Basis
::
GridView
::
Grid
GridType
;
typedef
typename
Basis
::
GridView
::
Grid
GridType
;
typedef
typename
Basis
::
LocalFiniteElement
Lfe
;
typedef
typename
Base
::
GlobalBasis
GlobalBasis
;
typedef
typename
Base
::
Lfe
Lfe
;
typedef
typename
Base
::
LocalLinearization
LocalLinearization
;
typedef
typename
Base
::
LocalHessian
LocalHessian
;
typedef
typename
Base
::
VectorType
VectorType
;
typedef
typename
Base
::
GridFunction
GridFunction
;
typedef
typename
Base
::
ReturnType
ReturnType
;
typedef
GeomNonlinElasticityFunctionalAssembler
<
GridType
,
Lfe
>
LocalLinearization
;
typedef
GeomNonlinLinearizedStVenantAssembler
<
GridType
,
Lfe
,
Lfe
>
LocalHessian
;
typedef
Basis
GlobalBasis
;
private:
private:
using
Base
::
dim
;
typedef
typename
GridType
::
ctype
ctype
;
typedef
typename
GridType
::
ctype
ctype
;
typedef
GeomNonlinElasticityFunctionalAssembler
<
GridType
,
Lfe
>
GeomLinearization
;
static
const
int
dim
=
GridType
::
dimension
;
typedef
GeomNonlinLinearizedStVenantAssembler
<
GridType
,
Lfe
,
Lfe
>
GeomHessian
;
static
const
int
dimworld
=
GridType
::
dimensionworld
;
typedef
typename
GridType
::
template
Codim
<
0
>
::
Geometry
::
LocalCoordinate
LocalCoordinate
;
typedef
typename
GridType
::
template
Codim
<
0
>
::
Geometry
::
LocalCoordinate
LocalCoordinate
;
typedef
typename
GridType
::
template
Codim
<
0
>
::
LeafIterator
ElementIterator
;
typedef
typename
GridType
::
template
Codim
<
0
>
::
LeafIterator
ElementIterator
;
...
@@ -41,51 +46,31 @@ public:
...
@@ -41,51 +46,31 @@ public:
nu_
(
0.3
)
nu_
(
0.3
)
{}
{}
GeomExactStVenantMaterial
(
const
Basis
&
basis
,
ctype
E
,
ctype
nu
)
:
GeomExactStVenantMaterial
(
const
Basis
&
basis
,
ReturnType
E
,
ReturnType
nu
)
:
localLinearization_
(
E
,
nu
),
Base
(
basis
),
localHessian_
(
E
,
nu
),
basis_
(
basis
),
E_
(
E
),
E_
(
E
),
nu_
(
nu
)
nu_
(
nu
)
{}
void
getMaterialParameters
(
ctype
&
E
,
ctype
&
nu
)
{
E
=
E_
;
nu
=
nu_
;
}
void
setMaterialParameters
(
ctype
E
,
ctype
nu
)
{
{
E_
=
E
;
localLinearization_
=
Dune
::
shared_ptr
<
GeomLinearization
>
(
new
GeomLinearization
(
E
,
nu
))
;
nu_
=
nu
;
localHessian_
=
Dune
::
shared_ptr
<
GeomHessian
>
(
new
GeomHessian
(
E
,
nu
))
;
}
}
void
setup
(
ctype
E
,
ct
ype
nu
,
const
Basis
&
basis
)
void
setup
(
ReturnType
E
,
ReturnT
ype
nu
,
const
Basis
&
basis
)
{
{
E_
=
E
;
E_
=
E
;
nu_
=
nu
;
nu_
=
nu
;
if
(
localLinearization_
)
localLinearization_
.
reset
();
if
(
localHessian_
)
localHessian_
.
reset
();
localLinearization_
=
Dune
::
shared_ptr
<
Local
Linearization
>
(
new
Local
Linearization
(
E
,
nu
));
localLinearization_
=
Dune
::
shared_ptr
<
Geom
Linearization
>
(
new
Geom
Linearization
(
E
,
nu
));
localHessian_
=
Dune
::
shared_ptr
<
Local
Hessian
>
(
new
Local
Hessian
(
E
,
nu
));
localHessian_
=
Dune
::
shared_ptr
<
Geom
Hessian
>
(
new
Geom
Hessian
(
E
,
nu
));
basis_
=
&
basis
;
this
->
basis_
=
&
basis
;
}
}
//! Evaluate the strain energy
//! Evaluate the strain energy
template
<
class
CoeffType
>
ReturnType
energy
(
const
GridFunction
&
displace
)
ctype
energy
(
const
CoeffType
&
coeff
)
{
{
// make grid function
BasisGridFunction
<
Basis
,
CoeffType
>
configuration
(
*
basis_
,
coeff
);
ctype
energy
=
0
;
ctype
energy
=
0
;
const
GridType
&
grid
=
configuration
.
grid
();
const
GridType
&
grid
=
this
->
basis_
->
getGridView
()
.
grid
();
ElementIterator
eIt
=
grid
.
template
leafbegin
<
0
>();
ElementIterator
eIt
=
grid
.
template
leafbegin
<
0
>();
ElementIterator
eItEnd
=
grid
.
template
leafend
<
0
>();
ElementIterator
eItEnd
=
grid
.
template
leafend
<
0
>();
...
@@ -93,7 +78,7 @@ public:
...
@@ -93,7 +78,7 @@ public:
for
(;
eIt
!=
eItEnd
;
++
eIt
)
{
for
(;
eIt
!=
eItEnd
;
++
eIt
)
{
// get quadrature rule
// get quadrature rule
QuadratureRuleKey
quad1
(
basis_
->
getLocalFiniteElement
(
*
eIt
));
QuadratureRuleKey
quad1
(
this
->
basis_
->
getLocalFiniteElement
(
*
eIt
));
QuadratureRuleKey
quadKey
=
quad1
.
derivative
().
square
().
square
();
QuadratureRuleKey
quadKey
=
quad1
.
derivative
().
square
().
square
();
const
Dune
::
template
QuadratureRule
<
ctype
,
dim
>
&
quad
=
QuadratureRuleCache
<
ctype
,
dim
>::
rule
(
quadKey
);
const
Dune
::
template
QuadratureRule
<
ctype
,
dim
>
&
quad
=
QuadratureRuleCache
<
ctype
,
dim
>::
rule
(
quadKey
);
...
@@ -108,23 +93,22 @@ public:
...
@@ -108,23 +93,22 @@ public:
const
ctype
integrationElement
=
eIt
->
geometry
().
integrationElement
(
quadPos
);
const
ctype
integrationElement
=
eIt
->
geometry
().
integrationElement
(
quadPos
);
// evaluate displacement gradient at the quadrature point
// evaluate displacement gradient at the quadrature point
typename
Basis
GridFunction
<
Basis
,
CoeffType
>
::
DerivativeType
local
Conf
Grad
;
typename
GridFunction
::
DerivativeType
local
Disp
Grad
;
if
(
configuration
.
isDefinedOn
(
*
eIt
))
if
(
displace
->
isDefinedOn
(
*
eIt
))
configuration
.
evaluateDerivativeLocal
(
*
eIt
,
quadPos
,
local
Conf
Grad
);
displace
->
evaluateDerivativeLocal
(
*
eIt
,
quadPos
,
local
Disp
Grad
);
else
else
configuration
.
evaluateDerivative
(
eIt
->
geometry
().
global
(
quadPos
),
local
Conf
Grad
);
displace
->
evaluateDerivative
(
eIt
->
geometry
().
global
(
quadPos
),
local
Disp
Grad
);
// Compute the nonlinear strain tensor from the deformation gradient
// Compute the nonlinear strain tensor from the deformation gradient
SymmetricTensor
<
dim
>
strain
;
SymmetricTensor
<
dim
,
ReturnType
>
strain
;
compute
Strain
(
local
Conf
Grad
,
strain
);
Dune
::
Elasticity
::
computeNonlinear
Strain
(
local
Disp
Grad
,
strain
);
// and the stress
// and the stress
SymmetricTensor
<
dim
>
stress
=
hookeTimesStrain
(
strain
);
SymmetricTensor
<
dim
,
ReturnType
>
stress
=
hookeTimesStrain
(
strain
);
ctype
z
=
quad
[
pt
].
weight
()
*
integrationElement
;
ctype
z
=
quad
[
pt
].
weight
()
*
integrationElement
;
energy
+=
(
stress
*
strain
)
*
z
;
energy
+=
(
stress
*
strain
)
*
z
;
}
}
}
}
...
@@ -132,67 +116,44 @@ public:
...
@@ -132,67 +116,44 @@ public:
}
}
//! Return the local assembler of the first derivative of the strain energy
//! Return the local assembler of the first derivative of the strain energy
LocalLinearization
&
firstDerivative
()
{
return
*
localLinearization_
;}
LocalLinearization
&
firstDerivative
(
const
GridFunction
&
displace
)
{
localLinearization_
->
setConfiguration
(
displace
);
return
*
localLinearization_
;
}
//! Return the local assembler of the second derivative of the strain energy
//! Return the local assembler of the second derivative of the strain energy
LocalHessian
&
secondDerivative
()
{
return
*
localHessian_
;}
LocalHessian
&
secondDerivative
(
const
GridFunction
&
displace
)
{
//! Return the global basis
localHessian_
->
setConfiguration
(
displace
);
const
Basis
&
basis
()
{
return
*
basis_
;}
return
*
localHessian_
;
}
private
:
private
:
//! First derivative of the strain energy
//! First derivative of the strain energy
Dune
::
shared_ptr
<
Local
Linearization
>
localLinearization_
;
Dune
::
shared_ptr
<
Geom
Linearization
>
localLinearization_
;
//! Second derivative of the strain energy
//! Second derivative of the strain energy
Dune
::
shared_ptr
<
LocalHessian
>
localHessian_
;
Dune
::
shared_ptr
<
GeomHessian
>
localHessian_
;
//! Global basis used for the spatial discretization
const
Basis
*
basis_
;
//! Elasticity modulus
//! Elasticity modulus
ct
ype
E_
;
ReturnT
ype
E_
;
//! Poisson ratio
//! Poisson ratio
ctype
nu_
;
ReturnType
nu_
;
//! Compute nonlinear strain tensor from the deformation gradient.
void
computeStrain
(
const
Dune
::
FieldMatrix
<
ctype
,
dim
,
dim
>&
grad
,
SymmetricTensor
<
dim
>&
strain
)
const
{
strain
=
0
;
for
(
int
i
=
0
;
i
<
dim
;
++
i
)
{
strain
(
i
,
i
)
+=
grad
[
i
][
i
];
for
(
int
k
=
0
;
k
<
dim
;
++
k
)
strain
(
i
,
i
)
+=
0.5
*
grad
[
k
][
i
]
*
grad
[
k
][
i
];
for
(
int
j
=
i
+
1
;
j
<
dim
;
++
j
)
{
strain
(
i
,
j
)
+=
0.5
*
(
grad
[
i
][
j
]
+
grad
[
j
][
i
]);
for
(
int
k
=
0
;
k
<
dim
;
++
k
)
strain
(
i
,
j
)
+=
0.5
*
grad
[
k
][
i
]
*
grad
[
k
][
j
];
}
}
}
//! Compute linear elastic stress from the strain
//! Compute linear elastic stress from the strain
SymmetricTensor
<
dim
>
hookeTimesStrain
(
const
SymmetricTensor
<
dim
>&
strain
)
const
{
SymmetricTensor
<
dim
,
ReturnType
>
hookeTimesStrain
(
const
SymmetricTensor
<
dim
,
ReturnType
>&
strain
)
const
{
SymmetricTensor
<
dim
>
stress
=
strain
;
SymmetricTensor
<
dim
,
ReturnType
>
stress
=
strain
;
stress
*=
E_
/
(
1
+
nu_
);
stress
*=
E_
/
(
1
+
nu_
);
// Compute the trace of the strain
ReturnType
f
=
E_
*
nu_
/
((
1
+
nu_
)
*
(
1
-
2
*
nu_
))
*
strain
.
trace
();
ctype
trace
=
0
;
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
trace
+=
strain
(
i
,
i
);
ctype
f
=
E_
*
nu_
/
((
1
+
nu_
)
*
(
1
-
2
*
nu_
))
*
trace
;
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
for
(
int
i
=
0
;
i
<
dim
;
i
++
)
stress
(
i
,
i
)
+=
f
;
stress
(
i
,
i
)
+=
f
;
return
stress
;
return
stress
;
}
}
};
};
#endif
#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