Commit 1dba0d87 authored by Praetorius, Simon's avatar Praetorius, Simon

Vector_FOT with factor

parent 80fd0375
...@@ -203,13 +203,13 @@ namespace AMDiS { ...@@ -203,13 +203,13 @@ namespace AMDiS {
{ {
public: public:
/// Constructor. /// Constructor.
Vector_FOT(WorldVector<double> *wv) Vector_FOT(WorldVector<double> *wv, double fac_ = 1.0)
: FirstOrderTerm(0), b(wv) : FirstOrderTerm(0), b(wv), fac(fac_)
{} {}
/// Constructor. /// Constructor.
Vector_FOT(int bIdx) Vector_FOT(int bIdx, double fac_ = 1.0)
: FirstOrderTerm(0) : FirstOrderTerm(0), fac(fac_)
{ {
bOne = bIdx; bOne = bIdx;
} }
...@@ -223,10 +223,10 @@ namespace AMDiS { ...@@ -223,10 +223,10 @@ namespace AMDiS {
if (bOne > -1) { if (bOne > -1) {
for (int iq = 0; iq < nPoints; iq++) for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], 1.0); lb_one(grdLambda, Lb[iq], fac);
} else { } else {
for (int iq = 0; iq < nPoints; iq++) for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], 1.0); lb(grdLambda, *b, Lb[iq], fac);
} }
} }
...@@ -238,14 +238,17 @@ namespace AMDiS { ...@@ -238,14 +238,17 @@ namespace AMDiS {
mtl::dense_vector<double>& result, mtl::dense_vector<double>& result,
double factor) double factor)
{ {
if (num_rows(grdUhAtQP) > 0) if (num_rows(grdUhAtQP) > 0) {
double factor_ = factor * fac;
for (int iq = 0; iq < nPoints; iq++) for (int iq = 0; iq < nPoints; iq++)
result[iq] += *b * grdUhAtQP[iq] * factor; result[iq] += *b * grdUhAtQP[iq] * factor_;
}
} }
protected: protected:
/// Vector which is multiplied with \f$ \nabla u(\vec{x}) \f$ /// Vector which is multiplied with \f$ \nabla u(\vec{x}) \f$
WorldVector<double> *b; WorldVector<double> *b;
double fac;
}; };
/** /**
......
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