Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
553860d9
Commit
553860d9
authored
May 07, 2009
by
Thomas Witkowski
Browse files
Serializer reports error message if the file does not exists; Bugfix for bug #10.
parent
64fe2d8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/ResidualEstimator.cc
View file @
553860d9
...
...
@@ -218,7 +218,7 @@ namespace AMDiS {
}
}
if
(
timestep
)
{
if
(
timestep
&&
uhOld
[
system
]
)
{
TEST_EXIT_DBG
(
uhOld
[
system
])(
"no uhOld
\n
"
);
uhOld
[
system
]
->
getLocalVector
(
el
,
uhOldEl
[
system
]);
...
...
@@ -278,16 +278,14 @@ namespace AMDiS {
// add integral over r square
val
=
0.0
;
for
(
int
iq
=
0
;
iq
<
nPoints
;
iq
++
)
{
for
(
int
iq
=
0
;
iq
<
nPoints
;
iq
++
)
val
+=
quad
->
getWeight
(
iq
)
*
riq
[
iq
]
*
riq
[
iq
];
}
if
(
timestep
!=
0.0
||
norm
==
NO_NORM
||
norm
==
L2_NORM
)
{
if
(
timestep
!=
0.0
||
norm
==
NO_NORM
||
norm
==
L2_NORM
)
val
=
C0
*
h2
*
h2
*
det
*
val
;
}
else
{
else
val
=
C0
*
h2
*
det
*
val
;
}
est_el
+=
val
;
// ===== jump residuals
...
...
AMDiS/src/Serializer.h
View file @
553860d9
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
...
...
@@ -34,8 +34,6 @@ namespace AMDiS {
class
Serializer
:
public
FileWriterInterface
{
public:
MEMORY_MANAGED
(
Serializer
);
Serializer
(
ProblemType
*
problem
)
:
name_
(
""
),
problem_
(
problem
),
...
...
@@ -61,13 +59,13 @@ namespace AMDiS {
timestepNumber_
++
;
timestepNumber_
%=
tsModulo_
;
if
((
timestepNumber_
!=
0
)
&&
!
force
)
{
if
((
timestepNumber_
!=
0
)
&&
!
force
)
return
;
}
TEST_EXIT
(
adaptInfo
)(
"No AdaptInfo
\n
"
);
std
::
ofstream
out
(
name_
.
c_str
());
TEST_EXIT
(
out
.
is_open
())(
"Cannot open serialization file!
\n
"
);
problem_
->
serialize
(
out
);
adaptInfo
->
serialize
(
out
);
out
.
close
();
...
...
@@ -82,24 +80,16 @@ namespace AMDiS {
}
protected:
/** \brief
* Name of file to which the problem is serialized.
*/
/// Name of file to which the problem is serialized.
std
::
string
name_
;
/** \brief
* Pointer to the problem.
*/
/// Pointer to the problem.
ProblemType
*
problem_
;
/** \brief
* The problem is serialized every tsModulo-th timestep.
*/
/// The problem is serialized every tsModulo-th timestep.
int
tsModulo_
;
/** \brief
* Current timestep number.
*/
/// Current timestep number.
int
timestepNumber_
;
};
...
...
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!
Cancel
Please
register
or
sign in
to comment