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
8c0fc620
Commit
8c0fc620
authored
Jun 03, 2010
by
Thomas Witkowski
Browse files
Several small features added.
parent
fd5a901e
Changes
10
Show whitespace changes
Inline
Side-by-side
AMDiS/libtool
View file @
8c0fc620
...
...
@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host
deimos
10
1
:
# Libtool was configured on host
p2d
10
8
:
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
...
...
@@ -82,13 +82,13 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
LTCC
=
"
g
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
# A language-specific compiler.
CC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
CC
=
"
g
cc"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
...
...
@@ -174,7 +174,7 @@ dlopen_self=unknown
dlopen_self_static
=
unknown
# Compiler flag to prevent dynamic linking.
link_static_flag
=
""
link_static_flag
=
"
-static
"
# Compiler flag to turn off builtin functions.
no_builtin_flag
=
" -fno-builtin"
...
...
@@ -6763,7 +6763,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host
deimos
10
1
:
# Libtool was configured on host
p2d
10
8
:
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
...
...
@@ -6801,13 +6801,13 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
LTCC
=
"
g
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
# A language-specific compiler.
CC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpiCC
"
CC
=
"
g++
"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
...
...
@@ -6893,7 +6893,7 @@ dlopen_self=unknown
dlopen_self_static
=
unknown
# Compiler flag to prevent dynamic linking.
link_static_flag
=
""
link_static_flag
=
"
-static
"
# Compiler flag to turn off builtin functions.
no_builtin_flag
=
" -fno-builtin"
...
...
@@ -6960,11 +6960,11 @@ predeps=""
# Dependencies to place after the objects being linked to create a
# shared library.
postdeps
=
"
-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -ldl -lnsl -lutil -ldl
-lstdc++ -lm -lgcc_s
-lpthread
-lc -lgcc_s"
postdeps
=
"-lstdc++ -lm -lgcc_s -lc -lgcc_s"
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path
=
`
echo
"-L/usr/lib64
-L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64
/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
compiler_lib_search_path
=
`
echo
"-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Method to check whether dependent libraries are shared objects.
deplibs_check_method
=
"pass_all"
...
...
@@ -7071,7 +7071,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host
deimos
10
1
:
# Libtool was configured on host
p2d
10
8
:
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
...
...
@@ -7109,7 +7109,7 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
LTCC
=
"
g
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
...
...
AMDiS/src/AdaptInfo.h
View file @
8c0fc620
...
...
@@ -59,7 +59,6 @@ namespace AMDiS {
refinementAllowed
(
1
),
refineBisections
(
1
),
coarseBisections
(
1
)
{
double
timeTheta2
=
0.3
;
...
...
@@ -147,7 +146,8 @@ namespace AMDiS {
solverTolerance
(
1e-8
),
solverResidual
(
0.0
),
scalContents
(
size
),
isDeserialized_
(
false
)
deserialized
(
false
),
rosenbrockMode
(
false
)
{
GET_PARAMETER
(
0
,
name_
+
"->start time"
,
"%f"
,
&
startTime
);
time
=
startTime
;
...
...
@@ -622,6 +622,11 @@ namespace AMDiS {
return
scalContents
.
size
();
}
inline
bool
getRosenbrockMode
()
{
return
rosenbrockMode
;
}
inline
void
setSolverIterations
(
int
it
)
{
solverIterations
=
it
;
...
...
@@ -665,12 +670,17 @@ namespace AMDiS {
/// Returns true, if the adaptive procedure was deserialized from a file.
const
bool
isDeserialized
()
const
{
return
isD
eserialized
_
;
return
d
eserialized
;
}
inline
void
setIsDeserialized
(
bool
b
)
{
isDeserialized_
=
b
;
deserialized
=
b
;
}
inline
void
setRosenbrockMode
(
bool
b
)
{
rosenbrockMode
=
b
;
}
/// Creates new scalContents with the given size.
...
...
@@ -767,7 +777,10 @@ namespace AMDiS {
std
::
vector
<
ScalContent
*>
scalContents
;
/// Is true, if the adaptive procedure was deserialized from a file.
bool
isDeserialized_
;
bool
deserialized
;
/// Is true, if the time adaption is controlled by a Rosenbrock Method.
bool
rosenbrockMode
;
};
}
...
...
AMDiS/src/DOFVector.h
View file @
8c0fc620
...
...
@@ -523,19 +523,22 @@ namespace AMDiS {
/// vec[i] = v.vec[i]
void
copy
(
const
DOFVector
<
T
>&
v
);
/// Returns minimum of DOFVector
/// Returns minimum of DOFVector
.
T
min
()
const
;
/// Returns maximum of DOFVector
/// Returns maximum of DOFVector
.
T
max
()
const
;
/// Returns absolute maximum of DOFVector
/// Returns absolute maximum of DOFVector
.
T
absMax
()
const
;
/// Used by interpol while mesh traversal
/// Returns the average value of the DOFVector.
T
average
()
const
;
/// Used by interpol while mesh traversal.
void
interpolFct
(
ElInfo
*
elinfo
);
/// Prints \ref vec to stdout
/// Prints \ref vec to stdout
.
void
print
()
const
;
///
...
...
AMDiS/src/DOFVector.hh
View file @
8c0fc620
...
...
@@ -289,6 +289,7 @@ namespace AMDiS {
return
m
;
}
template
<
typename
T
>
T
DOFVector
<
T
>::
max
()
const
{
...
...
@@ -302,6 +303,7 @@ namespace AMDiS {
m
=
std
::
max
(
m
,
*
vecIterator
);
return
m
;
}
template
<
typename
T
>
...
...
@@ -310,6 +312,26 @@ namespace AMDiS {
return
std
::
max
(
abs
(
max
()),
abs
(
min
()));
}
template
<
typename
T
>
T
DOFVector
<
T
>::
average
()
const
{
FUNCNAME
(
"DOFVector<T>::average()"
);
checkFeSpace
(
this
->
feSpace
,
vec
);
int
count
=
0
;
T
m
=
0
;
Iterator
vecIterator
(
const_cast
<
DOFIndexed
<
T
>*>
(
dynamic_cast
<
const
DOFIndexed
<
T
>*>
(
this
)),
USED_DOFS
);
for
(
vecIterator
.
reset
();
!
vecIterator
.
end
();
++
vecIterator
)
{
m
+=
*
vecIterator
;
count
++
;
}
return
m
/
count
;
}
template
<
typename
T
>
void
DOFVector
<
T
>::
print
()
const
{
...
...
AMDiS/src/ProblemVec.cc
View file @
8c0fc620
...
...
@@ -538,10 +538,11 @@ namespace AMDiS {
adaptInfo
->
setEstSum
(
scalEstimator
->
getErrorSum
(),
i
);
adaptInfo
->
setEstMax
(
scalEstimator
->
getErrorMax
(),
i
);
if
(
adaptInfo
->
getRosenbrockMode
()
==
false
)
{
adaptInfo
->
setTimeEstSum
(
scalEstimator
->
getTimeEst
(),
i
);
adaptInfo
->
setTimeEstMax
(
scalEstimator
->
getTimeEstMax
(),
i
);
}
else
{
WARNING
(
"No estimator for component %d
\n
"
,
i
);
}
}
}
}
...
...
@@ -623,7 +624,7 @@ namespace AMDiS {
FUNCNAME
(
"ProblemVec::buildAfterCoarsen()"
);
if
(
dualMeshTraverseRequired
())
{
dualAssemble
(
adaptInfo
,
flag
);
dualAssemble
(
adaptInfo
,
flag
,
asmMatrix
,
asmVector
);
return
;
}
...
...
@@ -779,10 +780,13 @@ namespace AMDiS {
}
void
ProblemVec
::
dualAssemble
(
AdaptInfo
*
adaptInfo
,
Flag
flag
)
void
ProblemVec
::
dualAssemble
(
AdaptInfo
*
adaptInfo
,
Flag
flag
,
bool
asmMatrix
,
bool
asmVector
)
{
FUNCNAME
(
"ProblemVec::dualAssemble()"
);
TEST_EXIT
(
asmVector
)(
"Not yet implemented!
\n
"
);
for
(
unsigned
int
i
=
0
;
i
<
meshes
.
size
();
i
++
)
meshes
[
i
]
->
dofCompress
();
...
...
@@ -828,7 +832,7 @@ namespace AMDiS {
bool
assembleMatrix
=
true
;
// The DOFMatrix which should be assembled (or not, if assembleMatrix
// will be set to false).
DOFMatrix
*
matrix
=
(
*
systemMatrix
)[
i
][
j
];
DOFMatrix
*
matrix
=
(
asmMatrix
?
(
*
systemMatrix
)[
i
][
j
]
:
NULL
)
;
if
(
writeAsmInfo
&&
matrix
)
{
for
(
std
::
vector
<
Operator
*>::
iterator
it
=
matrix
->
getOperatorsBegin
();
...
...
@@ -874,6 +878,10 @@ namespace AMDiS {
if
(
!
assembleMatrix
&&
i
!=
j
)
if
(
matrix
)
nnz
+=
matrix
->
getBaseMatrix
().
nnz
();
if
(
matrix
&&
!
assembleMatrix
)
{
ERROR_EXIT
(
"Not yet implemented!
\n
"
);
}
}
}
...
...
@@ -899,7 +907,7 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
{
DOFMatrix
*
matrix
=
(
*
systemMatrix
)[
i
][
j
];
DOFMatrix
*
matrix
=
(
asmMatrix
?
(
*
systemMatrix
)[
i
][
j
]
:
NULL
)
;
if
(
!
matrix
)
continue
;
...
...
@@ -983,18 +991,17 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
{
DOFMatrix
*
matrix
=
(
*
systemMatrix
)[
i
][
j
];
DOFMatrix
*
matrix
=
(
asmMatrix
?
(
*
systemMatrix
)[
i
][
j
]
:
NULL
)
;
if
(
matrix
)
matrix
->
removeRowsWithDBC
(
matrix
->
getApplyDBCs
());
if
(
!
matrix
)
continue
;
if
(
matrix
)
matrix
->
removeRowsWithDBC
(
matrix
->
getApplyDBCs
());
matrix
->
finishInsertion
();
if
(
matrix
&&
matrix
->
getBoundaryManager
())
if
(
matrix
->
getBoundaryManager
())
matrix
->
getBoundaryManager
()
->
exitMatrix
(
matrix
);
if
(
matrix
)
nnz
+=
matrix
->
getBaseMatrix
().
nnz
();
}
...
...
AMDiS/src/ProblemVec.h
View file @
8c0fc620
...
...
@@ -182,7 +182,8 @@ namespace AMDiS {
bool
dualMeshTraverseRequired
();
void
dualAssemble
(
AdaptInfo
*
adaptInfo
,
Flag
flag
);
void
dualAssemble
(
AdaptInfo
*
adaptInfo
,
Flag
flag
,
bool
asmMatrix
=
true
,
bool
asmVector
=
true
);
void
createPrecon
();
...
...
AMDiS/src/ResidualEstimator.cc
View file @
8c0fc620
...
...
@@ -179,9 +179,9 @@ namespace AMDiS {
}
if
(
output
)
{
MSG
(
"estimate
= %.8e
\n
"
,
est_sum
);
MSG
(
"estimate
for component %d
= %.8e
\n
"
,
row
,
est_sum
);
if
(
C3
)
MSG
(
"time estimate
= %.8e
\n
"
,
est_t_sum
);
MSG
(
"time estimate
for component %d
= %.8e
\n
"
,
row
,
est_t_sum
);
}
delete
[]
riq
;
...
...
AMDiS/src/VtkWriter.hh
View file @
8c0fc620
...
...
@@ -126,7 +126,8 @@ namespace AMDiS {
DOFVector
<
double
>::
Iterator
valueIt
(
values
,
USED_DOFS
);
DOFVector
<
std
::
list
<
WorldVector
<
double
>
>
>::
Iterator
coordIt
(
dofCoords
,
USED_DOFS
);
file
<<
std
::
fixed
;
file
<<
std
::
scientific
;
file
.
precision
(
15
);
// Write the values for all vertex DOFs.
for
(
intPointIt
.
reset
(),
valueIt
.
reset
(),
coordIt
.
reset
();
...
...
AMDiS/src/time/RosenbrockAdaptInstationary.cc
View file @
8c0fc620
...
...
@@ -15,15 +15,23 @@ namespace AMDiS {
firstTimestep
(
true
),
lastTimestepRejected
(
false
),
succRejection
(
false
),
fixFirstTimesteps
(
0
),
tauGamma
(
1.0
)
{
FUNCNAME
(
"RosenbrockAdaptInstationary::RosenbrockAdaptInstationary()"
);
std
::
string
str
;
GET_PARAMETER
(
0
,
name
+
"->rosenbrock method"
,
&
str
);
RosenbrockMethodCreator
*
creator
=
dynamic_cast
<
RosenbrockMethodCreator
*>
(
CreatorMap
<
RosenbrockMethod
>::
getCreator
(
str
));
rosenbrockMethod
=
creator
->
create
();
TEST_EXIT_DBG
(
rosenbrockMethod
)(
"This should not happen!
\n
"
);
GET_PARAMETER
(
0
,
name
+
"->fix first timesteps"
,
"%d"
,
&
fixFirstTimesteps
);
problemStat
->
setRosenbrockMethod
(
rosenbrockMethod
);
adaptInfo
->
setRosenbrockMode
(
true
);
}
...
...
@@ -58,9 +66,12 @@ namespace AMDiS {
double
newTimestep
=
0.0
;
double
order
=
rosenbrockMethod
->
getOrder
();
if
(
errorEst
<
timeTol
)
{
if
(
errorEst
<
timeTol
||
fixFirstTimesteps
>
0
||
firstTimestep
)
{
double
fac
=
1.0
;
if
(
fixFirstTimesteps
>
0
)
{
newTimestep
=
adaptInfo
->
getTimestep
();
}
else
{
if
(
firstTimestep
||
succRejection
)
{
fac
=
pow
((
timeTol
/
errorEst
),
1.0
/
order
);
}
else
{
...
...
@@ -69,6 +80,8 @@ namespace AMDiS {
}
fac
=
std
::
min
(
fac
,
3.0
);
newTimestep
=
fac
*
adaptInfo
->
getTimestep
();
newTimestep
*=
0.95
;
}
tauAcc
=
adaptInfo
->
getTimestep
();
estAcc
=
errorEst
;
...
...
@@ -87,6 +100,7 @@ namespace AMDiS {
}
newTimestep
=
pow
((
timeTol
/
errorEst
),
1.0
/
order
)
*
adaptInfo
->
getTimestep
();
newTimestep
*=
0.95
;
tauRej
=
adaptInfo
->
getTimestep
();
estRej
=
errorEst
;
...
...
@@ -94,25 +108,21 @@ namespace AMDiS {
lastTimestepRejected
=
true
;
}
newTimestep
*=
0.95
;
if
(
errorEst
<
timeTol
||
firstTimestep
)
{
INFO
(
info
,
6
)(
"Accepted timestep at time = %
f
with timestep = %
f
\n
"
,
if
(
errorEst
<
timeTol
||
fi
xFi
rstTimestep
s
)
{
INFO
(
info
,
6
)(
"Accepted timestep at time = %
e
with timestep = %
e
\n
"
,
adaptInfo
->
getTime
()
-
adaptInfo
->
getTimestep
(),
adaptInfo
->
getTimestep
());
adaptInfo
->
setTimestep
(
newTimestep
);
if
(
firstTimestep
)
firstTimestep
=
false
;
rejected
=
false
;
for
(
int
i
=
0
;
i
<
adaptInfo
->
getSize
();
i
++
)
INFO
(
info
,
6
)(
"time estimat
or
for component %d = %
f
\n
"
,
INFO
(
info
,
6
)(
"time estimat
e
for component %d = %
e
\n
"
,
i
,
adaptInfo
->
getTimeEstSum
(
i
));
}
else
{
INFO
(
info
,
6
)(
"Rejected timestep at time = %
f
with timestep = %
f
\n
"
,
INFO
(
info
,
6
)(
"Rejected timestep at time = %
e
with timestep = %
e
\n
"
,
adaptInfo
->
getTime
()
-
adaptInfo
->
getTimestep
(),
adaptInfo
->
getTimestep
());
...
...
@@ -122,6 +132,12 @@ namespace AMDiS {
rejected
=
true
;
}
if
(
firstTimestep
)
firstTimestep
=
false
;
if
(
fixFirstTimesteps
>
0
)
fixFirstTimesteps
--
;
}
while
(
rejected
);
rosenbrockStat
->
acceptTimestep
();
...
...
AMDiS/src/time/RosenbrockAdaptInstationary.h
View file @
8c0fc620
...
...
@@ -40,21 +40,43 @@ namespace AMDiS {
AdaptInfo
*
initialInfo
,
time_t
initialTimestamp
=
0
);
/// Runs the Rosenbrock loop until one timestep is accepted.
void
oneTimestep
();
/// Returns \ref tauGamma.
double
*
getTauGamma
()
{
return
&
tauGamma
;
}
protected:
/// Pointer to the Rosenbrock method that should be used.
RosenbrockMethod
*
rosenbrockMethod
;
/// Pointer to the stationary problem;
RosenbrockStationary
*
rosenbrockStat
;
bool
firstTimestep
,
lastTimestepRejected
,
succRejection
;
/// Indicates, if this is the very first timestep.
bool
firstTimestep
;
double
tauAcc
,
estAcc
,
tauRej
,
estRej
;
/// If true, the last timestep was rejected.
bool
lastTimestepRejected
;
/// If true, more than one of the last timesteps were rejected.
bool
succRejection
;
/// If greater than 0, than for the first given number of timesteps the timestep
/// will be not changed and is set to the very first one.
int
fixFirstTimesteps
;
double
tauAcc
;
double
estAcc
;
double
tauRej
;
double
estRej
;
double
tauGamma
;
};
...
...
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