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
iwr
amdis
Commits
832f770b
Commit
832f770b
authored
Aug 15, 2012
by
Thomas Witkowski
Browse files
Fixed at least some compiler warnings.
parent
469bc1cf
Changes
2
Show whitespace changes
Inline
Side-by-side
extensions/base_problems/BaseProblem.h
View file @
832f770b
...
...
@@ -26,7 +26,7 @@ public:
}
/// Initialisation of the problem.
virtual
void
initialize
(
Flag
initFlag
,
void
initialize
(
Flag
initFlag
,
ProblemStat
*
adoptProblem
=
NULL
,
Flag
adoptFlag
=
INIT_NOTHING
);
...
...
@@ -36,30 +36,34 @@ public:
/// calls \ref initData, \ref fillOperators and \ref fillBoundaryConditions in this ordering
virtual
void
initTimeInterface
()
{
FUNCNAME
(
"BaseProblem::initTimeInterface()"
);
{
FUNCNAME
(
"BaseProblem::initTimeInterface()"
);
initData
();
fillOperators
();
fillBoundaryConditions
();
}
;
}
/// read solution DOFVectors from .arh, .dat or .vtu files
virtual
Flag
initDataFromFile
(
AdaptInfo
*
adaptInfo
);
/// calls \ref initDataFromFile
virtual
void
solveInitialProblem
(
AdaptInfo
*
adaptInfo
)
{
FUNCNAME
(
"BaseProblem::solveInitialProblem()"
);
{
FUNCNAME
(
"BaseProblem::solveInitialProblem()"
);
Flag
initFlag
=
initDataFromFile
(
adaptInfo
);
}
;
}
/// calls \ref writeFiles
virtual
void
transferInitialSolution
(
AdaptInfo
*
adaptInfo
)
{
FUNCNAME
(
"BaseProblem::transferInitialSolution()"
);
{
FUNCNAME
(
"BaseProblem::transferInitialSolution()"
);
oldMeshChangeIdx
=
getMesh
()
->
getChangeIndex
();
writeFiles
(
adaptInfo
,
false
);
}
;
}
/// This method is called before \ref beginIteration, \ref oneIteration and \ref endIteration.
virtual
void
initTimestep
(
AdaptInfo
*
adaptInfo
)
{};
virtual
void
initTimestep
(
AdaptInfo
*
adaptInfo
)
{}
/// calls \ref writeFiles
virtual
void
closeTimestep
(
AdaptInfo
*
adaptInfo
);
...
...
@@ -70,9 +74,10 @@ public:
/// Calls writeFiles of the problem
virtual
void
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
)
{
FUNCNAME
(
"BaseProblem::writeFiles()"
);
{
FUNCNAME
(
"BaseProblem::writeFiles()"
);
prob
->
writeFiles
(
adaptInfo
,
force
);
}
;
}
// getting methods
...
...
@@ -98,25 +103,28 @@ public:
std
::
string
getName
()
{
return
name
;
}
;
}
int
getNumProblems
()
{
return
1
;
}
;
}
int
getNumComponents
()
{
return
prob
->
getNumComponents
();
}
;
}
ProblemType
*
getProblem
(
int
number
=
0
)
ProblemType
*
getProblem
(
int
number
=
0
)
{
if
(
number
<
0
||
number
>=
getNumProblems
())
if
(
number
<
0
||
number
>=
getNumProblems
())
throw
(
std
::
runtime_error
(
"problem with given number does not exist"
));
if
(
number
==
0
)
return
prob
;
};
return
NULL
;
}
ProblemType
*
getProblem
(
std
::
string
name
)
{
...
...
@@ -124,7 +132,7 @@ public:
return
prob
;
else
throw
(
std
::
runtime_error
(
"problem with given name '"
+
name
+
"' does not exist"
));
}
;
}
// setting methods
...
...
@@ -138,14 +146,19 @@ public:
nTimesteps
=
nTimesteps_
;
}
void
serialize
(
std
::
ostream
&
)
{};
void
deserialize
(
std
::
istream
&
)
{};
void
serialize
(
std
::
ostream
&
)
{}
void
deserialize
(
std
::
istream
&
)
{}
/// method where operators are added to the problem
virtual
void
fillOperators
()
{};
virtual
void
fillOperators
()
{}
/// method where boundary conditions are added to the problem
virtual
void
fillBoundaryConditions
()
{};
virtual
void
fillBoundaryConditions
()
{}
/// classical backward-euler time-discretization
void
addTimeOperator
(
ProblemStat
*
prob
,
int
i
,
int
j
);
...
...
extensions/base_problems/BaseProblem.hh
View file @
832f770b
using
namespace
AMDiS
;
template
<
typename
ProblemType
>
BaseProblem
<
ProblemType
>::
BaseProblem
(
const
std
::
string
&
name_
)
:
ProblemInstatBase
(
name_
,
NULL
),
BaseProblem
<
ProblemType
>::
BaseProblem
(
const
std
::
string
&
name_
)
:
ProblemInstatBase
(
name_
,
NULL
),
prob
(
NULL
),
secureIteration
(
false
),
oldMeshChangeIdx
(
0
),
...
...
@@ -27,12 +27,13 @@ void BaseProblem<ProblemType>::initialize(Flag initFlag,
prob
->
initialize
(
initFlag
,
adoptProblem
,
adoptFlag
);
dim
=
getMesh
()
->
getDim
();
}
;
}
template
<
typename
ProblemType
>
Flag
BaseProblem
<
ProblemType
>::
initDataFromFile
(
AdaptInfo
*
adaptInfo
)
{
FUNCNAME
(
"BaseProblem::initDataFromFile()"
);
{
FUNCNAME
(
"BaseProblem::initDataFromFile()"
);
Flag
initFlag
;
bool
readDataFromFile
=
false
,
readArhFiles
=
false
,
readDatFiles
=
false
;
...
...
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