Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
6d4dc8c7
There was an error fetching the commit references. Please try again later.
Commit
6d4dc8c7
authored
7 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
LBM: added MLUPS to the solver monitor
parent
e638c8f8
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/TNL/Solvers/IterativeSolverMonitor.h
+6
-2
6 additions, 2 deletions
src/TNL/Solvers/IterativeSolverMonitor.h
src/TNL/Solvers/IterativeSolverMonitor_impl.h
+19
-2
19 additions, 2 deletions
src/TNL/Solvers/IterativeSolverMonitor_impl.h
with
25 additions
and
4 deletions
src/TNL/Solvers/IterativeSolverMonitor.h
+
6
−
2
View file @
6d4dc8c7
...
@@ -35,6 +35,8 @@ public:
...
@@ -35,6 +35,8 @@ public:
void
setResidue
(
const
RealType
&
residue
);
void
setResidue
(
const
RealType
&
residue
);
void
setVerbose
(
const
Index
&
verbose
);
void
setVerbose
(
const
Index
&
verbose
);
void
setNodesPerIteration
(
const
IndexType
&
nodes
);
virtual
void
refresh
();
virtual
void
refresh
();
...
@@ -45,11 +47,13 @@ protected:
...
@@ -45,11 +47,13 @@ protected:
std
::
atomic_bool
saved
;
std
::
atomic_bool
saved
;
RealType
time
,
saved_time
,
timeStep
,
saved_timeStep
,
residue
,
saved_residue
;
RealType
time
,
saved_time
,
timeStep
,
saved_timeStep
,
residue
,
saved_residue
,
elapsed_time_before_refresh
;
IndexType
iterations
,
saved_iterations
;
IndexType
iterations
,
saved_iterations
,
iterations_before_refresh
;
IndexType
verbose
;
IndexType
verbose
;
IndexType
nodesPerIteration
;
};
};
}
// namespace Solvers
}
// namespace Solvers
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Solvers/IterativeSolverMonitor_impl.h
+
19
−
2
View file @
6d4dc8c7
...
@@ -37,9 +37,12 @@ IterativeSolverMonitor< Real, Index > :: IterativeSolverMonitor()
...
@@ -37,9 +37,12 @@ IterativeSolverMonitor< Real, Index > :: IterativeSolverMonitor()
saved_timeStep
(
0.0
),
saved_timeStep
(
0.0
),
residue
(
0.0
),
residue
(
0.0
),
saved_residue
(
0.0
),
saved_residue
(
0.0
),
elapsed_time_before_refresh
(
0.0
),
iterations
(
0
),
iterations
(
0
),
saved_iterations
(
0
),
saved_iterations
(
0
),
verbose
(
1
)
iterations_before_refresh
(
0
),
verbose
(
1
),
nodesPerIteration
(
0
)
{
{
}
}
...
@@ -93,6 +96,12 @@ void IterativeSolverMonitor< Real, Index > :: setVerbose( const Index& verbose )
...
@@ -93,6 +96,12 @@ void IterativeSolverMonitor< Real, Index > :: setVerbose( const Index& verbose )
this
->
verbose
=
verbose
;
this
->
verbose
=
verbose
;
}
}
template
<
typename
Real
,
typename
Index
>
void
IterativeSolverMonitor
<
Real
,
Index
>
::
setNodesPerIteration
(
const
IndexType
&
nodes
)
{
this
->
nodesPerIteration
=
nodes
;
}
template
<
typename
Real
,
typename
Index
>
template
<
typename
Real
,
typename
Index
>
void
IterativeSolverMonitor
<
Real
,
Index
>
::
refresh
()
void
IterativeSolverMonitor
<
Real
,
Index
>
::
refresh
()
{
{
...
@@ -133,7 +142,7 @@ void IterativeSolverMonitor< Real, Index > :: refresh()
...
@@ -133,7 +142,7 @@ void IterativeSolverMonitor< Real, Index > :: refresh()
if
(
(
saved
)
?
saved_timeStep
:
timeStep
>
0
)
{
if
(
(
saved
)
?
saved_timeStep
:
timeStep
>
0
)
{
// print_item( " TAU:" );
// print_item( " TAU:" );
print_item
(
" TAU:"
,
0
);
print_item
(
" TAU:"
,
0
);
print_item
(
real_to_string
(
(
saved
)
?
saved_timeStep
:
timeStep
,
5
),
8
);
print_item
(
real_to_string
(
(
saved
)
?
saved_timeStep
:
timeStep
,
5
),
10
);
}
}
const
std
::
string
displayed_stage
=
(
saved
)
?
saved_stage
:
stage
;
const
std
::
string
displayed_stage
=
(
saved
)
?
saved_stage
:
stage
;
...
@@ -159,6 +168,14 @@ void IterativeSolverMonitor< Real, Index > :: refresh()
...
@@ -159,6 +168,14 @@ void IterativeSolverMonitor< Real, Index > :: refresh()
print_item
(
real_to_string
(
(
saved
)
?
saved_residue
:
residue
,
5
),
12
);
print_item
(
real_to_string
(
(
saved
)
?
saved_residue
:
residue
,
5
),
12
);
}
}
if
(
nodesPerIteration
)
{
const
RealType
mlups
=
nodesPerIteration
*
(
iterations
-
iterations_before_refresh
)
/
(
getElapsedTime
()
-
elapsed_time_before_refresh
)
*
1e-6
;
print_item
(
" MLUPS:"
,
0
);
print_item
(
real_to_string
(
mlups
,
5
),
7
);
}
iterations_before_refresh
=
iterations
;
elapsed_time_before_refresh
=
getElapsedTime
();
// return to the beginning of the line
// return to the beginning of the line
std
::
cout
<<
"
\r
"
<<
std
::
flush
;
std
::
cout
<<
"
\r
"
<<
std
::
flush
;
}
}
...
...
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