Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

Commit b782f6d3 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* isDeserialized_ moved from AdaptInstationary to AdaptInfo

parent 3e4a0cc6
......@@ -169,7 +169,8 @@ namespace AMDiS {
maxSolverIterations(0),
solverTolerance(1e-8),
solverResidual(0.0),
scalContents(size)
scalContents(size),
isDeserialized_(false)
{
GET_PARAMETER(0, name_ + "->start time", "%f", &startTime);
time = startTime;
......@@ -675,6 +676,17 @@ namespace AMDiS {
return solverResidual;
};
/** \brief
* Returns true, if the adaptive procedure was deserialized from a file.
*/
const bool isDeserialized() const {
return isDeserialized_;
}
inline void setIsDeserialized(bool b) {
isDeserialized_ = b;
}
/** \brief
* Creates new scalContents with the given size.
*/
......@@ -782,6 +794,11 @@ namespace AMDiS {
* Scalar adapt infos.
*/
Vector<ScalContent*> scalContents;
/** \brief
* Is true, if the adaptive procedure was deserialized from a file.
*/
bool isDeserialized_;
};
}
......
......@@ -15,8 +15,7 @@ namespace AMDiS {
AdaptInfo *initialInfo,
time_t initialTimestamp)
: AdaptBase(name, problemStat, info, problemInstat, initialInfo),
breakWhenStable(0),
isDeserialized_(false)
breakWhenStable(0)
{
FUNCNAME("AdaptInstationary::AdaptInstationary()");
......@@ -43,7 +42,8 @@ namespace AMDiS {
deserialize(in);
in.close();
isDeserialized_ = true;
info->setIsDeserialized(true);
initialInfo->setIsDeserialized(true);
} else {
int readSerialization = 0;
int readSerializationWithAdaptInfo = 0;
......
......@@ -70,11 +70,10 @@ namespace AMDiS {
* Implementation of CreatorInterface::create().
*/
SystemVector *create() {
int i;
char number[10];
::std::string numberedName;
SystemVector *result = NEW SystemVector(name, feSpace, size);
for(i=0; i < size; i++) {
for (int i = 0; i < size; i++) {
sprintf(number, "[%d]", i);
numberedName = name + ::std::string(number);
result->setDOFVector(i, NEW DOFVector<double>(feSpace[i], numberedName));
......@@ -323,8 +322,8 @@ namespace AMDiS {
* multiplication with scalar
*/
inline const SystemVector& operator*=(SystemVector& x, double d) {
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
*(x.getDOFVector(i)) *= d;
}
return x;
......@@ -337,8 +336,8 @@ namespace AMDiS {
TEST_EXIT_DBG(x.getNumVectors() == y.getNumVectors())
("invalid size\n");
double result = 0.0;
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
result += (*x.getDOFVector(i)) * (*y.getDOFVector(i));
};
return result;
......@@ -352,8 +351,8 @@ namespace AMDiS {
{
TEST_EXIT_DBG(x.getNumVectors() == y.getNumVectors())
("invalid size\n");
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
(*(x.getDOFVector(i))) += (*(y.getDOFVector(i)));
}
return x;
......@@ -367,8 +366,8 @@ namespace AMDiS {
{
TEST_EXIT_DBG(x.getNumVectors() == y.getNumVectors())
("invalid size\n");
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
(*(x.getDOFVector(i))) -= (*(y.getDOFVector(i)));
}
return x;
......@@ -379,8 +378,8 @@ namespace AMDiS {
*/
inline SystemVector operator*(SystemVector& x, double d) {
SystemVector result = x;
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
(*(result.getDOFVector(i))) *= d;
}
return result;
......@@ -391,8 +390,8 @@ namespace AMDiS {
*/
inline SystemVector operator*(double d, SystemVector& x) {
SystemVector result = x;
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
(*(result.getDOFVector(i))) *= d;
}
return result;
......@@ -407,8 +406,8 @@ namespace AMDiS {
TEST_EXIT_DBG(x.getNumVectors() == y.getNumVectors())
("invalid size\n");
SystemVector result = x;
int i, size = x.getNumVectors();
for(i = 0; i < size; i++) {
int size = x.getNumVectors();
for (int i = 0; i < size; i++) {
(*(result.getDOFVector(i))) += (*(y.getDOFVector(i)));
}
return result;
......@@ -433,8 +432,8 @@ namespace AMDiS {
*/
inline double norm(SystemVector* x) {
double result = 0.0;
int i, size = x->getNumVectors();
for(i = 0; i < size; i++) {
int size = x->getNumVectors();
for (int i = 0; i < size; i++) {
result += x->getDOFVector(i)->squareNrm2();
}
return sqrt(result);
......@@ -445,8 +444,8 @@ namespace AMDiS {
*/
inline double L2Norm(SystemVector* x) {
double result = 0.0;
int i, size = x->getNumVectors();
for(i = 0; i < size; i++) {
int size = x->getNumVectors();
for (int i = 0; i < size; i++) {
result += x->getDOFVector(i)->L2NormSquare();
}
return sqrt(result);
......@@ -457,8 +456,8 @@ namespace AMDiS {
*/
inline double H1Norm(SystemVector* x) {
double result = 0.0;
int i, size = x->getNumVectors();
for(i = 0; i < size; i++) {
int size = x->getNumVectors();
for (int i = 0; i < size; i++) {
result += x->getDOFVector(i)->H1NormSquare();
}
return sqrt(result);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment