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
4bece3c2
Commit
4bece3c2
authored
11 years ago
by
Elias Pipping
Committed by
Elias Pipping
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Rename: problem_*-> *
parent
ac36e7c8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/timestepping.hh
+2
-3
2 additions, 3 deletions
src/timestepping.hh
src/timestepping/backward_euler.cc
+17
-17
17 additions, 17 deletions
src/timestepping/backward_euler.cc
src/timestepping/newmark.cc
+19
-19
19 additions, 19 deletions
src/timestepping/newmark.cc
with
38 additions
and
39 deletions
src/timestepping.hh
+
2
−
3
View file @
4bece3c2
...
@@ -8,10 +8,9 @@ class TimeSteppingScheme {
...
@@ -8,10 +8,9 @@ class TimeSteppingScheme {
public:
public:
void
virtual
nextTimeStep
()
=
0
;
void
virtual
nextTimeStep
()
=
0
;
void
virtual
setup
(
VectorType
const
&
ell
,
double
_tau
,
double
time
,
void
virtual
setup
(
VectorType
const
&
ell
,
double
_tau
,
double
time
,
VectorType
&
problem_rhs
,
VectorType
&
problem_iterate
,
VectorType
&
rhs
,
VectorType
&
iterate
,
MatrixType
&
AB
)
=
0
;
MatrixType
&
problem_AB
)
=
0
;
void
virtual
postProcess
(
VectorType
const
&
problem_
iterate
)
=
0
;
void
virtual
postProcess
(
VectorType
const
&
iterate
)
=
0
;
void
virtual
extractDisplacement
(
VectorType
&
displacement
)
const
=
0
;
void
virtual
extractDisplacement
(
VectorType
&
displacement
)
const
=
0
;
void
virtual
extractVelocity
(
VectorType
&
velocity
)
const
=
0
;
void
virtual
extractVelocity
(
VectorType
&
velocity
)
const
=
0
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/timestepping/backward_euler.cc
+
17
−
17
View file @
4bece3c2
...
@@ -19,8 +19,8 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
...
@@ -19,8 +19,8 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
void
BackwardEuler
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
setup
(
void
BackwardEuler
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
setup
(
VectorType
const
&
ell
,
double
_tau
,
double
time
,
VectorType
&
problem_
rhs
,
VectorType
const
&
ell
,
double
_tau
,
double
time
,
VectorType
&
rhs
,
VectorType
&
problem_
iterate
,
MatrixType
&
problem_
AM
)
{
VectorType
&
iterate
,
MatrixType
&
AM
)
{
postProcessCalled
=
false
;
postProcessCalled
=
false
;
tau
=
_tau
;
tau
=
_tau
;
...
@@ -54,38 +54,38 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
...
@@ -54,38 +54,38 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
indices
.
import
(
A
);
indices
.
import
(
A
);
indices
.
import
(
M
);
indices
.
import
(
M
);
indices
.
import
(
C
);
indices
.
import
(
C
);
indices
.
exportIdx
(
problem_
AM
);
indices
.
exportIdx
(
AM
);
}
}
problem_
AM
=
0.0
;
AM
=
0.0
;
Arithmetic
::
addProduct
(
problem_
AM
,
(
1.0
-
wc
)
/
tau
,
M
);
Arithmetic
::
addProduct
(
AM
,
(
1.0
-
wc
)
/
tau
,
M
);
Arithmetic
::
addProduct
(
problem_
AM
,
wc
,
C
);
Arithmetic
::
addProduct
(
AM
,
wc
,
C
);
Arithmetic
::
addProduct
(
problem_
AM
,
tau
,
A
);
Arithmetic
::
addProduct
(
AM
,
tau
,
A
);
// set up RHS
// set up RHS
{
{
problem_
rhs
=
ell
;
rhs
=
ell
;
Arithmetic
::
addProduct
(
problem_
rhs
,
(
1.0
-
wc
)
/
tau
,
M
,
v_o
);
Arithmetic
::
addProduct
(
rhs
,
(
1.0
-
wc
)
/
tau
,
M
,
v_o
);
Arithmetic
::
subtractProduct
(
problem_
rhs
,
A
,
u_o
);
Arithmetic
::
subtractProduct
(
rhs
,
A
,
u_o
);
}
}
// v_o makes a good initial iterate; we could use anything, though
// v_o makes a good initial iterate; we could use anything, though
problem_
iterate
=
0.0
;
iterate
=
0.0
;
for
(
size_t
i
=
0
;
i
<
dirichletNodes
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
dirichletNodes
.
size
();
++
i
)
switch
(
dirichletNodes
[
i
].
count
())
{
switch
(
dirichletNodes
[
i
].
count
())
{
case
0
:
case
0
:
continue
;
continue
;
case
dim
:
case
dim
:
problem_
iterate
[
i
]
=
0
;
iterate
[
i
]
=
0
;
dirichletFunction
.
evaluate
(
time
,
problem_
iterate
[
i
][
0
]);
dirichletFunction
.
evaluate
(
time
,
iterate
[
i
][
0
]);
break
;
break
;
case
1
:
case
1
:
if
(
dirichletNodes
[
i
][
0
])
{
if
(
dirichletNodes
[
i
][
0
])
{
dirichletFunction
.
evaluate
(
time
,
problem_
iterate
[
i
][
0
]);
dirichletFunction
.
evaluate
(
time
,
iterate
[
i
][
0
]);
break
;
break
;
}
}
if
(
dirichletNodes
[
i
][
1
])
{
if
(
dirichletNodes
[
i
][
1
])
{
problem_
iterate
[
i
][
1
]
=
0
;
iterate
[
i
][
1
]
=
0
;
break
;
break
;
}
}
assert
(
false
);
assert
(
false
);
...
@@ -96,10 +96,10 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
...
@@ -96,10 +96,10 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
void
BackwardEuler
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
postProcess
(
void
BackwardEuler
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
postProcess
(
VectorType
const
&
problem_
iterate
)
{
VectorType
const
&
iterate
)
{
postProcessCalled
=
true
;
postProcessCalled
=
true
;
v
=
problem_
iterate
;
v
=
iterate
;
u
=
u_o
;
u
=
u_o
;
Arithmetic
::
addProduct
(
u
,
tau
,
v
);
Arithmetic
::
addProduct
(
u
,
tau
,
v
);
...
...
This diff is collapsed.
Click to expand it.
src/timestepping/newmark.cc
+
19
−
19
View file @
4bece3c2
...
@@ -21,8 +21,8 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
...
@@ -21,8 +21,8 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
void
Newmark
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
setup
(
void
Newmark
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
setup
(
VectorType
const
&
ell
,
double
_tau
,
double
time
,
VectorType
&
problem_
rhs
,
VectorType
const
&
ell
,
double
_tau
,
double
time
,
VectorType
&
rhs
,
VectorType
&
problem_
iterate
,
MatrixType
&
problem_
AM
)
{
VectorType
&
iterate
,
MatrixType
&
AM
)
{
postProcessCalled
=
false
;
postProcessCalled
=
false
;
tau
=
_tau
;
tau
=
_tau
;
...
@@ -57,40 +57,40 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
...
@@ -57,40 +57,40 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
indices
.
import
(
A
);
indices
.
import
(
A
);
indices
.
import
(
M
);
indices
.
import
(
M
);
indices
.
import
(
C
);
indices
.
import
(
C
);
indices
.
exportIdx
(
problem_
AM
);
indices
.
exportIdx
(
AM
);
}
}
problem_
AM
=
0.0
;
AM
=
0.0
;
Arithmetic
::
addProduct
(
problem_
AM
,
(
1.0
-
wc
)
*
2.0
/
tau
,
M
);
Arithmetic
::
addProduct
(
AM
,
(
1.0
-
wc
)
*
2.0
/
tau
,
M
);
Arithmetic
::
addProduct
(
problem_
AM
,
wc
,
C
);
Arithmetic
::
addProduct
(
AM
,
wc
,
C
);
Arithmetic
::
addProduct
(
problem_
AM
,
tau
/
2.0
,
A
);
Arithmetic
::
addProduct
(
AM
,
tau
/
2.0
,
A
);
// set up RHS
// set up RHS
{
{
problem_
rhs
=
ell
;
rhs
=
ell
;
Arithmetic
::
addProduct
(
problem_
rhs
,
(
1.0
-
wc
)
*
2.0
/
tau
,
M
,
v_o
);
Arithmetic
::
addProduct
(
rhs
,
(
1.0
-
wc
)
*
2.0
/
tau
,
M
,
v_o
);
Arithmetic
::
addProduct
(
problem_
rhs
,
1.0
-
wc
,
M
,
a_o
);
Arithmetic
::
addProduct
(
rhs
,
1.0
-
wc
,
M
,
a_o
);
Arithmetic
::
subtractProduct
(
problem_
rhs
,
tau
/
2.0
,
A
,
v_o
);
Arithmetic
::
subtractProduct
(
rhs
,
tau
/
2.0
,
A
,
v_o
);
Arithmetic
::
subtractProduct
(
problem_
rhs
,
A
,
u_o
);
Arithmetic
::
subtractProduct
(
rhs
,
A
,
u_o
);
}
}
// v_o makes a good initial iterate; we could use anything, though
// v_o makes a good initial iterate; we could use anything, though
problem_
iterate
=
0.0
;
iterate
=
0.0
;
for
(
size_t
i
=
0
;
i
<
dirichletNodes
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
dirichletNodes
.
size
();
++
i
)
switch
(
dirichletNodes
[
i
].
count
())
{
switch
(
dirichletNodes
[
i
].
count
())
{
case
0
:
case
0
:
continue
;
continue
;
case
dim
:
case
dim
:
problem_
iterate
[
i
]
=
0
;
iterate
[
i
]
=
0
;
dirichletFunction
.
evaluate
(
time
,
problem_
iterate
[
i
][
0
]);
dirichletFunction
.
evaluate
(
time
,
iterate
[
i
][
0
]);
break
;
break
;
case
1
:
case
1
:
if
(
dirichletNodes
[
i
][
0
])
{
if
(
dirichletNodes
[
i
][
0
])
{
dirichletFunction
.
evaluate
(
time
,
problem_
iterate
[
i
][
0
]);
dirichletFunction
.
evaluate
(
time
,
iterate
[
i
][
0
]);
break
;
break
;
}
}
if
(
dirichletNodes
[
i
][
1
])
{
if
(
dirichletNodes
[
i
][
1
])
{
problem_
iterate
[
i
][
1
]
=
0
;
iterate
[
i
][
1
]
=
0
;
break
;
break
;
}
}
assert
(
false
);
assert
(
false
);
...
@@ -101,10 +101,10 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
...
@@ -101,10 +101,10 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
template
<
class
VectorType
,
class
MatrixType
,
class
FunctionType
,
int
dim
>
void
Newmark
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
postProcess
(
void
Newmark
<
VectorType
,
MatrixType
,
FunctionType
,
dim
>::
postProcess
(
VectorType
const
&
problem_
iterate
)
{
VectorType
const
&
iterate
)
{
postProcessCalled
=
true
;
postProcessCalled
=
true
;
v
=
problem_
iterate
;
v
=
iterate
;
// u1 = tau/2 ( v1 + v0 ) + u0
// u1 = tau/2 ( v1 + v0 ) + u0
u
=
u_o
;
u
=
u_o
;
...
...
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