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

Fixed a bug for FOT operators when using 2d meshes in 3d.

parent 005e656e
...@@ -277,7 +277,8 @@ namespace AMDiS { ...@@ -277,7 +277,8 @@ namespace AMDiS {
* VectorOfFixVecs constructors. * VectorOfFixVecs constructors.
*/ */
MatrixOfFixVecs(int dim, int r, int c, InitType initType) MatrixOfFixVecs(int dim, int r, int c, InitType initType)
: rows(r), columns(c) : rows(r),
columns(c)
{ {
TEST_EXIT_DBG(initType == NO_INIT)("wrong initType or wrong initializer\n"); TEST_EXIT_DBG(initType == NO_INIT)("wrong initType or wrong initializer\n");
vec = new VectorOfFixVecs<FixVecType>*[rows]; vec = new VectorOfFixVecs<FixVecType>*[rows];
...@@ -309,12 +310,14 @@ namespace AMDiS { ...@@ -309,12 +310,14 @@ namespace AMDiS {
} }
/// Returns \ref rows /// Returns \ref rows
inline int getNumberOfRows() const { inline int getNumberOfRows() const
{
return rows; return rows;
} }
/// Returns \ref columns /// Returns \ref columns
inline int getNumberOfColumns() const { inline int getNumberOfColumns() const
{
return columns; return columns;
} }
...@@ -337,7 +340,8 @@ namespace AMDiS { ...@@ -337,7 +340,8 @@ namespace AMDiS {
* parts of an element. * parts of an element.
*/ */
template<typename T> template<typename T>
class DimVec : public FixVec<T,PARTS> { class DimVec : public FixVec<T,PARTS>
{
public: public:
DimVec() {} DimVec() {}
...@@ -549,8 +553,7 @@ namespace AMDiS { ...@@ -549,8 +553,7 @@ namespace AMDiS {
return result; return result;
} }
inline bool operator<(const WorldVector<double>& v1, inline bool operator<(const WorldVector<double>& v1, const WorldVector<double>& v2)
const WorldVector<double>& v2)
{ {
int dow = Global::getGeo(WORLD); int dow = Global::getGeo(WORLD);
for (int i = 0; i < dow; i++) { for (int i = 0; i < dow; i++) {
...@@ -561,8 +564,7 @@ namespace AMDiS { ...@@ -561,8 +564,7 @@ namespace AMDiS {
return false; return false;
} }
inline bool operator==(const WorldVector<double>& v1, inline bool operator==(const WorldVector<double>& v1, const WorldVector<double>& v2)
const WorldVector<double>& v2)
{ {
int dow = Global::getGeo(WORLD); int dow = Global::getGeo(WORLD);
for (int i = 0; i < dow; i++) for (int i = 0; i < dow; i++)
......
This diff is collapsed.
...@@ -172,8 +172,9 @@ namespace AMDiS { ...@@ -172,8 +172,9 @@ namespace AMDiS {
double factor) double factor)
{ {
const int dimOfWorld = Global::getGeo(WORLD); const int dimOfWorld = Global::getGeo(WORLD);
const int dim = Lambda.size() - 1;
for (int i = 0; i <= dimOfWorld; i++) { for (int i = 0; i <= dim; i++) {
double val = 0.0; double val = 0.0;
for (int j = 0; j < dimOfWorld; j++) for (int j = 0; j < dimOfWorld; j++)
...@@ -192,8 +193,9 @@ namespace AMDiS { ...@@ -192,8 +193,9 @@ namespace AMDiS {
double factor) double factor)
{ {
const int dimOfWorld = Global::getGeo(WORLD); const int dimOfWorld = Global::getGeo(WORLD);
const int dim = Lambda.size() - 1;
for (int i = 0; i <= dimOfWorld; i++) { for (int i = 0; i <= dim; i++) {
double val = 0.0; double val = 0.0;
for (int j = 0; j < dimOfWorld; j++) for (int j = 0; j < dimOfWorld; j++)
...@@ -476,9 +478,7 @@ namespace AMDiS { ...@@ -476,9 +478,7 @@ namespace AMDiS {
setSymmetric(symmetric); setSymmetric(symmetric);
} }
/** \brief /// Implements SecondOrderTerm::getLALt().
* Implements SecondOrderTerm::getLALt().
*/
inline void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const inline void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const
{ {
const DimVec<WorldVector<double> >& Lambda = elInfo->getGrdLambda(); const DimVec<WorldVector<double> >& Lambda = elInfo->getGrdLambda();
...@@ -486,9 +486,7 @@ namespace AMDiS { ...@@ -486,9 +486,7 @@ namespace AMDiS {
lalt(Lambda, matrix, *(LALt[iq]), symmetric, 1.0); lalt(Lambda, matrix, *(LALt[iq]), symmetric, 1.0);
} }
/** \brief /// Implenetation of SecondOrderTerm::eval().
* Implenetation of SecondOrderTerm::eval().
*/
void eval(int nPoints, void eval(int nPoints,
const double *uhAtQP, const double *uhAtQP,
const WorldVector<double> *grdUhAtQP, const WorldVector<double> *grdUhAtQP,
...@@ -496,22 +494,16 @@ namespace AMDiS { ...@@ -496,22 +494,16 @@ namespace AMDiS {
double *result, double *result,
double factor) const; double factor) const;
/** \brief /// Implenetation of SecondOrderTerm::weakEval().
* Implenetation of SecondOrderTerm::weakEval().
*/
void weakEval(int nPoints, void weakEval(int nPoints,
const WorldVector<double> *grdUhAtQP, const WorldVector<double> *grdUhAtQP,
WorldVector<double> *result) const; WorldVector<double> *result) const;
protected: protected:
/** \brief /// Matrix stroring A.
* Matrix stroring A.
*/
WorldMatrix<double> matrix; WorldMatrix<double> matrix;
/** \brief /// True, if \ref matrix is symmetric.
* True, if \ref matrix is symmetric.
*/
bool symmetric; bool symmetric;
}; };
...@@ -543,9 +535,7 @@ namespace AMDiS { ...@@ -543,9 +535,7 @@ namespace AMDiS {
setSymmetric(xi == xj); setSymmetric(xi == xj);
} }
/** \brief /// Implements SecondOrderTerm::getLALt().
* Implements SecondOrderTerm::getLALt().
*/
inline void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const inline void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const
{ {
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda(); const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
...@@ -1357,21 +1347,15 @@ namespace AMDiS { ...@@ -1357,21 +1347,15 @@ namespace AMDiS {
: OperatorTerm(deg) : OperatorTerm(deg)
{} {}
/** \brief /// Destructor.
* Destructor.
*/
virtual ~FirstOrderTerm() {} virtual ~FirstOrderTerm() {}
/** \brief /// Evaluation of \f$ \Lambda b \f$.
* Evaluation of \f$ \Lambda b \f$.
*/
virtual void getLb(const ElInfo *elInfo, virtual void getLb(const ElInfo *elInfo,
int nPoints, int nPoints,
VectorOfFixVecs<DimVec<double> >& result) const = 0; VectorOfFixVecs<DimVec<double> >& result) const = 0;
/** \brief /// Implenetation of FirstOrderTerm::eval().
* Implenetation of FirstOrderTerm::eval().
*/
void eval(int nPoints, void eval(int nPoints,
const double *, const double *,
const WorldVector<double> *grdUhAtQP, const WorldVector<double> *grdUhAtQP,
...@@ -1384,9 +1368,9 @@ namespace AMDiS { ...@@ -1384,9 +1368,9 @@ namespace AMDiS {
if (grdUhAtQP) { if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) { for (int iq = 0; iq < nPoints; iq++) {
double resultQP = 0.0; double resultQP = 0.0;
for (int i = 0; i < dow; i++) { for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i]; resultQP += grdUhAtQP[iq][i];
}
result[iq] += resultQP * factor; result[iq] += resultQP * factor;
} }
} }
...@@ -1409,9 +1393,7 @@ namespace AMDiS { ...@@ -1409,9 +1393,7 @@ namespace AMDiS {
: FirstOrderTerm(0) : FirstOrderTerm(0)
{} {}
/** \brief /// Implements FirstOrderTerm::getLb().
* Implements FirstOrderTerm::getLb().
*/
inline void getLb(const ElInfo *elInfo, inline void getLb(const ElInfo *elInfo,
int nPoints, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const VectorOfFixVecs<DimVec<double> >& Lb) const
...@@ -1491,9 +1473,7 @@ namespace AMDiS { ...@@ -1491,9 +1473,7 @@ namespace AMDiS {
lb(Lambda, b, Lb[iq], 1.0); lb(Lambda, b, Lb[iq], 1.0);
} }
/** \brief /// Implements FirstOrderTerm::eval().
* Implements FirstOrderTerm::eval().
*/
void eval(int nPoints, void eval(int nPoints,
const double *, const double *,
const WorldVector<double> *grdUhAtQP, const WorldVector<double> *grdUhAtQP,
...@@ -1502,14 +1482,12 @@ namespace AMDiS { ...@@ -1502,14 +1482,12 @@ namespace AMDiS {
double factor) const double factor) const
{ {
if (grdUhAtQP) if (grdUhAtQP)
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:
/** \brief /// 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;
}; };
...@@ -1532,7 +1510,8 @@ namespace AMDiS { ...@@ -1532,7 +1510,8 @@ namespace AMDiS {
Quadrature *quad = NULL); Quadrature *quad = NULL);
/// Implements FirstOrderTerm::getLb(). /// Implements FirstOrderTerm::getLb().
void getLb(const ElInfo *elInfo, int nPoints, VectorOfFixVecs<DimVec<double> >& Lb) const; void getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const;
/// Implements FirstOrderTerm::eval(). /// Implements FirstOrderTerm::eval().
void eval(int nPoints, void eval(int nPoints,
...@@ -2224,9 +2203,7 @@ namespace AMDiS { ...@@ -2224,9 +2203,7 @@ namespace AMDiS {
/// Implements ZeroOrderTerm::getC(). /// Implements ZeroOrderTerm::getC().
void getC(const ElInfo *, int nPoints, std::vector<double> &C) const; void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
/** \brief /// Implements ZeroOrderTerm::eval().
* Implements ZeroOrderTerm::eval().
*/
void eval(int nPoints, void eval(int nPoints,
const double *uhAtQP, const double *uhAtQP,
const WorldVector<double> *grdUhAtQP, const WorldVector<double> *grdUhAtQP,
...@@ -2235,19 +2212,13 @@ namespace AMDiS { ...@@ -2235,19 +2212,13 @@ namespace AMDiS {
double fac) const; double fac) const;
protected: protected:
/** \brief /// DOFVector to be evaluated at quadrature points.
* DOFVector to be evaluated at quadrature points.
*/
DOFVectorBase<double>* vec; DOFVectorBase<double>* vec;
/** \brief /// Vector v at quadrature points.
* Vector v at quadrature points.
*/
double *vecAtQPs; double *vecAtQPs;
/** \brief /// Function for c.
* Function for c.
*/
AbstractFunction<double, double> *f; AbstractFunction<double, double> *f;
}; };
...@@ -2266,9 +2237,7 @@ namespace AMDiS { ...@@ -2266,9 +2237,7 @@ namespace AMDiS {
AbstractFunction<double, double> *f1, AbstractFunction<double, double> *f1,
AbstractFunction<double, double> *f2); AbstractFunction<double, double> *f2);
/** \brief /// Implementation of \ref OperatorTerm::initElement().
* Implementation of \ref OperatorTerm::initElement().
*/
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler, void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
Quadrature *quad = NULL); Quadrature *quad = NULL);
......
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