Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
podlesny
dune-tectonic
Commits
445acbcb
"src/foam/foam.cc" did not exist on "be8301e00b70535cd488ea29c061a77c81612c99"
Commit
445acbcb
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
u_old_old -> u_old_old_ptr
parent
35bd0f6d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/timestepping.cc
+13
-13
13 additions, 13 deletions
src/timestepping.cc
with
13 additions
and
13 deletions
src/timestepping.cc
+
13
−
13
View file @
445acbcb
...
...
@@ -2,14 +2,14 @@ template <class VectorType, class MatrixType, class FunctionType, int dim>
class
TimeSteppingScheme
{
public:
TimeSteppingScheme
(
VectorType
const
&
_ell
,
MatrixType
const
&
_A
,
VectorType
const
&
_u_old
,
VectorType
const
*
_u_old_old
,
VectorType
const
&
_u_old
,
VectorType
const
*
_u_old_old
_ptr
,
Dune
::
BitSetVector
<
dim
>
const
&
_dirichletNodes
,
FunctionType
const
&
_dirichletFunction
,
double
_time
,
double
_tau
)
:
ell
(
_ell
),
A
(
_A
),
u_old
(
_u_old
),
u_old_old
(
_u_old_old
),
u_old_old
_ptr
(
_u_old_old
_ptr
),
dirichletNodes
(
_dirichletNodes
),
dirichletFunction
(
_dirichletFunction
),
time
(
_time
),
...
...
@@ -30,7 +30,7 @@ class TimeSteppingScheme {
VectorType
const
&
ell
;
MatrixType
const
&
A
;
VectorType
const
&
u_old
;
VectorType
const
*
u_old_old
;
VectorType
const
*
u_old_old
_ptr
;
Dune
::
BitSetVector
<
dim
>
const
&
dirichletNodes
;
FunctionType
const
&
dirichletFunction
;
double
const
time
;
...
...
@@ -61,8 +61,8 @@ class ImplicitEuler
// Treat as Delta u_n for now
problem_iterate
=
this
->
u_old
;
if
(
this
->
u_old_old
)
problem_iterate
-=
*
this
->
u_old_old
;
if
(
this
->
u_old_old
_ptr
)
problem_iterate
-=
*
this
->
u_old_old
_ptr
;
for
(
size_t
i
=
0
;
i
<
this
->
dirichletNodes
.
size
();
++
i
)
if
(
this
->
dirichletNodes
[
i
].
count
()
==
dim
)
{
...
...
@@ -105,14 +105,14 @@ class ImplicitTwoStep
MatrixType
&
problem_A
)
const
{
problem_rhs
=
this
->
ell
;
this
->
A
.
usmv
(
-
4.0
/
3.0
,
this
->
u_old
,
problem_rhs
);
this
->
A
.
usmv
(
+
1.0
/
3.0
,
*
this
->
u_old_old
,
problem_rhs
);
this
->
A
.
usmv
(
+
1.0
/
3.0
,
*
this
->
u_old_old
_ptr
,
problem_rhs
);
problem_A
=
this
->
A
;
problem_A
*=
2.0
/
3.0
*
this
->
tau
;
// The finite difference makes a good start (treat it as such for now)
problem_iterate
=
this
->
u_old
;
problem_iterate
-=
*
this
->
u_old_old
;
problem_iterate
-=
*
this
->
u_old_old
_ptr
;
for
(
size_t
i
=
0
;
i
<
this
->
dirichletNodes
.
size
();
++
i
)
if
(
this
->
dirichletNodes
[
i
].
count
()
==
dim
)
{
...
...
@@ -120,13 +120,13 @@ class ImplicitTwoStep
this
->
dirichletFunction
.
evaluate
(
this
->
time
,
val
);
problem_iterate
[
i
]
=
0
;
problem_iterate
[
i
].
axpy
(
-
2
,
this
->
u_old
[
i
]);
problem_iterate
[
i
].
axpy
(
.5
,
(
*
this
->
u_old_old
)[
i
]);
problem_iterate
[
i
][
0
]
=
1.5
*
val
-
2
*
this
->
u_old
[
i
][
0
]
+
.5
*
(
*
this
->
u_old_old
)[
i
][
0
];
problem_iterate
[
i
].
axpy
(
.5
,
(
*
this
->
u_old_old
_ptr
)[
i
]);
problem_iterate
[
i
][
0
]
=
1.5
*
val
-
2
*
this
->
u_old
[
i
][
0
]
+
.5
*
(
*
this
->
u_old_old
_ptr
)[
i
][
0
];
}
else
if
(
this
->
dirichletNodes
[
i
][
1
])
// Y direction described
problem_iterate
[
i
][
1
]
=
-
2
*
this
->
u_old
[
i
][
1
]
+
.5
*
(
*
this
->
u_old_old
)[
i
][
1
];
-
2
*
this
->
u_old
[
i
][
1
]
+
.5
*
(
*
this
->
u_old_old
_ptr
)[
i
][
1
];
// Now treat it as a velocity
problem_iterate
/=
this
->
tau
;
}
...
...
@@ -136,7 +136,7 @@ class ImplicitTwoStep
solution
=
problem_iterate
;
solution
*=
this
->
tau
;
solution
.
axpy
(
2
,
this
->
u_old
);
solution
.
axpy
(
-
.5
,
*
this
->
u_old_old
);
solution
.
axpy
(
-
.5
,
*
this
->
u_old_old
_ptr
);
solution
*=
2.0
/
3.0
;
// Check if we split correctly
...
...
@@ -145,7 +145,7 @@ class ImplicitTwoStep
test
*=
this
->
tau
;
test
.
axpy
(
-
1.5
,
solution
);
test
.
axpy
(
+
2
,
this
->
u_old
);
test
.
axpy
(
-
.5
,
*
this
->
u_old_old
);
test
.
axpy
(
-
.5
,
*
this
->
u_old_old
_ptr
);
assert
(
test
.
two_norm
()
<
1e-10
);
}
}
...
...
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