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
9cfc81ce
Commit
9cfc81ce
authored
8 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
navier-stokes example without shared_ptr
parent
9d10212a
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/navier_stokes.cc
+12
-12
12 additions, 12 deletions
src/navier_stokes.cc
with
12 additions
and
12 deletions
src/navier_stokes.cc
+
12
−
12
View file @
9cfc81ce
...
...
@@ -50,17 +50,17 @@ int main(int argc, char** argv)
For
<
0
,
DOW
>::
loop
([
&
](
auto
const
_i
)
{
// <1/tau * u_i, v_i>
auto
opTime
=
Op
::
create
()
,
opTimeOld
=
Op
::
create
()
;
Op
*
opTime
=
new
Op
,
*
opTimeOld
=
new
Op
;
opTime
->
addZOT
(
density
);
opTimeOld
->
addZOT
(
valueOf
(
prob
.
getSolution
(
_i
),
density
)
);
prob
.
addMatrixOperator
(
opTime
,
_i
,
_i
,
probInstat
.
getInvTau
());
prob
.
addVectorOperator
(
opTimeOld
,
_i
,
probInstat
.
getInvTau
());
prob
.
addMatrixOperator
(
*
opTime
,
_i
,
_i
,
probInstat
.
getInvTau
());
prob
.
addVectorOperator
(
*
opTimeOld
,
_i
,
probInstat
.
getInvTau
());
#if 0
// <(u * nabla)u_i^old, v_i>
For<0, DOW>::loop([&](auto const _j)
{
auto opNonlin =
Op::create()
;
auto opNonlin =
new Op
;
opNonlin->addZOT( derivativeOf(prob.getSolution(_i), _j, density) );
prob.addMatrixOperator(opNonlin, _i, _j);
});
...
...
@@ -68,25 +68,25 @@ int main(int argc, char** argv)
// <(u^old * nabla)u_i, v_i>
For
<
0
,
DOW
>::
loop
([
&
](
auto
const
_j
)
{
auto
opNonlin
=
Op
::
create
()
;
Op
*
opNonlin
=
new
Op
;
opNonlin
->
addFOT
(
valueOf
(
prob
.
getSolution
(
_j
),
density
),
_j
,
GRD_PHI
);
prob
.
addMatrixOperator
(
opNonlin
,
_i
,
_i
);
prob
.
addMatrixOperator
(
*
opNonlin
,
_i
,
_i
);
});
#endif
// <viscosity*grad(u_i), grad(v_i)>
auto
opL
=
Op
::
create
()
;
Op
*
opL
=
new
Op
;
opL
->
addSOT
(
viscosity
);
prob
.
addMatrixOperator
(
opL
,
_i
,
_i
);
prob
.
addMatrixOperator
(
*
opL
,
_i
,
_i
);
// <p, d_i(v_i)>
auto
opP
=
Op
::
create
()
;
Op
*
opP
=
new
Op
;
opP
->
addFOT
(
1.0
,
_i
,
GRD_PSI
);
prob
.
addMatrixOperator
(
opP
,
_i
,
DOW
);
prob
.
addMatrixOperator
(
*
opP
,
_i
,
DOW
);
// <d_i(u_i), q>
auto
opDiv
=
Op
::
create
()
;
Op
*
opDiv
=
new
Op
;
opDiv
->
addFOT
(
1.0
,
_i
,
GRD_PHI
);
prob
.
addMatrixOperator
(
opDiv
,
DOW
,
_i
);
prob
.
addMatrixOperator
(
*
opDiv
,
DOW
,
_i
);
});
// define boundary regions
...
...
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