Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
amdis
amdis-core
Commits
50a9b116
Commit
50a9b116
authored
5 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
added stress tensor part for non-constant viscosity
parent
71f7f813
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/amdis/localoperators/StokesOperator.hpp
+21
-1
21 additions, 1 deletion
src/amdis/localoperators/StokesOperator.hpp
with
21 additions
and
1 deletion
src/amdis/localoperators/StokesOperator.hpp
+
21
−
1
View file @
50a9b116
...
...
@@ -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_
;
};
/** @} **/
...
...
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