Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Riedel
dune-structures
Commits
a9bf5adc
Commit
a9bf5adc
authored
Jun 23, 2021
by
Lukas Riedel
Browse files
Fix error in computing linear stress for visualization
parent
b94f8d20
Changes
1
Hide whitespace changes
Inline
Side-by-side
dune/structures/stress.hh
View file @
a9bf5adc
...
...
@@ -68,19 +68,17 @@ public:
// Evaluate the strain tensor
using
RF
=
typename
Traits
::
RangeFieldType
;
Dune
::
FieldMatrix
<
RF
,
dim
,
dim
>
strain
;
RF
strain_trace
{
0.0
};
for
(
size_t
i
=
0
;
i
<
dim
;
++
i
)
{
for
(
size_t
j
=
0
;
j
<=
i
;
++
j
)
{
RF
sum
=
displacement_grad
[
i
][
j
]
+
displacement_grad
[
j
][
i
];
for
(
size_t
k
=
0
;
k
<
dim
;
++
k
)
{
sum
+=
displacement_grad
[
i
][
k
]
+
displacement_grad
[
j
][
k
];
}
sum
=
0.5
*
sum
;
strain
[
i
][
j
]
=
sum
;
if
(
i
!=
j
)
strain
[
j
][
i
]
=
sum
;
strain
[
i
][
j
]
=
0.5
*
(
displacement_grad
[
i
][
j
]
+
displacement_grad
[
j
][
i
]);
if
(
i
==
j
)
strain_trace
+=
strain
[
i
][
i
];
else
strain
[
j
][
i
]
=
strain
[
i
][
j
];
}
}
...
...
@@ -97,7 +95,7 @@ public:
stress
[
i
][
j
]
=
2
*
lame2
*
strain
[
i
][
j
];
if
(
i
==
j
)
{
stress
[
i
][
i
]
+=
lame1
*
strain
[
i
][
i
]
;
stress
[
i
][
i
]
+=
lame1
*
strain
_trace
;
}
else
{
...
...
Write
Preview
Supports
Markdown
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