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
amdis
amdis-core
Commits
9dbcc1d8
Commit
9dbcc1d8
authored
Aug 28, 2019
by
Praetorius, Simon
Browse files
Merge branch 'issue/stokes_operator' into 'master'
added stress tensor part for non-constant viscosity See merge request
!86
parents
71f7f813
50a9b116
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/amdis/localoperators/StokesOperator.hpp
View file @
9dbcc1d8
...
...
@@ -31,8 +31,9 @@ namespace AMDiS
static_assert
(
Size_v
<
typename
ViscosityExpr
::
Range
>
==
1
,
"Viscosity must be of scalar type."
);
public:
GridFunctionOperator
(
tag
::
stokes
,
ViscosityExpr
const
&
expr
)
GridFunctionOperator
(
tag
::
stokes
,
ViscosityExpr
const
&
expr
,
bool
constViscosity
=
false
)
:
Super
(
expr
,
1
)
,
constViscosity_
(
constViscosity
)
{}
template
<
class
CG
,
class
Node
,
class
Mat
>
...
...
@@ -100,6 +101,22 @@ namespace AMDiS
}
}
if
(
!
constViscosity_
)
{
// <viscosity * d_i u_j, d_j v_i>
for
(
std
::
size_t
i
=
0
;
i
<
numVelocityLocalFE
;
++
i
)
{
for
(
std
::
size_t
kj
=
0
;
kj
<
CG
::
dow
;
++
kj
)
{
const
auto
value_i_kj
=
vel_factor
*
gradients
[
i
][
kj
];
for
(
std
::
size_t
j
=
0
;
j
<
numVelocityLocalFE
;
++
j
)
{
for
(
std
::
size_t
ki
=
0
;
ki
<
CG
::
dow
;
++
ki
)
{
const
auto
local_ki
=
tree
.
child
(
_0
,
ki
).
localIndex
(
i
);
const
auto
local_kj
=
tree
.
child
(
_0
,
kj
).
localIndex
(
j
);
elementMatrix
[
local_ki
][
local_kj
]
+=
value_i_kj
*
gradients
[
j
][
ki
];
}
}
}
}
}
// <p, div(v)> + <div(u), q>
for
(
std
::
size_t
i
=
0
;
i
<
numVelocityLocalFE
;
++
i
)
{
for
(
std
::
size_t
j
=
0
;
j
<
numPressureLocalFE
;
++
j
)
{
...
...
@@ -116,6 +133,9 @@ namespace AMDiS
}
}
// end calculateElementMatrix
private:
bool
constViscosity_
;
};
/** @} **/
...
...
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