Skip to content
Snippets Groups Projects
Commit 660a5876 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Bugfix for usage of rhs operators with different basis function degrees.

parent 5d5e8dbb
Branches
Tags
No related merge requests found
......@@ -292,9 +292,9 @@ namespace AMDiS {
FUNCNAME("Assembler::matVecAssemble()");
Element *el = elInfo->getElement();
double *uhOldLoc = new double[nRow];
std::vector<double> uhOldLoc(operat->uhOld->getFeSpace() == rowFeSpace ? nRow : nCol);
operat->uhOld->getLocalVector(el, uhOldLoc);
operat->uhOld->getLocalVector(el, &(uhOldLoc[0]));
if (el != lastMatEl) {
set_to_zero(elementMatrix);
......@@ -303,13 +303,11 @@ namespace AMDiS {
for (int i = 0; i < nRow; i++) {
double val = 0.0;
for (int j = 0; j < nRow; j++)
for (int j = 0; j < nCol; j++)
val += elementMatrix[i][j] * uhOldLoc[j];
vec[i] += val;
}
delete [] uhOldLoc;
}
......
......@@ -19,8 +19,8 @@
/** \file MeshStructure.h */
#ifndef AMDIS_MESHSTRUCTURE_H
#define AMDIS_MESHSTRUCTURE_H
#ifndef AMDIS_MESH_STRUCTURE_H
#define AMDIS_MESH_STRUCTURE_H
#include <vector>
#include "AMDiS_fwd.h"
......@@ -166,6 +166,7 @@ namespace AMDiS {
MeshStructure *result);
protected:
/// Mesh structure code.
std::vector<unsigned long int> code;
int currentIndex;
......@@ -178,6 +179,7 @@ namespace AMDiS {
int nElements;
/// If true, some output is printed to screen during mesh structure code generation.
bool debugMode;
static const int unsignedLongSize;
......
......@@ -15,16 +15,14 @@ namespace AMDiS {
{
stageSolution = new SystemVector(*solution);
unVec = new SystemVector(*solution);
timeRhsVec = new SystemVector(*solution);
newUn = new SystemVector(*solution);
tmp = new SystemVector(*solution);
lowSol = new SystemVector(*solution);
lowSol = new SystemVector(*solution);
stageSolutions.resize(rm->getStages());
for (int i = 0; i < rm->getStages(); i++)
stageSolutions[i] = new SystemVector(*solution);
phiSum = new DOFVector<double>(feSpaces[0], "phiSum");
tmpDof = new DOFVector<double>(feSpaces[0], "phiSum");
stageSolutions[i] = new SystemVector(*solution);
}
......@@ -51,11 +49,11 @@ namespace AMDiS {
*stageSolution += *tmp;
}
phiSum->set(0.0);
timeRhsVec->set(0.0);
for (int j = 0; j < i; j++) {
*tmpDof = *(stageSolutions[j]->getDOFVector(0));
*tmpDof *= (rm->getC(i, j) / *tauPtr);
*phiSum += *tmpDof;
*tmp = *(stageSolutions[j]);
*tmp *= (rm->getC(i, j) / *tauPtr);
*timeRhsVec += *tmp;
}
ProblemVec::buildAfterCoarsen(adaptInfo, flag, (i == 0), asmVector);
......@@ -119,7 +117,7 @@ namespace AMDiS {
ProblemVec::addMatrixOperator(op, row, col, tauGamma, tauGamma);
Operator *opRhs = new Operator(componentSpaces[row]);
opRhs->addZeroOrderTerm(new VecAtQP_ZOT(phiSum, new IdFunc()));
opRhs->addZeroOrderTerm(new VecAtQP_ZOT(timeRhsVec->getDOFVector(col), new IdFunc()));
ProblemVec::addVectorOperator(opRhs, row, &minusOne, &minusOne);
}
......
......@@ -101,12 +101,10 @@ namespace AMDiS {
protected:
RosenbrockMethod *rm;
SystemVector *stageSolution, *unVec, *newUn, *tmp, *lowSol;
SystemVector *stageSolution, *unVec, *timeRhsVec, *newUn, *tmp, *lowSol;
std::vector<SystemVector*> stageSolutions;
DOFVector<double> *phiSum, *tmpDof;
bool first;
double minusOne;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment