Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
dune-fem
dune-fem-dg
Commits
532aa90b
Commit
532aa90b
authored
9 years ago
by
Stefan Girke
Browse files
Options
Downloads
Patches
Plain Diff
[bugfix] solvermonitor prints now the correct values of newton steps etc.
parent
6de27a1a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/fem-dg/algorithm/caller/solvermonitor.hh
+5
-5
5 additions, 5 deletions
dune/fem-dg/algorithm/caller/solvermonitor.hh
dune/fem-dg/algorithm/caller/sub/solvermonitor.hh
+14
-3
14 additions, 3 deletions
dune/fem-dg/algorithm/caller/sub/solvermonitor.hh
with
19 additions
and
8 deletions
dune/fem-dg/algorithm/caller/solvermonitor.hh
+
5
−
5
View file @
532aa90b
...
@@ -96,13 +96,13 @@ namespace Fem
...
@@ -96,13 +96,13 @@ namespace Fem
switch
(
comb
)
switch
(
comb
)
{
{
case
CombinationType
::
max
:
case
CombinationType
::
max
:
res
=
std
::
max
(
res
,
e
->
getData
(
name
)
);
res
=
std
::
max
(
res
,
e
->
getData
(
name
)
);
break
;
case
CombinationType
::
min
:
case
CombinationType
::
min
:
res
=
std
::
min
(
res
,
e
->
getData
(
name
)
);
res
=
std
::
min
(
res
,
e
->
getData
(
name
)
);
break
;
case
CombinationType
::
sum
:
case
CombinationType
::
sum
:
res
+=
e
->
getData
(
name
);
res
+=
e
->
getData
(
name
);
break
;
case
CombinationType
::
avg
:
case
CombinationType
::
avg
:
res
+=
e
->
getData
(
name
);
res
+=
e
->
getData
(
name
);
break
;
}
}
}
}
};
};
...
@@ -149,7 +149,7 @@ namespace Fem
...
@@ -149,7 +149,7 @@ namespace Fem
const
double
getData
(
const
std
::
string
name
,
CombinationType
comb
=
CombinationType
::
max
)
const
const
double
getData
(
const
std
::
string
name
,
CombinationType
comb
=
CombinationType
::
max
)
const
{
{
double
res
=
(
comb
==
CombinationType
::
m
ax
)
?
std
::
numeric_limits
<
double
>::
max
()
:
0.0
;
double
res
=
(
comb
==
CombinationType
::
m
in
)
?
std
::
numeric_limits
<
double
>::
max
()
:
0.0
;
ForLoopType
<
GetData
>::
apply
(
tuple_
,
res
,
name
,
comb
);
ForLoopType
<
GetData
>::
apply
(
tuple_
,
res
,
name
,
comb
);
return
res
;
return
res
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dune/fem-dg/algorithm/caller/sub/solvermonitor.hh
+
14
−
3
View file @
532aa90b
...
@@ -74,7 +74,8 @@ namespace Fem
...
@@ -74,7 +74,8 @@ namespace Fem
typedef
SolverMonitorImp
SolverMonitorType
;
typedef
SolverMonitorImp
SolverMonitorType
;
typedef
std
::
map
<
std
::
string
,
std
::
tuple
<
double
*
,
double
*
,
bool
>
>
DataDoubleType
;
typedef
std
::
map
<
std
::
string
,
std
::
tuple
<
double
*
,
double
*
,
bool
>
>
DataDoubleType
;
typedef
std
::
map
<
std
::
string
,
std
::
tuple
<
long
unsigned
int
*
,
long
unsigned
int
*
,
bool
>
>
DataIntType
;
typedef
std
::
map
<
std
::
string
,
std
::
tuple
<
int
*
,
int
*
,
bool
>
>
DataIntType
;
typedef
std
::
map
<
std
::
string
,
std
::
tuple
<
long
unsigned
int
*
,
long
unsigned
int
*
,
bool
>
>
DataLongIntType
;
SubSolverMonitor
(
const
std
::
string
keyPrefix
=
""
)
SubSolverMonitor
(
const
std
::
string
keyPrefix
=
""
)
:
solverMonitor_
()
:
solverMonitor_
()
...
@@ -87,13 +88,13 @@ namespace Fem
...
@@ -87,13 +88,13 @@ namespace Fem
{
{
assert
(
monitorData
);
assert
(
monitorData
);
//dangerous cast
//dangerous cast
dataInt_
.
insert
(
std
::
make_pair
(
name
,
std
::
make_tuple
(
reinterpret_cast
<
long
unsigned
int
*>
(
monitorData
)
,
reinterpret_cast
<
long
unsigned
int
*>
(
externalMonitorData
)
,
internal
)
)
);
dataInt_
.
insert
(
std
::
make_pair
(
name
,
std
::
make_tuple
(
monitorData
,
externalMonitorData
,
internal
)
)
);
}
}
void
registerData
(
const
std
::
string
name
,
long
unsigned
int
*
monitorData
,
long
unsigned
int
*
externalMonitorData
=
nullptr
,
bool
internal
=
false
)
void
registerData
(
const
std
::
string
name
,
long
unsigned
int
*
monitorData
,
long
unsigned
int
*
externalMonitorData
=
nullptr
,
bool
internal
=
false
)
{
{
assert
(
monitorData
);
assert
(
monitorData
);
dataInt_
.
insert
(
std
::
make_pair
(
name
,
std
::
make_tuple
(
monitorData
,
externalMonitorData
,
internal
)
)
);
data
Long
Int_
.
insert
(
std
::
make_pair
(
name
,
std
::
make_tuple
(
monitorData
,
externalMonitorData
,
internal
)
)
);
}
}
void
registerData
(
const
std
::
string
name
,
double
*
monitorData
,
double
*
externalMonitorData
=
nullptr
,
bool
internal
=
false
)
void
registerData
(
const
std
::
string
name
,
double
*
monitorData
,
double
*
externalMonitorData
=
nullptr
,
bool
internal
=
false
)
...
@@ -109,6 +110,12 @@ namespace Fem
...
@@ -109,6 +110,12 @@ namespace Fem
assert
(
std
::
get
<
0
>
(
dataInt_
[
name
])
);
assert
(
std
::
get
<
0
>
(
dataInt_
[
name
])
);
return
(
double
)
*
std
::
get
<
0
>
(
dataInt_
[
name
]);
return
(
double
)
*
std
::
get
<
0
>
(
dataInt_
[
name
]);
}
}
if
(
dataLongInt_
.
find
(
name
)
!=
dataLongInt_
.
end
()
)
{
assert
(
std
::
get
<
0
>
(
dataLongInt_
[
name
])
);
return
(
double
)
*
std
::
get
<
0
>
(
dataLongInt_
[
name
]);
}
if
(
dataDouble_
.
find
(
name
)
!=
dataDouble_
.
end
()
)
if
(
dataDouble_
.
find
(
name
)
!=
dataDouble_
.
end
()
)
{
{
assert
(
std
::
get
<
0
>
(
dataDouble_
[
name
])
);
assert
(
std
::
get
<
0
>
(
dataDouble_
[
name
])
);
...
@@ -134,6 +141,9 @@ namespace Fem
...
@@ -134,6 +141,9 @@ namespace Fem
for
(
auto
it
=
std
::
begin
(
dataInt_
);
it
!=
std
::
end
(
dataInt_
);
++
it
)
for
(
auto
it
=
std
::
begin
(
dataInt_
);
it
!=
std
::
end
(
dataInt_
);
++
it
)
if
(
std
::
get
<
1
>
(
it
->
second
)
)
if
(
std
::
get
<
1
>
(
it
->
second
)
)
*
std
::
get
<
0
>
(
it
->
second
)
=
*
std
::
get
<
1
>
(
it
->
second
);
*
std
::
get
<
0
>
(
it
->
second
)
=
*
std
::
get
<
1
>
(
it
->
second
);
for
(
auto
it
=
std
::
begin
(
dataLongInt_
);
it
!=
std
::
end
(
dataLongInt_
);
++
it
)
if
(
std
::
get
<
1
>
(
it
->
second
)
)
*
std
::
get
<
0
>
(
it
->
second
)
=
*
std
::
get
<
1
>
(
it
->
second
);
solverMonitor_
.
setTimeStepInfo
(
tp
);
solverMonitor_
.
setTimeStepInfo
(
tp
);
}
}
...
@@ -151,6 +161,7 @@ namespace Fem
...
@@ -151,6 +161,7 @@ namespace Fem
SolverMonitorType
solverMonitor_
;
SolverMonitorType
solverMonitor_
;
DataDoubleType
dataDouble_
;
DataDoubleType
dataDouble_
;
DataIntType
dataInt_
;
DataIntType
dataInt_
;
DataLongIntType
dataLongInt_
;
};
};
...
...
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