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
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
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
Ansgar Burchardt
dune-elasticity
Commits
a8bb4042
Commit
a8bb4042
authored
7 years ago
by
Jonathan Youett
Browse files
Options
Downloads
Patches
Plain Diff
Major cleanup
parent
709c603d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/elasticity/materials/geomexactstvenantkirchhoffmaterial.hh
+27
-37
27 additions, 37 deletions
...lasticity/materials/geomexactstvenantkirchhoffmaterial.hh
with
27 additions
and
37 deletions
dune/elasticity/materials/geomexactstvenantkirchhoffmaterial.hh
+
27
−
37
View file @
a8bb4042
...
...
@@ -34,9 +34,9 @@ public:
private:
using
Base
::
dim
;
typedef
typename
GridType
::
ctype
ctype
;
typedef
GeomExactStVenantKirchhoffFunctionalAssembler
<
GridType
,
Lfe
>
Geom
Lineari
z
ation
;
typedef
GeomExactStVenantKirchhoffOperatorAssembler
<
GridType
,
Lfe
,
Lfe
>
Geom
Hessian
;
typedef
typename
GridType
::
template
Codim
<
0
>
::
Geometry
::
LocalCoordinate
LocalCoordinate
;
typedef
GeomExactStVenantKirchhoffFunctionalAssembler
<
GridType
,
Lfe
>
Lineari
s
ation
Assembler
;
typedef
GeomExactStVenantKirchhoffOperatorAssembler
<
GridType
,
Lfe
,
Lfe
>
Hessian
Assembler
;
using
Derivative
=
typename
GridFunction
::
DerivativeType
;
using
StressFunction
=
std
::
function
<
SymmetricTensor
<
dim
,
ReturnType
>
(
Derivative
)
>
;
...
...
@@ -51,8 +51,8 @@ public:
lambda_
(
E
*
nu
/
((
1
+
nu
)
*
(
1
-
2
*
nu
))),
mu_
(
E
/
(
2
+
2
*
nu
))
{
localLineari
z
ation_
=
std
::
make_shared
<
GeomLinearization
>
(
E
,
nu
);
localHessian_
=
std
::
make_shared
<
GeomHessian
>
(
E
,
nu
);
localLineari
s
ation_
.
setStiffnessParameter
(
E
,
nu
);
localHessian_
.
setStiffnessParameter
(
E
,
nu
);
}
void
setup
(
ReturnType
E
,
ReturnType
nu
,
const
Basis
&
basis
)
...
...
@@ -61,8 +61,8 @@ public:
lambda_
=
E
*
nu
/
((
1
+
nu
)
*
(
1
-
2
*
nu
));
mu_
=
E
/
(
2
+
2
*
nu
);
localLineari
z
ation_
=
std
::
make_shared
<
GeomLinearization
>
(
E
,
nu
);
localHessian_
=
std
::
make_shared
<
GeomHessian
>
(
E
,
nu
);
localLineari
s
ation_
.
setStiffnessParameter
(
E
,
nu
);
localHessian_
.
setStiffnessParameter
(
E
,
nu
);
this
->
basis_
=
&
basis
;
}
...
...
@@ -70,9 +70,9 @@ public:
//! Evaluate the strain energy
ReturnType
energy
(
std
::
shared_ptr
<
GridFunction
>
displace
)
const
{
ReturnType
energy
=
0
;
ReturnType
energy
{
0
}
;
const
auto
gridView
=
this
->
basis_
->
getGridView
();
const
auto
&
gridView
=
this
->
basis_
->
getGridView
();
for
(
const
auto
&
e
:
elements
(
gridView
))
{
...
...
@@ -82,55 +82,45 @@ public:
const
auto
&
quad
=
QuadratureRuleCache
<
ctype
,
dim
>::
rule
(
quadKey
);
// get the element geometry
const
auto
&
geometry
=
e
.
geometry
();
// loop over quadrature points
for
(
size_t
pt
=
0
;
pt
<
quad
.
size
();
++
pt
)
{
// get quadrature point
const
LocalCoordinate
&
quadPos
=
quad
[
pt
].
position
();
for
(
const
auto
&
pt
:
quad
)
{
// get integration factor
const
ctype
integrationElement
=
geometry
.
integrationElement
(
quadPos
);
// evaluate displacement gradient at the quadrature point
typename
GridFunction
::
DerivativeType
localDispGrad
;
const
auto
&
quadPos
=
pt
.
position
();
Derivative
localDispGrad
;
if
(
displace
->
isDefinedOn
(
e
))
displace
->
evaluateDerivativeLocal
(
e
,
quadPos
,
localDispGrad
);
else
displace
->
evaluateDerivative
(
geometry
.
global
(
quadPos
),
localDispGrad
);
displace
->
evaluateDerivative
(
geometry
.
global
(
quadPos
),
localDispGrad
);
// Compute the nonlinear strain tensor from the deformation gradient
SymmetricTensor
<
dim
,
ReturnType
>
strain
;
Dune
::
Elasticity
::
strain
(
localDispGrad
,
strain
);
SymmetricTensor
<
dim
,
ReturnType
>
strain
;
Dune
::
Elasticity
::
strain
(
localDispGrad
,
strain
);
// and the stress
SymmetricTensor
<
dim
,
ReturnType
>
stress
=
strain
;
SymmetricTensor
<
dim
,
ReturnType
>
stress
=
strain
;
stress
*=
2
*
mu_
;
stress
.
addToDiag
(
lambda_
*
strain
.
trace
());
stress
.
addToDiag
(
lambda_
*
strain
.
trace
());
ct
ype
z
=
quad
[
pt
]
.
weight
()
*
integrationElement
;
ReturnT
ype
z
=
pt
.
weight
()
*
geometry
.
integrationElement
(
quadPos
)
;
energy
+=
(
stress
*
strain
)
*
z
;
}
}
return
0.5
*
energy
;
}
//! Return the local assembler of the first derivative of the strain energy
Local
Lineari
z
ation
&
firstDerivative
(
std
::
shared_ptr
<
GridFunction
>
displace
)
Lineari
s
ation
Assembler
&
firstDerivative
(
std
::
shared_ptr
<
GridFunction
>
displace
)
{
localLineari
z
ation_
->
setConfiguration
(
displace
);
return
*
localLineari
z
ation_
;
localLineari
s
ation_
.
setConfiguration
(
displace
);
return
localLineari
s
ation_
;
}
//! Return the local assembler of the second derivative of the strain energy
Local
Hessian
&
secondDerivative
(
std
::
shared_ptr
<
GridFunction
>
displace
)
Hessian
Assembler
&
secondDerivative
(
std
::
shared_ptr
<
GridFunction
>
displace
)
{
localHessian_
->
setConfiguration
(
displace
);
return
*
localHessian_
;
localHessian_
.
setConfiguration
(
displace
);
return
localHessian_
;
}
static
StressFunction
stressFunction
(
ReturnType
E
,
ReturnType
nu
)
{
ReturnType
lambda
{
E
*
nu
/
(
1.0
+
nu
)
/
(
1.0
-
2.0
*
nu
)};
...
...
@@ -151,10 +141,10 @@ public:
private
:
//! First derivative of the strain energy
std
::
shared_ptr
<
Geom
Lineari
z
ation
>
localLineari
z
ation_
;
Lineari
s
ation
Assembler
localLineari
s
ation_
;
//! Second derivative of the strain energy
std
::
shared_ptr
<
GeomHessian
>
localHessian_
;
HessianAssembler
localHessian_
;
//! 1. Lam\'e constant
ReturnType
lambda_
;
...
...
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