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
6add5746
Commit
6add5746
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rename: twoStageImplicit -> ImplicitTwoStep
parent
1094fd78
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/one-body-sample.cc
+21
-21
21 additions, 21 deletions
src/one-body-sample.cc
src/one-body-sample.parset
+1
-1
1 addition, 1 deletion
src/one-body-sample.parset
with
22 additions
and
22 deletions
src/one-body-sample.cc
+
21
−
21
View file @
6add5746
...
...
@@ -156,12 +156,12 @@ void implicitEulerExtractVelocity(VectorType const &u_old,
//
// Setup: Substract a(u_new, .) from rhs
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
void
twoStage
ImplicitSetup
(
VectorType
const
&
ell
,
MatrixType
const
&
A
,
VectorType
const
&
u_old
,
VectorType
const
*
u_old_old
,
VectorType
&
problem_rhs
,
VectorType
&
problem_iterate
,
MatrixType
&
problem_A
,
Dune
::
BitSetVector
<
dim
>
const
&
dirichletNodes
,
FunctionType
const
&
dirichletFunction
,
double
time
)
{
void
Implicit
TwoStep
Setup
(
VectorType
const
&
ell
,
MatrixType
const
&
A
,
VectorType
const
&
u_old
,
VectorType
const
*
u_old_old
,
VectorType
&
problem_rhs
,
VectorType
&
problem_iterate
,
MatrixType
&
problem_A
,
Dune
::
BitSetVector
<
dim
>
const
&
dirichletNodes
,
FunctionType
const
&
dirichletFunction
,
double
time
)
{
problem_A
=
A
;
problem_A
/=
1.5
;
problem_rhs
=
ell
;
...
...
@@ -187,10 +187,10 @@ void twoStageImplicitSetup(VectorType const &ell, MatrixType const &A,
}
template
<
class
VectorType
>
void
twoStage
ImplicitExtract
(
VectorType
const
&
u_old
,
VectorType
const
*
u_old_old
,
VectorType
const
&
problem_iterate
,
VectorType
&
solution
)
{
void
Implicit
TwoStep
Extract
(
VectorType
const
&
u_old
,
VectorType
const
*
u_old_old
,
VectorType
const
&
problem_iterate
,
VectorType
&
solution
)
{
solution
=
problem_iterate
;
solution
.
axpy
(
2
,
u_old
);
solution
.
axpy
(
-
.5
,
*
u_old_old
);
...
...
@@ -207,10 +207,10 @@ void twoStageImplicitExtract(VectorType const &u_old,
}
template
<
class
VectorType
>
void
twoStage
ImplicitExtractVelocity
(
VectorType
const
&
u_old
,
VectorType
const
*
u_old_old
,
VectorType
const
&
problem_iterate
,
VectorType
&
diff
)
{
void
Implicit
TwoStep
ExtractVelocity
(
VectorType
const
&
u_old
,
VectorType
const
*
u_old_old
,
VectorType
const
&
problem_iterate
,
VectorType
&
diff
)
{
diff
=
problem_iterate
;
}
...
...
@@ -369,11 +369,11 @@ int main(int argc, char *argv[]) {
VectorType
problem_iterate
(
finestSize
);
auto
setupFunc
=
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"
twoStage
Implicit"
))
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"Implicit
TwoStep
"
))
?
&
implicitEulerSetup
<
VectorType
,
MatrixType
,
decltype
(
dirichletFunction
),
dim
>
:
&
twoStage
ImplicitSetup
<
VectorType
,
MatrixType
,
decltype
(
dirichletFunction
),
dim
>
;
:
&
Implicit
TwoStep
Setup
<
VectorType
,
MatrixType
,
decltype
(
dirichletFunction
),
dim
>
;
VectorType
*
u_old_old_ptr
=
(
run
==
1
)
?
nullptr
:
&
u_previous
;
setupFunc
(
ell
,
stiffnessMatrix
,
u
,
u_old_old_ptr
,
problem_rhs
,
...
...
@@ -400,17 +400,17 @@ int main(int argc, char *argv[]) {
false
);
// absolute error
overallSolver
.
solve
();
auto
extractFunc
=
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"
twoStage
Implicit"
))
auto
extractFunc
=
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"Implicit
TwoStep
"
))
?
implicitEulerExtract
<
VectorType
>
:
twoStage
ImplicitExtract
<
VectorType
>
;
:
Implicit
TwoStep
Extract
<
VectorType
>
;
// Extract solution from solver
extractFunc
(
u
,
u_old_old_ptr
,
problem_iterate
,
solution
);
auto
extractDiffFunc
=
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"
twoStageImplicit
"
))
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"
implicitTwoStep
"
))
?
implicitEulerExtractVelocity
<
VectorType
>
:
twoStage
ImplicitExtractVelocity
<
VectorType
>
;
:
Implicit
TwoStep
ExtractVelocity
<
VectorType
>
;
// Extract difference from solver
extractDiffFunc
(
u
,
u_old_old_ptr
,
problem_iterate
,
u_diff
);
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.parset
+
1
−
1
View file @
6add5746
...
...
@@ -13,7 +13,7 @@ printVelocitySteppingComparison = false
enable_timer
=
false
twoStageImplicit
=
false
implicitTwoStep
=
false
[
grid
]
refinements
=
4
...
...
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