Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Teaching
hdnum
Commits
c1086ebf
Commit
c1086ebf
authored
11 months ago
by
Peter Bastian
Browse files
Options
Download
Patches
Plain Diff
nice formatting for the first example
parent
4279d05f
master
PracticalsSS2024-SolvingLSEforSparseMatrices
chebyshevFilteringAndInverseOrthogonalIterationBA
v0.28
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/num1/iemodelproblem.cc
+5
-5
examples/num1/iemodelproblem.cc
with
5 additions
and
5 deletions
+5
-5
examples/num1/iemodelproblem.cc
+
5
−
5
View file @
c1086ebf
...
...
@@ -15,17 +15,17 @@ int main ()
V
u
(
1
);
u
[
0
]
=
1.0
;
std
::
vector
<
Number
>
times
;
// store time values here
std
::
vector
<
V
>
states
;
// store states here
times
.
push_back
(
time
);
// initial time
states
.
push_back
(
u
);
// initial state
std
::
vector
<
Number
>
times
;
// store time values here
std
::
vector
<
V
>
states
;
// store states here
times
.
push_back
(
time
);
// initial time
states
.
push_back
(
u
);
// initial state
while
(
time
<
5.0
-
1e-6
)
// the time loop
{
u
[
0
]
=
u
[
0
]
/
(
1
-
lambda
*
dt
);
time
+=
dt
;
times
.
push_back
(
time
);
// save time
states
.
push_back
(
u
);
// and state
states
.
push_back
(
u
);
// and state
}
gnuplot
(
"iemp.dat"
,
times
,
states
);
// output model result
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets