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
a4e461ee
Commit
a4e461ee
authored
Aug 23, 2013
by
Praetorius, Simon
Browse files
clean up of some files
parent
d079f7e6
Changes
7
Show whitespace changes
Inline
Side-by-side
AMDiS/CMakeLists.txt
View file @
a4e461ee
...
...
@@ -492,8 +492,7 @@ if(ENABLE_EXTENSIONS)
${
EXTENSIONS_DIR
}
/base_problems/NavierStokes_TaylorHood_RB.cc
${
EXTENSIONS_DIR
}
/base_problems/NavierStokes_TH_MultiPhase.cc
${
EXTENSIONS_DIR
}
/base_problems/NavierStokes_TH_MultiPhase_RB.cc
${
EXTENSIONS_DIR
}
/base_problems/PhaseFieldCrystal_Base.cc
# ${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal.cc
${
EXTENSIONS_DIR
}
/base_problems/PhaseFieldCrystal.cc
${
EXTENSIONS_DIR
}
/base_problems/PhaseFieldCrystal_Phase.cc
${
EXTENSIONS_DIR
}
/base_problems/PhaseFieldCrystal_RB.cc
)
list
(
APPEND COMPILEFLAGS
"-DHAVE_BASE_PROBLEMS=1"
)
...
...
AMDiS/src/AbstractFunction.h
View file @
a4e461ee
...
...
@@ -27,6 +27,10 @@
#include
"Global.h"
#include
<boost/preprocessor/arithmetic/inc.hpp>
#include
<boost/preprocessor/repetition/enum_params.hpp>
#include
<boost/preprocessor/repetition/repeat.hpp>
namespace
AMDiS
{
/**
...
...
@@ -170,6 +174,53 @@ namespace AMDiS {
};
///////////////////////////////////////////////////////////////
// test of AbstractFunction with arbitrary number of arguments
#define ABSTRACT_FUNCTION_MACRO(z, n, _) \
template< typename ReturnType, \
BOOST_PP_ENUM_PARAMS_Z(z, n, typename T) \
> class AbstractFunction ## n { \
AbstractFunction ## n (int degree = 0) : \
degree_(degree) \
{} \
virtual ~AbstractFunction ## n () {} \
inline int getDegree() const \
{ \
return degree_; \
} \
virtual ReturnType operator()(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, const T, &t)) const = 0; \
\
protected: \
int degree_; \
}; \
// template< typename ReturnType,
// BOOST_PP_ENUM_PARAMS(N, typename T) // expands to typename T0, typename T1, typename T2...
// >
// class CONCAT_STR(AbstractFunction,N)
// {
// public:
// CONCAT_STR(AbstractFunction,N)(int degree = 0) :
// degree_(degree)
// {}
//
// virtual ~CONCAT_STR(AbstractFunction,N)() {}
//
// /// Returns \ref degree_.
// inline int getDegree() const
// {
// return degree_;
// }
//
// /// function evaluation.
// virtual ReturnType operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, const T, &t)) const = 0;
//
// protected:
// int degree_;
// };
BOOST_PP_REPEAT_FROM_TO
(
1
,
11
,
ABSTRACT_FUNCTION_MACRO
,
nil
)
}
...
...
AMDiS/src/AdaptInstationary.cc
View file @
a4e461ee
...
...
@@ -192,7 +192,7 @@ namespace AMDiS {
adaptInfo
->
setSpaceIteration
(
0
);
// === Do
only
space iterations only if the maximum is higher than 0. ===
// === Do space iterations only if the maximum is higher than 0. ===
if
(
adaptInfo
->
getMaxSpaceIteration
()
>
0
)
{
...
...
AMDiS/src/Global.h
View file @
a4e461ee
...
...
@@ -65,6 +65,7 @@
#include
<boost/algorithm/string.hpp>
#include
<boost/algorithm/string/trim.hpp>
#include
<boost/math/special_functions/fpclassify.hpp>
#include
"boost/tuple/tuple.hpp"
#include
"AMDiS_fwd.h"
#include
"OpenMP.h"
...
...
@@ -148,6 +149,12 @@ namespace AMDiS {
#endif
}
/// check for inf and nan values
inline
bool
isNumber
(
double
val
)
{
return
!
boost
::
math
::
isnan
(
val
)
&&
!
boost
::
math
::
isinf
(
val
);
}
/// trim std::string
inline
std
::
string
trim
(
const
std
::
string
&
oldStr
)
...
...
AMDiS/src/ProblemStat.cc
View file @
a4e461ee
...
...
@@ -514,6 +514,7 @@ namespace AMDiS {
{
FUNCNAME
(
"ProblemStat::createSolver()"
);
// definition of standard-backends
#if defined HAVE_PARALLEL_PETSC
string
backend
(
"p_petsc"
);
#elif defined HAVE_PARALLEL_MTL
...
...
@@ -576,7 +577,7 @@ namespace AMDiS {
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
estimator
[
i
]
->
addSystem
((
*
systemMatrix
)[
i
][
j
],
solution
->
getDOFVector
(
j
),
rhs
->
getDOFVector
(
j
));
rhs
->
getDOFVector
(
j
));
// TODO: hier eventuell (i) statt (j) ???
}
}
...
...
@@ -625,7 +626,7 @@ namespace AMDiS {
solutionList
));
}
// Create own filewriters for each component
s
of the problem
// Create own filewriters for each component of the problem
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
numberedName
=
name
+
"->output["
+
boost
::
lexical_cast
<
string
>
(
i
)
+
"]"
;
filename
=
""
;
...
...
@@ -659,13 +660,12 @@ namespace AMDiS {
return
;
}
clock_t
first
=
clock
();
Timer
t
;
solver
->
solveSystem
(
solverMatrix
,
*
solution
,
*
rhs
,
createMatrixData
,
storeMatrixData
);
INFO
(
info
,
8
)(
"solution of discrete system needed %.5f seconds
\n
"
,
TIME_USED
(
first
,
clock
()
));
t
.
elapsed
(
));
adaptInfo
->
setSolverIterations
(
solver
->
getIterations
());
adaptInfo
->
setMaxSolverIterations
(
solver
->
getMaxIterations
());
...
...
@@ -678,11 +678,7 @@ namespace AMDiS {
{
FUNCNAME
(
"ProblemStat::estimate()"
);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
double
first
=
MPI
::
Wtime
();
#else
clock_t
first
=
clock
();
#endif
Timer
t
;
if
(
computeExactError
)
{
computeError
(
adaptInfo
);
...
...
@@ -708,12 +704,9 @@ namespace AMDiS {
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MPI
::
COMM_WORLD
.
Barrier
();
INFO
(
info
,
8
)(
"estimation of the error needed %.5f seconds
\n
"
,
MPI
::
Wtime
()
-
first
);
#else
INFO
(
info
,
8
)(
"estimation of the error needed %.5f seconds
\n
"
,
TIME_USED
(
first
,
clock
()));
#endif
INFO
(
info
,
8
)(
"estimation of the error needed %.5f seconds
\n
"
,
t
.
elapsed
());
}
...
...
@@ -1506,8 +1499,7 @@ namespace AMDiS {
if
(
matrix
)
{
matrix
->
assemble
(
1.0
,
elInfo
,
bound
);
// Take the matrix boundary manager from the public matrix,
// but assemble the boundary conditions on the thread private matrix.
// assemble the boundary conditions on the matrix.
if
(
matrix
->
getBoundaryManager
())
matrix
->
getBoundaryManager
()
->
fillBoundaryConditions
(
elInfo
,
matrix
);
}
...
...
@@ -1518,9 +1510,6 @@ namespace AMDiS {
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
// == Finally, if we have assembled in parallel, we have to add the thread ==
// == private matrix and vector to the global one. ==
if
(
matrix
)
{
matrix
->
clearDirichletRows
();
matrix
->
finishAssembling
();
...
...
AMDiS/src/solver/LinearSolver.h
View file @
a4e461ee
...
...
@@ -95,7 +95,7 @@ namespace AMDiS {
print_cycle
(
100
),
iterations
(
-
1
),
error
(
-
1
),
breakTolNotReached
(
fals
e
),
breakTolNotReached
(
tru
e
),
calculateResidual
(
false
)
{
Parameters
::
get
(
name
+
"->tolerance"
,
tolerance
);
...
...
@@ -136,7 +136,7 @@ namespace AMDiS {
MSG
(
"Residual norm: ||b-Ax|| = %e
\n
"
,
residual
);
TEST_EXIT
(
residual
<=
tolerance
||
!
breakTolNotReached
)
TEST_EXIT
(
(
isNumber
(
residual
)
&&
residual
<=
tolerance
)
||
!
breakTolNotReached
)
(
"Tolerance tol = %e could not be reached!
\n
Set tolerance by '->solver->tolerance:'
\n
"
,
tolerance
);
}
return
error_code
;
...
...
AMDiS/src/solver/UmfPackSolver.h
View file @
a4e461ee
...
...
@@ -67,13 +67,12 @@ namespace AMDiS {
int
code
=
(
*
solver
)(
x
,
b
);
if
(
oem
.
getInfo
()
>
0
)
{
VectorType
r
(
b
);
r
-=
A
*
x
;
double
residual
=
two_norm
(
r
);
oem
.
setResidual
(
residual
);
oem
.
setErrorCode
(
code
);
}
return
code
;
}
...
...
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