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

TimeObject added.

parent b5effb66
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
#include "SystemVector.h" #include "SystemVector.h"
#include "TecPlotWriter.h" #include "TecPlotWriter.h"
#include "Tetrahedron.h" #include "Tetrahedron.h"
#include "TimedObject.h"
#include "Traverse.h" #include "Traverse.h"
#include "Triangle.h" #include "Triangle.h"
#include "ValueWriter.h" #include "ValueWriter.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "Flag.h" #include "Flag.h"
#include "RCNeighbourList.h" #include "RCNeighbourList.h"
#include "DOFAdmin.h" #include "DOFAdmin.h"
#include "DOFIterator.h"
#include "DOFIndexed.h" #include "DOFIndexed.h"
#include "Boundary.h" #include "Boundary.h"
#include "Serializable.h" #include "Serializable.h"
...@@ -99,12 +98,30 @@ namespace AMDiS { ...@@ -99,12 +98,30 @@ namespace AMDiS {
} }
// Only to get rid of the abstract functions, I hope they are not used // Only to get rid of the abstract functions, I hope they are not used
std::vector<bool>::iterator begin() {ERROR_EXIT("Shouldn't be used, only fake."); std::vector<bool> v; return v.begin();} std::vector<bool>::iterator begin()
std::vector<bool>::iterator end() {ERROR_EXIT("Shouldn't be used, only fake."); std::vector<bool> v; return v.end();} {
ERROR_EXIT("Shouldn't be used, only fake."); std::vector<bool> v;
return v.begin();
}
std::vector<bool>::iterator end()
{
ERROR_EXIT("Shouldn't be used, only fake."); std::vector<bool> v;
return v.end();
}
bool dummy; // Must be deleted later bool dummy; // Must be deleted later
bool& operator[](int i) {ERROR_EXIT("Shouldn't be used, only fake."); return dummy;} bool& operator[](int i)
const bool& operator[](int i) const {ERROR_EXIT("Shouldn't be used, only fake."); return dummy;} {
ERROR_EXIT("Shouldn't be used, only fake.");
return dummy;
}
const bool& operator[](int i) const
{
ERROR_EXIT("Shouldn't be used, only fake.");
return dummy;
}
/// DOFMatrix does not need to be compressed before assembling, when using MTL4. /// DOFMatrix does not need to be compressed before assembling, when using MTL4.
void compressDOFIndexed(int first, int last, std::vector<DegreeOfFreedom> &newDOF) {} void compressDOFIndexed(int first, int last, std::vector<DegreeOfFreedom> &newDOF) {}
......
...@@ -205,15 +205,20 @@ namespace AMDiS { ...@@ -205,15 +205,20 @@ namespace AMDiS {
masterMatrix_ = NULL; masterMatrix_ = NULL;
} }
matrix->print();
using namespace mtl; using namespace mtl;
std::cout << "ASSOC = " << std::endl; DOFAdmin* admin = rowFESpace->getAdmin();
for (int i = 0; i < 10; i++) std::vector<int> dofMap(admin->getUsedSize());
std::cout << i << " = " << (*associated)[i] << std::endl; for (int i = 0; i < admin->getUsedSize(); i++) {
dofMap[i] = (*associated)[i];
std::cout << "map " << i << " to " << dofMap[i] << std::endl;
}
// Compute reorder matrix (newRow and newCol yields transposed!!!) // Compute reorder matrix (newRow and newCol yields transposed!!!)
matrix::traits::reorder<>::type R= matrix::reorder(*associated); matrix::traits::reorder<>::type R= matrix::reorder(dofMap);
DOFMatrix::base_matrix_type &A= matrix->getBaseMatrix(), B, D, E, TR; DOFMatrix::base_matrix_type &A= matrix->getBaseMatrix(), B, D, E, TR;
A*= 0.5; A*= 0.5;
// Half of entries with decreased row index + half of the strict lower origing // Half of entries with decreased row index + half of the strict lower origing
...@@ -225,7 +230,7 @@ namespace AMDiS { ...@@ -225,7 +230,7 @@ namespace AMDiS {
D= bands(TR, 0, 1); D= bands(TR, 0, 1);
E= A * strict_lower(R) + lower(A); E= A * strict_lower(R) + lower(A);
B+= D * E; B+= D * E;
swap(A, B); swap(A, B);
} }
void PeriodicBC::exitVector(DOFVectorBase<double>* vector) void PeriodicBC::exitVector(DOFVectorBase<double>* vector)
......
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// ============================================================================
// == ==
// == crystal growth group ==
// == ==
// == Stiftung caesar ==
// == Ludwig-Erhard-Allee 2 ==
// == 53175 Bonn ==
// == germany ==
// == ==
// ============================================================================
// == ==
// == http://www.caesar.de/cg/AMDiS ==
// == ==
// ============================================================================
/** \file TimedObject.h */
#ifndef AMDIS_TIMEDOBJECT_H
#define AMDIS_TIMEDOBJECT_H
namespace AMDiS {
// ===========================================================================
// ===== class TimedObject ===================================================
// ===========================================================================
/** \brief
* This class can be used as base class for time dependent objects where
* different objects refer to the same time. Herefore a pointer to
* a double value is stored, pointing to a time value, which can be
* managed in one central object, maybe the problem class.
*/
class TimedObject
{
public:
/** \brief
* Constructor.
*/
TimedObject() : timePtr(NULL) {};
/** \brief
* Sets the time pointer.
*/
inline void setTimePtr(double *timePtr_) { timePtr = timePtr_; };
/** \brief
* Returns the time pointer.
*/
inline double *getTimePtr() { return timePtr; };
protected:
/** \brief
* Pointer to the externally managed time value.
*/
double *timePtr;
};
}
#endif // AMDIS_TIMEDOBJECT_H
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