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
Backofen, Rainer
amdis
Commits
9cb97640
Commit
9cb97640
authored
Jun 03, 2011
by
Praetorius, Simon
Browse files
Initfile parser - added support for general enums
parent
bd3f3bbe
Changes
26
Show whitespace changes
Inline
Side-by-side
AMDiS/CMakeLists.txt
View file @
9cb97640
...
...
@@ -110,7 +110,6 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/MeshStructure.cc
${
SOURCE_DIR
}
/Operator.cc
${
SOURCE_DIR
}
/OperatorTerm.cc
${
SOURCE_DIR
}
/Parameters.cc
${
SOURCE_DIR
}
/Parametric.cc
${
SOURCE_DIR
}
/PeriodicBC.cc
${
SOURCE_DIR
}
/ProblemImplicit.cc
...
...
AMDiS/src/AMDiS.h
View file @
9cb97640
...
...
@@ -63,6 +63,7 @@
#include
"FixVec.h"
#include
"Flag.h"
#include
"Global.h"
#include
"Initfile.h"
// replacement for Parameters.h
#include
"ITL_Preconditioner.h"
#include
"ITL_Solver.h"
#include
"Lagrange.h"
...
...
@@ -78,7 +79,6 @@
#include
"OEMSolver.h"
#include
"Operator.h"
#include
"OperatorTerm.h"
#include
"Parameters.h"
#include
"Parametric.h"
#include
"PeriodicMap.h"
#include
"PeriodicBC.h"
...
...
AMDiS/src/AdaptInfo.h
View file @
9cb97640
...
...
@@ -24,7 +24,7 @@
#define AMDIS_ADAPTINFO_H
#include
"MatrixVector.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Serializable.h"
namespace
AMDiS
{
...
...
AMDiS/src/AdaptInstationary.cc
View file @
9cb97640
...
...
@@ -11,7 +11,7 @@
#include
"AdaptInstationary.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Estimator.h"
#include
"ProblemIterationInterface.h"
#include
"ProblemTimeInterface.h"
...
...
AMDiS/src/AdaptStationary.cc
View file @
9cb97640
...
...
@@ -11,7 +11,7 @@
#include
"AdaptStationary.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Estimator.h"
#include
"ProblemIterationInterface.h"
#include
<math.h>
...
...
AMDiS/src/Boundary.cc
View file @
9cb97640
...
...
@@ -12,7 +12,7 @@
#include
"Boundary.h"
#include
"FixVec.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
namespace
AMDiS
{
...
...
AMDiS/src/DOFVector.hh
View file @
9cb97640
...
...
@@ -32,7 +32,7 @@
#include
"BoundaryManager.h"
#include
"Assembler.h"
#include
"Operator.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Traverse.h"
// Defining the interface for MTL4
...
...
AMDiS/src/Estimator.cc
View file @
9cb97640
...
...
@@ -12,7 +12,7 @@
#include
"Estimator.h"
#include
"Traverse.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"DualTraverse.h"
namespace
AMDiS
{
...
...
AMDiS/src/Global.cc
View file @
9cb97640
...
...
@@ -15,7 +15,7 @@
#include
<sstream>
#include
"Global.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Element.h"
#include
"Line.h"
#include
"Triangle.h"
...
...
@@ -268,7 +268,7 @@ namespace AMDiS {
// get dimension
TEST_EXIT
(
Parameters
::
initialized
())(
"Parameters not initialized!
\n
"
);
Parameters
::
get
GlobalParameter
(
0
,
"dimension of world"
,
"%d"
,
&
d
);
Parameters
::
get
(
"dimension of world"
,
d
,
0
);
TEST_EXIT
(
d
>
0
)(
"Cannot initialize dimension!
\n
"
);
TEST_EXIT
((
d
==
1
)
||
(
d
==
2
)
||
(
d
==
3
))(
"Invalid world dimension %d!
\n
"
,
d
);
...
...
@@ -304,8 +304,7 @@ namespace AMDiS {
}
// set msgWait
Parameters
::
getGlobalParameter
(
0
,
"WAIT"
,
"%d"
,
&
d
);
Msg
::
setMsgWait
(
!
(
d
==
0
));
Msg
::
setMsgWait
(
!
(
Parameters
::
getMsgWait
()
==
0
));
}
...
...
AMDiS/src/Initfile.h
View file @
9cb97640
...
...
@@ -15,6 +15,7 @@
#include
<boost/algorithm/string/trim.hpp>
#include
<boost/lexical_cast.hpp>
#include
<boost/type_traits.hpp>
namespace
AMDiS
{
...
...
@@ -119,14 +120,31 @@ namespace AMDiS {
/// convert string to intrinsic type
template
<
typename
T
>
inline
void
convert
(
const
std
::
string
valStr
,
T
&
value
)
{
inline
void
convert
(
const
std
::
string
valStr
,
T
&
value
,
typename
boost
::
enable_if
<
boost
::
is_pod
<
T
>
>::
type
*
p
=
NULL
,
typename
boost
::
disable_if
<
boost
::
is_enum
<
T
>
>::
type
*
p2
=
NULL
)
{
using
boost
::
lexical_cast
;
try
{
value
=
lexical_cast
<
T
>
(
trim
(
valStr
));
}
catch
(
boost
::
bad_lexical_cast
e
)
{
throw
WrongValueFormat
<
T
>
(
valStr
);
}
}
template
<
typename
T
>
inline
void
convert
(
const
std
::
string
valStr
,
T
&
value
,
typename
boost
::
enable_if
<
boost
::
is_enum
<
T
>
>::
type
*
p
=
NULL
)
{
unsigned
int
swap
=
0
;
try
{
swap
=
boost
::
lexical_cast
<
unsigned
int
>
(
trim
(
valStr
));
}
catch
(
boost
::
bad_lexical_cast
e
)
{
throw
WrongValueFormat
<
T
>
(
valStr
);
}
value
=
static_cast
<
T
>
(
swap
);
}
/// convert string to WorldVector
template
<
typename
T
>
inline
void
convert
(
const
std
::
string
valStr
,
WorldVector
<
T
>&
c
)
{
...
...
@@ -378,5 +396,7 @@ protected:
};
typedef
Initfile
Parameters
;
}
// end namespace AMDiS
#endif
AMDiS/src/Mesh.cc
View file @
9cb97640
...
...
@@ -28,7 +28,7 @@
#include
"MacroElement.h"
#include
"Mesh.h"
#include
"Traverse.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"FixVec.h"
#include
"DOFVector.h"
#include
"CoarseningManager.h"
...
...
AMDiS/src/OEMSolver.h
View file @
9cb97640
...
...
@@ -34,7 +34,7 @@
#include
"Global.h"
#include
"AMDiS_fwd.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"SolverMatrix.h"
#include
"DOFVector.h"
#include
"SystemVector.h"
...
...
AMDiS/src/ProblemStat.h
View file @
9cb97640
...
...
@@ -27,7 +27,7 @@
#include
<list>
#include
"AMDiS_fwd.h"
#include
"ProblemStatBase.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Boundary.h"
#include
"MatrixVector.h"
#include
"StandardProblemIteration.h"
...
...
AMDiS/src/RecoveryEstimator.cc
View file @
9cb97640
...
...
@@ -11,7 +11,7 @@
#include
"RecoveryEstimator.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
namespace
AMDiS
{
...
...
AMDiS/src/ResidualEstimator.cc
View file @
9cb97640
...
...
@@ -16,7 +16,7 @@
#include
"DOFVector.h"
#include
"Assembler.h"
#include
"Traverse.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include
<mpi.h>
...
...
AMDiS/src/Serializer.h
View file @
9cb97640
...
...
@@ -31,7 +31,7 @@
#include
<boost/lexical_cast.hpp>
#include
"Global.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"AdaptInfo.h"
#include
"io/FileWriter.h"
...
...
AMDiS/src/SolutionDataStorage.h
View file @
9cb97640
...
...
@@ -29,7 +29,7 @@
#include
<map>
#include
"DOFVector.h"
#include
"SystemVector.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
namespace
AMDiS
{
...
...
AMDiS/src/compositeFEM/CompositeFEMMethods.cc
View file @
9cb97640
...
...
@@ -17,7 +17,7 @@
#include
"FiniteElemSpace.h"
#include
"Global.h"
#include
"Mesh.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Traverse.h"
#include
"CompositeFEMMethods.h"
...
...
AMDiS/src/compositeFEM/ElementLevelSet.h
View file @
9cb97640
...
...
@@ -25,7 +25,7 @@
#include
"ElementFunction.h"
#include
"FixVec.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
namespace
AMDiS
{
class
Element
;
...
...
AMDiS/src/io/ElementFileWriter.cc
View file @
9cb97640
...
...
@@ -17,7 +17,7 @@
#include
"ElementFileWriter.h"
#include
"BasisFunction.h"
#include
"
Parameters
.h"
#include
"
Initfile
.h"
#include
"Traverse.h"
#include
"AdaptInfo.h"
...
...
Prev
1
2
Next
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