diff --git a/AMDiS/ChangeLog b/AMDiS/ChangeLog index 5b37c9d5a7491bbe0a7ce0162b3d21042cec410d..f122da0dd132ce4cc08bd9463d8322d19a83c649 100644 --- a/AMDiS/ChangeLog +++ b/AMDiS/ChangeLog @@ -3,3 +3,8 @@ Rev 1210: "FeSpace" geändert. Dies betrifft insbesondere "getFESpace()", das nun "getFeSpace()" heißt. * ProblemVec::getRHS() -> ProblemVec::getRhs() +Rev 1231: + * Im Operator-Konstruktor brauchen die Flags, daher MATRIX_OPERATOR und + VECTOR_OPERATOR nicht mehr angegeben werden. Sollten diese gesetzt sein, + so compiliert das Programm noch, aber es wird eine entsprechende + Fehlermeldung ausgegeben und das Programm bricht ab. diff --git a/AMDiS/src/time/RosenbrockAdaptInstationary.cc b/AMDiS/src/time/RosenbrockAdaptInstationary.cc index 523235ffbe3c9f154287a8ec3aa4730a7d6108a4..f8a3aecbc1b56735ac679ba544f6a049d2103c2c 100644 --- a/AMDiS/src/time/RosenbrockAdaptInstationary.cc +++ b/AMDiS/src/time/RosenbrockAdaptInstationary.cc @@ -32,6 +32,8 @@ namespace AMDiS { problemStat->setRosenbrockMethod(rosenbrockMethod); adaptInfo->setRosenbrockMode(true); + + problemStat->setTauGamma(&tauGamma); } diff --git a/AMDiS/src/time/RosenbrockStationary.cc b/AMDiS/src/time/RosenbrockStationary.cc index 40b42e1ea5af4e4342f46fed211bc404819c3651..c0f6601823a1d4697fa275f5cc703c8ccdf4cc8f 100644 --- a/AMDiS/src/time/RosenbrockStationary.cc +++ b/AMDiS/src/time/RosenbrockStationary.cc @@ -31,6 +31,10 @@ namespace AMDiS { void RosenbrockStationary::buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag, bool asmMatrix, bool asmVector) { + FUNCNAME("RosenbrockStationary::buildAfterCoarsen()"); + + TEST_EXIT(tauPtr)("No tau pointer defined in stationary problem!\n"); + if (first) { first = false; *unVec = *solution; @@ -79,4 +83,44 @@ namespace AMDiS { void RosenbrockStationary::solve(AdaptInfo *adaptInfo, bool fixedMatrix) {} + + void RosenbrockStationary::addOperator(Operator &op, int row, int col, + double *factor, double *estFactor) + { + FUNCNAME("RosenbrockStationary::addOperator()"); + + TEST_EXIT(op.getUhOld() == NULL)("UhOld is not allowed to be set!\n"); + + op.setUhOld(stageSolution->getDOFVector(col)); + ProblemVec::addVectorOperator(op, row); + } + + + void RosenbrockStationary::addJacobianOperator(Operator &op, int row, int col, + double *factor, double *estFactor) + { + FUNCNAME("RosenbrockStationary::addJacobianOperator()"); + + TEST_EXIT(factor == NULL)("Not yet implemented!\n"); + TEST_EXIT(estFactor == NULL)("Not yet implemented!\n"); + + ProblemVec::addMatrixOperator(op, row, col, &minusOne, &minusOne); + } + + + void RosenbrockStationary::addTimeOperator(int row, int col) + { + FUNCNAME("RosenbrockStationary::addTimeOperator()"); + + TEST_EXIT(tauGamma)("This should not happen!\n"); + + Operator *op = new Operator(componentSpaces[row], componentSpaces[col]); + op->addZeroOrderTerm(new Simple_ZOT); + ProblemVec::addMatrixOperator(op, row, col, tauGamma, tauGamma); + + Operator *opRhs = new Operator(componentSpaces[row]); + opRhs->addZeroOrderTerm(new VecAtQP_ZOT(phiSum, new IdFunc())); + ProblemVec::addVectorOperator(opRhs, row, &minusOne, &minusOne); + } + } diff --git a/AMDiS/src/time/RosenbrockStationary.h b/AMDiS/src/time/RosenbrockStationary.h index 4a69d9689b49ce21cdbf1ec44702a98016ed262c..ccc4bc056e57c95b5e9eea18678a2629cfebd38c 100644 --- a/AMDiS/src/time/RosenbrockStationary.h +++ b/AMDiS/src/time/RosenbrockStationary.h @@ -32,29 +32,36 @@ namespace AMDiS { class RosenbrockStationary : public ProblemVec { public: + class IdFunc : public AbstractFunction<double, double> + { + public: + IdFunc() + : AbstractFunction<double, double>(1) + {} + + double operator()(const double& u) const + { + return u; + } + }; + + RosenbrockStationary(std::string name) : ProblemVec(name), - first(true) + first(true), + minusOne(-1.0), + tauPtr(NULL), + tauGamma(NULL) {} - DOFVector<double>* getStageSolution(int i) - { - return stageSolution->getDOFVector(i); - } - DOFVector<double>* getUnVec(int i) { return unVec->getDOFVector(i); } - DOFVector<double>* getPhiSum() - { - return phiSum; - } - - void setTauPtr(double *ptr) + DOFVector<double>* getStageSolution(int i) { - tauPtr = ptr; + return stageSolution->getDOFVector(i); } void acceptTimestep(); @@ -70,6 +77,24 @@ namespace AMDiS { init(); } + void addOperator(Operator &op, int row, int col, + double *factor = NULL, double *estFactor = NULL); + + void addJacobianOperator(Operator &op, int row, int col, + double *factor = NULL, double *estFactor = NULL); + + void addTimeOperator(int i, int j); + + void setTau(double *ptr) + { + tauPtr = ptr; + } + + void setTauGamma(double *ptr) + { + tauGamma = ptr; + } + protected: void init(); @@ -82,9 +107,13 @@ namespace AMDiS { DOFVector<double> *phiSum, *tmpDof; + bool first; + + double minusOne; + double *tauPtr; - bool first; + double *tauGamma; }; }