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
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
8a62780d
Commit
8a62780d
authored
4 years ago
by
oliver.sander_at_tu-dresden.de
Browse files
Options
Downloads
Patches
Plain Diff
Modernize LocalIntegralEnergy
parent
4f7ebe3e
No related branches found
No related tags found
1 merge request
!59
Some small modernizations
Pipeline
#36079
failed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/elasticity/materials/localintegralenergy.hh
+10
-8
10 additions, 8 deletions
dune/elasticity/materials/localintegralenergy.hh
with
10 additions
and
8 deletions
dune/elasticity/materials/localintegralenergy.hh
+
10
−
8
View file @
8a62780d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define DUNE_ELASTICITY_MATERIALS_LOCALINTEGRALENERGY_HH
#define DUNE_ELASTICITY_MATERIALS_LOCALINTEGRALENERGY_HH
#include
<dune/common/fmatrix.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/common/transpose.hh>
#include
<dune/geometry/quadraturerules.hh>
#include
<dune/geometry/quadraturerules.hh>
...
@@ -53,8 +54,9 @@ energy(const LocalView& localView,
...
@@ -53,8 +54,9 @@ energy(const LocalView& localView,
field_type
energy
=
0
;
field_type
energy
=
0
;
// store gradients of shape functions and base functions
// store gradients of shape functions and base functions
std
::
vector
<
FieldMatrix
<
DT
,
1
,
gridDim
>
>
referenceGradients
(
localFiniteElement
.
size
());
using
FiniteElement
=
typename
LocalView
::
Tree
::
ChildType
::
FiniteElement
;
std
::
vector
<
FieldVector
<
DT
,
gridDim
>
>
gradients
(
localFiniteElement
.
size
());
using
Jacobian
=
typename
FiniteElement
::
Traits
::
LocalBasisType
::
Traits
::
JacobianType
;
std
::
vector
<
Jacobian
>
jacobians
(
localFiniteElement
.
size
());
int
quadOrder
=
(
element
.
type
().
isSimplex
())
?
localFiniteElement
.
localBasis
().
order
()
int
quadOrder
=
(
element
.
type
().
isSimplex
())
?
localFiniteElement
.
localBasis
().
order
()
:
localFiniteElement
.
localBasis
().
order
()
*
gridDim
;
:
localFiniteElement
.
localBasis
().
order
()
*
gridDim
;
...
@@ -65,23 +67,23 @@ energy(const LocalView& localView,
...
@@ -65,23 +67,23 @@ energy(const LocalView& localView,
{
{
const
DT
integrationElement
=
element
.
geometry
().
integrationElement
(
qp
.
position
());
const
DT
integrationElement
=
element
.
geometry
().
integrationElement
(
qp
.
position
());
const
auto
jacobianInverseTransposed
=
element
.
geometry
().
jacobianInverseTransposed
(
qp
.
position
());
const
auto
geometryJacobianIT
=
element
.
geometry
().
jacobianInverseTransposed
(
qp
.
position
());
// Global position
// Global position
auto
x
=
element
.
geometry
().
global
(
qp
.
position
());
auto
x
=
element
.
geometry
().
global
(
qp
.
position
());
// Get gradients of shape functions
// Get gradients of shape functions
localFiniteElement
.
localBasis
().
evaluateJacobian
(
qp
.
position
(),
referenceGradient
s
);
localFiniteElement
.
localBasis
().
evaluateJacobian
(
qp
.
position
(),
jacobian
s
);
// compute gradients of base functions
// compute gradients of base functions
for
(
size_t
i
=
0
;
i
<
gradient
s
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
jacobian
s
.
size
();
++
i
)
jacobian
InverseTransposed
.
mv
(
referenceGradients
[
i
][
0
],
gradients
[
i
]
);
jacobian
s
[
i
]
=
jacobians
[
i
]
*
transpose
(
geometryJacobianIT
);
// Deformation gradient
// Deformation gradient
FieldMatrix
<
field_type
,
gridDim
,
gridDim
>
deformationGradient
(
0
);
FieldMatrix
<
field_type
,
gridDim
,
gridDim
>
deformationGradient
(
0
);
for
(
size_t
i
=
0
;
i
<
gradient
s
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
jacobian
s
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
gridDim
;
j
++
)
for
(
int
j
=
0
;
j
<
gridDim
;
j
++
)
deformationGradient
[
j
].
axpy
(
localConfiguration
[
localView
.
tree
().
child
(
j
).
localIndex
(
i
)
],
gradients
[
i
]);
deformationGradient
[
j
].
axpy
(
localConfiguration
[
localView
.
tree
().
child
(
j
).
localIndex
(
i
)
],
jacobians
[
i
][
0
]);
// Integrate the energy density
// Integrate the energy density
energy
+=
qp
.
weight
()
*
integrationElement
*
(
*
localDensity_
)(
x
,
deformationGradient
);
energy
+=
qp
.
weight
()
*
integrationElement
*
(
*
localDensity_
)(
x
,
deformationGradient
);
}
}
...
...
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