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

* this and that

parent 80f5f335
......@@ -205,7 +205,7 @@ namespace AMDiS {
problemTime_->initTimestep(adaptInfo_);
/*#ifdef _OPENMP
#ifdef _OPENMP
#pragma omp parallel sections
{
#pragma omp section
......@@ -214,11 +214,10 @@ namespace AMDiS {
#pragma omp section
oneTimestep();
}
#else
*/
// problemTime_->startDelayedTimestepCalculation();
#else
problemTime_->startDelayedTimestepCalculation();
oneTimestep();
//#endif
#endif
problemTime_->closeTimestep(adaptInfo_);
......
......@@ -58,21 +58,17 @@ namespace AMDiS {
void DataCollector::fillAllData()
{
::std::cout << "START1" << ::std::endl;
if (!elementDataCollected_) {
startCollectingElementData();
}
::std::cout << "START2" << ::std::endl;
if (!periodicDataCollected_) {
startCollectingPeriodicData();
}
::std::cout << "START3" << ::std::endl;
if (!valueDataCollected_) {
startCollectingValueData();
}
::std::cout << "START4" << ::std::endl;
}
int DataCollector::startCollectingElementData()
......@@ -122,6 +118,10 @@ namespace AMDiS {
interpPoints_.clear();
basisFcts_ = const_cast<BasisFunction*>(feSpace_->getBasisFcts());
nBasisFcts_ = basisFcts_->getNumber();
localDOFs_ = GET_MEMORY(DegreeOfFreedom, basisFcts_->getNumber());
TraverseStack stack;
// Traverse elements to add value information and to mark
......@@ -131,10 +131,10 @@ namespace AMDiS {
traverseFlag_ | Mesh::FILL_COORDS);
while (elInfo) {
if (!writeElem_ || writeElem_(elInfo))
addValueData(elInfo);
addValueData(elInfo);
elInfo = stack.traverseNext(elInfo);
}
// Remove all interpolation marks and, instead, set to each
// interpolation point its continous index starting from 0.
int i = 0;
......@@ -152,8 +152,9 @@ namespace AMDiS {
elInfo = stack.traverseNext(elInfo);
}
FREE_MEMORY(localDOFs_, DegreeOfFreedom, feSpace_->getBasisFcts()->getNumber());
valueDataCollected_ = true;
return(0);
}
......@@ -287,29 +288,29 @@ namespace AMDiS {
{
FUNCNAME("DataCollector::addValueData()");
const BasisFunction *basisFcts = feSpace_->getBasisFcts();
const DegreeOfFreedom *localDOFs = basisFcts->getLocalIndices(elInfo->getElement(), localAdmin_, NULL);
const int nBasisFcts = basisFcts->getNumber();
basisFcts_->getLocalIndices(elInfo->getElement(), localAdmin_, localDOFs_);
WorldVector<double> vertexCoords;
// First, traverse all DOFs at the vertices of the element, determine
// their coordinates and add them to the corresponding entry in dofCoords_.
// their coordinates and add them to the corresponding entry in dofCoords_.
for (int i = 0; i < mesh_->getGeo(VERTEX); i++) {
(*interpPointInd_)[localDOFs[i]] = -2; // mark as vertex
DegreeOfFreedom dofi = localDOFs_[i];
(*interpPointInd_)[dofi] = -2; // mark as vertex
// get coords of this vertex
WorldVector<double> vertexCoords = elInfo->getCoord(i);
vertexCoords = elInfo->getCoord(i);
// search for coords at this dof
::std::list<WorldVector<double> >::iterator it =
find((*dofCoords_)[localDOFs[i]].begin(),
(*dofCoords_)[localDOFs[i]].end(),
find((*dofCoords_)[dofi].begin(),
(*dofCoords_)[dofi].end(),
vertexCoords);
// coords not yet in list?
if (it == (*dofCoords_)[localDOFs[i]].end()) {
if (it == (*dofCoords_)[dofi].end()) {
// add new coords to list
(*dofCoords_)[localDOFs[i]].push_back(vertexCoords);
(*dofCoords_)[dofi].push_back(vertexCoords);
}
}
......@@ -318,29 +319,29 @@ namespace AMDiS {
// Then, traverse all interpolation DOFs of the element, determine
// their coordinates and add them to the corresponding entry in
// interpPointCoords_.
for (int i = mesh_->getGeo(VERTEX); i < nBasisFcts_; i++) {
DegreeOfFreedom dofi = localDOFs_[i];
for (int i = mesh_->getGeo(VERTEX); i < nBasisFcts; i++) {
WorldVector<double> interpolCoords;
elInfo->coordToWorld(*basisFcts->getCoords(i), &interpolCoords);
elInfo->coordToWorld(*basisFcts_->getCoords(i), &vertexCoords);
if ((*interpPointInd_)[localDOFs[i]] == -1) {
if ((*interpPointInd_)[dofi] == -1) {
// mark as interpolation point
(*interpPointInd_)[localDOFs[i]] = -3;
(*interpPointInd_)[dofi] = -3;
// search for interpolation point coordinates, and insert them to the
// dof-entry, if not contained in the list
::std::list<WorldVector<double> >::iterator it =
find((*interpPointCoords_)[localDOFs[i]].begin(),
(*interpPointCoords_)[localDOFs[i]].end(),
interpolCoords);
find((*interpPointCoords_)[dofi].begin(),
(*interpPointCoords_)[dofi].end(),
vertexCoords);
if (it == (*interpPointCoords_)[localDOFs[i]].end()) {
(*interpPointCoords_)[localDOFs[i]].push_back(interpolCoords);
if (it == (*interpPointCoords_)[dofi].end()) {
(*interpPointCoords_)[dofi].push_back(vertexCoords);
nInterpPoints_++;
}
}
}
return(0);
}
......@@ -348,15 +349,11 @@ namespace AMDiS {
{
FUNCNAME("DataCollector::addInterpData()");
::std::vector<int> elemInterpPoints;
elemInterpPoints.clear();
const BasisFunction *basisFcts = feSpace_->getBasisFcts();
const DegreeOfFreedom *localDOFs = basisFcts->getLocalIndices(elInfo->getElement(), localAdmin_, NULL);
const int nBasisFcts = basisFcts->getNumber();
basisFcts_->getLocalIndices(elInfo->getElement(), localAdmin_, localDOFs_);
for (int i = mesh_->getGeo(VERTEX); i < nBasisFcts; i++) {
elemInterpPoints.push_back((*interpPointInd_)[localDOFs[i]]);
::std::vector<int> elemInterpPoints(nBasisFcts_);
for (int i = mesh_->getGeo(VERTEX); i < nBasisFcts_; i++) {
elemInterpPoints[i] = (*interpPointInd_)[localDOFs_[i]];
}
interpPoints_.push_back(elemInterpPoints);
......
......@@ -300,6 +300,21 @@ namespace AMDiS {
* Pointer to a function which decides whether an element is considered.
*/
bool (*writeElem_)(ElInfo*);
/** \brief
* Temporary variable used in functions addValueData() and addInterpData().
*/
DegreeOfFreedom *localDOFs_;
/** \brief
* Temporary variable used in functions addValueData() and addInterpData().
*/
BasisFunction *basisFcts_;
/** \brief
* Temporaru variable used in functions addValueData() and addInterpData().
*/
int nBasisFcts_;
};
}
......
......@@ -197,19 +197,14 @@ namespace AMDiS {
if (delayWriting_) {
::std::cout << "REIN!" << ::std::endl; ::std::cout.flush();
if (writeTecPlotFormat || writeAMDiSFormat || writePeriodicFormat) {
ERROR_EXIT("Delay writing only supported for ParaView file format!\n");
}
::std::cout << "DC=" << dataCollectors_.size()<< ::std::endl;
for (int i = 0; i < static_cast<int>(dataCollectors_.size()); i++) {
dataCollectors_[i]->fillAllData();
}
::std::cout << "BIS HIERHIN!" << ::std::endl; ::std::cout.flush();
writingIsDelayed_ = true;
delayedFilename_ = fn;
return;
......
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