Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
a3998fde
Commit
a3998fde
authored
Nov 11, 2009
by
Thomas Witkowski
Browse files
Start to change pointer usage to reference usage in AMDiS interface.
parent
709a214e
Changes
10
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/AdaptInstationary.cc
View file @
a3998fde
...
...
@@ -20,16 +20,41 @@ namespace AMDiS {
{
FUNCNAME
(
"AdaptInstationary::AdaptInstationary()"
);
// MSG("You make use of the obsolete constructor AdaptInstationary::AdaptInstationary(...)!\n");
// MSG("Please use the constructor that uses references instead of pointers!\n");
initConstructor
(
problemStat
,
info
,
initialInfo
,
initialTimestamp
);
}
AdaptInstationary
::
AdaptInstationary
(
std
::
string
name
,
ProblemIterationInterface
&
problemStat
,
AdaptInfo
&
info
,
ProblemTimeInterface
&
problemInstat
,
AdaptInfo
&
initialInfo
,
time_t
initialTimestamp
)
:
AdaptBase
(
name
,
&
problemStat
,
&
info
,
&
problemInstat
,
&
initialInfo
),
breakWhenStable
(
0
),
dbgMode
(
false
)
{
FUNCNAME
(
"AdaptInstationary::AdaptInstationary()"
);
initConstructor
(
&
problemStat
,
&
info
,
&
initialInfo
,
initialTimestamp
);
}
void
AdaptInstationary
::
initConstructor
(
ProblemIterationInterface
*
problemStat
,
AdaptInfo
*
info
,
AdaptInfo
*
initialInfo
,
time_t
initialTimestamp
)
{
initialize
(
name
);
fixedTimestep_
=
(
info
->
getMinTimestep
()
==
info
->
getMaxTimestep
());
if
(
initialTimestamp
==
0
)
{
if
(
initialTimestamp
==
0
)
initialTimestamp_
=
time
(
NULL
);
}
else
{
else
initialTimestamp_
=
initialTimestamp
;
}
// Check if the problem should be deserialized because of the -rs parameter.
std
::
string
serializationFilename
=
""
;
GET_PARAMETER
(
0
,
"argv->rs"
,
&
serializationFilename
);
...
...
AMDiS/src/AdaptInstationary.h
View file @
a3998fde
...
...
@@ -43,7 +43,7 @@ namespace AMDiS {
public:
/** \brief
* Creates a AdaptInstationary object with the given name for the time
* dependent problem problemInstat.
* dependent problem problemInstat.
TODO: Make obsolete!
*/
AdaptInstationary
(
std
::
string
name
,
ProblemIterationInterface
*
problemStat
,
...
...
@@ -52,6 +52,28 @@ namespace AMDiS {
AdaptInfo
*
initialInfo
,
time_t
initialTimestamp
=
0
);
/** \brief
* Creates a AdaptInstationary object with the given name for the time
* dependent problem problemInstat.
*/
AdaptInstationary
(
std
::
string
name
,
ProblemIterationInterface
&
problemStat
,
AdaptInfo
&
info
,
ProblemTimeInterface
&
problemInstat
,
AdaptInfo
&
initialInfo
,
time_t
initialTimestamp
=
0
);
/** \brief
* This funciton is used only to avoid double code in both constructors. If the
* obsolte constructure, which uses pointers instead of references, will be
* removed, remove also this function.
* TODO: Remove if obsolete constructor will be removed.
*/
void
initConstructor
(
ProblemIterationInterface
*
problemStat
,
AdaptInfo
*
info
,
AdaptInfo
*
initialInfo
,
time_t
initialTimestamp
);
/// Destructor
virtual
~
AdaptInstationary
();
...
...
AMDiS/src/AdaptStationary.cc
View file @
a3998fde
...
...
@@ -11,6 +11,19 @@ namespace AMDiS {
ProblemIterationInterface
*
prob
,
AdaptInfo
*
info
)
:
AdaptBase
(
name
,
prob
,
info
)
{
FUNCNAME
(
"AdaptStationary::AdaptStationary()"
);
// MSG("You make use of the obsolete constructor AdaptStationary::AdaptStationary(...)!\n");
// MSG("Please use the constructor that uses references instead of pointers!\n");
initialize
();
}
AdaptStationary
::
AdaptStationary
(
std
::
string
name
,
ProblemIterationInterface
&
prob
,
AdaptInfo
&
info
)
:
AdaptBase
(
name
,
&
prob
,
&
info
)
{
initialize
();
}
...
...
AMDiS/src/AdaptStationary.h
View file @
a3998fde
...
...
@@ -45,11 +45,16 @@ namespace AMDiS {
class
AdaptStationary
:
public
AdaptBase
{
public:
/// Creates a AdaptStationary object with given name.
/// Creates a AdaptStationary object with given name.
TODO: Make obsolete!
AdaptStationary
(
std
::
string
name
,
ProblemIterationInterface
*
prob
,
AdaptInfo
*
info
);
/// Creates a AdaptStationary object with given name.
AdaptStationary
(
std
::
string
name
,
ProblemIterationInterface
&
prob
,
AdaptInfo
&
info
);
/// Destructor
virtual
~
AdaptStationary
()
{}
...
...
AMDiS/src/ProblemInstat.cc
View file @
a3998fde
...
...
@@ -50,6 +50,20 @@ namespace AMDiS {
oldSolution
(
NULL
)
{}
ProblemInstatScal
::
ProblemInstatScal
(
std
::
string
name_
,
ProblemScal
&
prob
)
:
ProblemInstat
(
name_
,
NULL
),
problemStat
(
&
prob
),
oldSolution
(
NULL
)
{}
ProblemInstatScal
::
ProblemInstatScal
(
std
::
string
name_
,
ProblemScal
&
prob
,
ProblemStatBase
&
initialProb
)
:
ProblemInstat
(
name_
,
&
initialProb
),
problemStat
(
&
prob
),
oldSolution
(
NULL
)
{}
ProblemInstatScal
::~
ProblemInstatScal
()
{
...
...
AMDiS/src/ProblemInstat.h
View file @
a3998fde
...
...
@@ -119,6 +119,10 @@ namespace AMDiS {
ProblemScal
*
prob
,
ProblemStatBase
*
initialProb
=
NULL
);
ProblemInstatScal
(
std
::
string
name
,
ProblemScal
&
prob
);
ProblemInstatScal
(
std
::
string
name
,
ProblemScal
&
prob
,
ProblemStatBase
&
initialProb
);
/// Destructor.
virtual
~
ProblemInstatScal
();
...
...
AMDiS/src/ProblemScal.cc
View file @
a3998fde
...
...
@@ -58,6 +58,11 @@ namespace AMDiS {
fileWriters
[
i
]
->
writeFiles
(
adaptInfo
,
force
);
}
void
ProblemScal
::
writeFiles
(
AdaptInfo
&
adaptInfo
,
bool
force
)
{
writeFiles
(
&
adaptInfo
,
force
);
}
void
ProblemScal
::
interpolInitialSolution
(
AbstractFunction
<
double
,
WorldVector
<
double
>
>
*
fct
)
{
solution
->
interpol
(
fct
);
...
...
AMDiS/src/ProblemScal.h
View file @
a3998fde
...
...
@@ -157,9 +157,12 @@ namespace AMDiS {
return
this
;
}
/// Writes output files.
/// Writes output files.
TODO: Make obsolete.
void
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
);
/// Writes output files.
void
writeFiles
(
AdaptInfo
&
adaptInfo
,
bool
force
);
/// Interpolates fct to \ref solution.
void
interpolInitialSolution
(
AbstractFunction
<
double
,
WorldVector
<
double
>
>
*
fct
);
...
...
AMDiS/src/ProblemVec.cc
View file @
a3998fde
...
...
@@ -842,6 +842,11 @@ namespace AMDiS {
#endif
}
void
ProblemVec
::
writeFiles
(
AdaptInfo
&
adaptInfo
,
bool
force
)
{
writeFiles
(
&
adaptInfo
,
force
);
}
void
ProblemVec
::
interpolInitialSolution
(
std
::
vector
<
AbstractFunction
<
double
,
WorldVector
<
double
>
>*>
*
fct
)
{
FUNCNAME
(
"ProblemVec::interpolInitialSolution()"
);
...
...
AMDiS/src/ProblemVec.h
View file @
a3998fde
...
...
@@ -202,9 +202,12 @@ namespace AMDiS {
return
this
;
}
/// Writes output files.
/// Writes output files.
TODO: Make obsolete.
void
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
);
/// Writes output files.
void
writeFiles
(
AdaptInfo
&
adaptInfo
,
bool
force
);
/// Interpolates fct to \ref solution.
void
interpolInitialSolution
(
std
::
vector
<
AbstractFunction
<
double
,
WorldVector
<
double
>
>*>
*
fct
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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