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
bd9b581f
Commit
bd9b581f
authored
6 years ago
by
Jonathan Youett
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup
parent
d3d666b1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/elasticity/materials/mooneyrivlinmaterial.hh
+4
-4
4 additions, 4 deletions
dune/elasticity/materials/mooneyrivlinmaterial.hh
dune/elasticity/materials/neohookeanmaterial.hh
+5
-13
5 additions, 13 deletions
dune/elasticity/materials/neohookeanmaterial.hh
with
9 additions
and
17 deletions
dune/elasticity/materials/mooneyrivlinmaterial.hh
+
4
−
4
View file @
bd9b581f
...
...
@@ -90,15 +90,15 @@ public:
//! Evaluate the strain energy
field_type
energy
(
std
::
shared_ptr
<
GridFunction
>
displace
)
const
{
c
type
energy
=
0
;
const
auto
&
leafView
=
this
->
basis
().
getGridView
()
.
grid
().
leafGridView
()
;
field_
type
energy
=
0
;
const
auto
&
leafView
=
this
->
basis
().
getGridView
();
for
(
const
auto
&
e
:
elements
(
leafView
))
{
// TODO Get proper quadrature rule
// get quadrature rule (should depend on k?)
const
int
order
=
(
e
.
type
().
isSimplex
())
?
5
:
5
*
dim
;
const
auto
&
quad
=
QuadratureRuleCache
<
c
type
,
dim
>::
rule
(
e
.
type
(),
order
,
0
);
const
auto
&
quad
=
QuadratureRuleCache
<
field_
type
,
dim
>::
rule
(
e
.
type
(),
order
,
0
);
const
auto
&
geometry
=
e
.
geometry
();
...
...
@@ -109,7 +109,7 @@ public:
auto
integrationElement
=
geometry
.
integrationElement
(
quadPos
);
// evaluate displacement gradient at the quadrature point
typename
BasisGridFunction
<
Basis
,
VectorType
>::
DerivativeType
localConfGrad
;
typename
BasisGridFunction
<
Basis
,
typename
Base
::
VectorType
>::
DerivativeType
localConfGrad
;
if
(
displace
->
isDefinedOn
(
e
))
displace
->
evaluateDerivativeLocal
(
e
,
quadPos
,
localConfGrad
);
...
...
This diff is collapsed.
Click to expand it.
dune/elasticity/materials/neohookeanmaterial.hh
+
5
−
13
View file @
bd9b581f
...
...
@@ -107,11 +107,8 @@ public:
// loop over quadrature points
for
(
const
auto
&
pt
:
quad
)
{
// get quadrature point
const
auto
&
quadPos
=
pt
.
position
();
// get integration factor
const
ctype
integrationElement
=
geometry
.
integrationElement
(
quadPos
);
const
auto
integrationElement
=
geometry
.
integrationElement
(
quadPos
);
// evaluate displacement gradient at the quadrature point
typename
BasisGridFunction
<
Basis
,
typename
Base
::
VectorType
>::
DerivativeType
localDispGrad
;
...
...
@@ -119,21 +116,17 @@ public:
if
(
displace
->
isDefinedOn
(
e
))
displace
->
evaluateDerivativeLocal
(
e
,
quadPos
,
localDispGrad
);
else
displace
->
evaluateDerivative
(
geometry
.
global
(
quadPos
),
localDispGrad
);
SymmetricTensor
<
dim
,
ReturnType
>
strain
;
Dune
::
Elasticity
::
strain
(
localDispGrad
,
strain
);
displace
->
evaluateDerivative
(
geometry
.
global
(
quadPos
),
localDispGrad
);
// the trace
auto
strain
=
Dune
::
Elasticity
::
strain
(
localDispGrad
);
auto
trE
=
strain
.
trace
();
// turn displacement gradient into deformation gradient
Dune
::
MatrixVector
::
addToDiagonal
(
localDispGrad
,
1.0
);
// evaluate the derminante of the deformation gradient
const
ReturnType
J
=
localDispGrad
.
determinant
();
ctype
z
=
pt
.
weight
()
*
integrationElement
;
auto
J
=
localDispGrad
.
determinant
();
auto
z
=
pt
.
weight
()
*
integrationElement
;
#ifdef LAURSEN
energy
+=
z
*
(
0.25
*
lambda_
*
(
J
*
J
-
1
)
-
(
lambda_
*
0.5
+
mu_
)
*
std
::
log
(
J
)
+
mu_
*
trE
);
...
...
@@ -142,7 +135,6 @@ public:
#endif
}
}
return
energy
;
}
...
...
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