Commit ee371742 authored by Praetorius, Simon's avatar Praetorius, Simon

transformDOF corrected

parent 6fdea22a
......@@ -74,10 +74,10 @@ struct Mult2 : public BinaryAbstractFunction<T1,T2,T3>
};
template<typename T>
struct MultScal : public AbstractFunction<T,T>
struct MultScal : public BinaryAbstractFunction<T,T,T>
{
MultScal(T scal_) : scal(scal_) {}
T operator()(const T &v) const { return v*scal; }
T operator()(const T &v1, const T &v2) const { return v1*v2*scal; }
private:
T scal;
};
......
......@@ -79,7 +79,7 @@ inline void transformDOF_extended(DOFVector<T1> *vec, DOFVector<T2> *result, Abs
vec->getLocalVector(el, vecLocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords = vecBasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*op)(vecBasisFcts->evalUh(*coords, vecLocalCoeffs));
}
elInfo = stack.traverseNext(elInfo);
......@@ -167,7 +167,7 @@ inline void transformDOF_extended(DOFVector<T1> *vec1, DOFVector<T2> *vec2, DOFV
mtl::dense_vector<T1> vec1LocalCoeffs(nVec1BasisFcts);
mtl::dense_vector<T2> vec2LocalCoeffs(nVec2BasisFcts);
DimVec<double> *coords1 = NULL, *coords2 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -181,11 +181,10 @@ inline void transformDOF_extended(DOFVector<T1> *vec1, DOFVector<T2> *vec2, DOFV
vec2->getLocalVector(el, vec2LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec1BasisFcts->getCoords(i);
coords2 = vec2BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*binary_op)(
vec1BasisFcts->evalUh(*coords1, vec1LocalCoeffs),
vec2BasisFcts->evalUh(*coords2, vec2LocalCoeffs)
vec1BasisFcts->evalUh(*coords, vec1LocalCoeffs),
vec2BasisFcts->evalUh(*coords, vec2LocalCoeffs)
);
}
elInfo = stack.traverseNext(elInfo);
......@@ -254,7 +253,7 @@ inline void transformDOF_extended(DOFVector<T1> *vec1, const T2 val, DOFVector<T
std::vector<DegreeOfFreedom> resLocalIndices(nResBasisFcts);
ElementVector vec1LocalCoeffs(nVec1BasisFcts);
DimVec<double> *coords1 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -267,9 +266,9 @@ inline void transformDOF_extended(DOFVector<T1> *vec1, const T2 val, DOFVector<T
vec1->getLocalVector(el, vec1LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec1BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*binary_op)(
vec1BasisFcts->evalUh(*coords1, vec1LocalCoeffs),
vec1BasisFcts->evalUh(*coords, vec1LocalCoeffs),
val
);
}
......@@ -338,7 +337,7 @@ inline void transformDOF_extended(const T1 val, DOFVector<T2> *vec1, DOFVector<T
std::vector<DegreeOfFreedom> resLocalIndices(nResBasisFcts);
ElementVector vec1LocalCoeffs(nVec1BasisFcts);
DimVec<double> *coords1 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -351,10 +350,10 @@ inline void transformDOF_extended(const T1 val, DOFVector<T2> *vec1, DOFVector<T
vec1->getLocalVector(el, vec1LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec1BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*binary_op)(
val,
vec1BasisFcts->evalUh(*coords1, vec1LocalCoeffs)
vec1BasisFcts->evalUh(*coords, vec1LocalCoeffs)
);
}
elInfo = stack.traverseNext(elInfo);
......@@ -433,11 +432,11 @@ inline void transformDOF_extended(DOFVector<T1> *vec1, DOFVector<T2> *vec2, DOFV
int nResBasisFcts = resBasisFcts->getNumber();
std::vector<DegreeOfFreedom> resLocalIndices(nResBasisFcts);
ElementVector vec1LocalCoeffs(nVec1BasisFcts);
ElementVector vec2LocalCoeffs(nVec2BasisFcts);
ElementVector vec3LocalCoeffs(nVec3BasisFcts);
mtl::dense_vector<T1> vec1LocalCoeffs(nVec1BasisFcts);
mtl::dense_vector<T2> vec2LocalCoeffs(nVec2BasisFcts);
mtl::dense_vector<T3> vec3LocalCoeffs(nVec3BasisFcts);
DimVec<double> *coords1 = NULL, *coords2 = NULL, *coords3 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -452,13 +451,11 @@ inline void transformDOF_extended(DOFVector<T1> *vec1, DOFVector<T2> *vec2, DOFV
vec3->getLocalVector(el, vec3LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec1BasisFcts->getCoords(i);
coords2 = vec2BasisFcts->getCoords(i);
coords3 = vec3BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*tertiary_op)(
vec1BasisFcts->evalUh(*coords1, vec1LocalCoeffs),
vec2BasisFcts->evalUh(*coords2, vec2LocalCoeffs),
vec3BasisFcts->evalUh(*coords3, vec3LocalCoeffs)
vec1BasisFcts->evalUh(*coords, vec1LocalCoeffs),
vec2BasisFcts->evalUh(*coords, vec2LocalCoeffs),
vec3BasisFcts->evalUh(*coords, vec3LocalCoeffs)
);
}
elInfo = stack.traverseNext(elInfo);
......@@ -520,7 +517,7 @@ inline void transformDOF(DOFVector<T1> *vec1, DOFVector<T2> *vec2, T3 val, DOFVe
ElementVector vec1LocalCoeffs(nVec1BasisFcts);
ElementVector vec2LocalCoeffs(nVec2BasisFcts);
DimVec<double> *coords1 = NULL, *coords2 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -534,11 +531,10 @@ inline void transformDOF(DOFVector<T1> *vec1, DOFVector<T2> *vec2, T3 val, DOFVe
vec2->getLocalVector(el, vec2LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec1BasisFcts->getCoords(i);
coords2 = vec2BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*tertiary_op)(
vec1BasisFcts->evalUh(*coords1, vec1LocalCoeffs),
vec2BasisFcts->evalUh(*coords2, vec2LocalCoeffs),
vec1BasisFcts->evalUh(*coords, vec1LocalCoeffs),
vec2BasisFcts->evalUh(*coords, vec2LocalCoeffs),
val
);
}
......@@ -585,7 +581,7 @@ inline void transformDOF(DOFVector<T1> *vec1, T2 val, DOFVector<T2> *vec3, DOFVe
ElementVector vec1LocalCoeffs(nVec1BasisFcts);
ElementVector vec3LocalCoeffs(nVec3BasisFcts);
DimVec<double> *coords1 = NULL, *coords2 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -599,12 +595,11 @@ inline void transformDOF(DOFVector<T1> *vec1, T2 val, DOFVector<T2> *vec3, DOFVe
vec3->getLocalVector(el, vec3LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec1BasisFcts->getCoords(i);
coords2 = vec3BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*tertiary_op)(
vec1BasisFcts->evalUh(*coords1, vec1LocalCoeffs),
vec1BasisFcts->evalUh(*coords, vec1LocalCoeffs),
val,
vec3BasisFcts->evalUh(*coords2, vec3LocalCoeffs)
vec3BasisFcts->evalUh(*coords, vec3LocalCoeffs)
);
}
elInfo = stack.traverseNext(elInfo);
......@@ -650,7 +645,7 @@ inline void transformDOF(T1 val, DOFVector<T2> *vec2, DOFVector<T2> *vec3, DOFVe
ElementVector vec2LocalCoeffs(nVec2BasisFcts);
ElementVector vec3LocalCoeffs(nVec3BasisFcts);
DimVec<double> *coords1 = NULL, *coords2 = NULL;
DimVec<double> *coords = NULL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(resFeSpace->getMesh(), -1,
Mesh::CALL_LEAF_EL |
......@@ -664,12 +659,11 @@ inline void transformDOF(T1 val, DOFVector<T2> *vec2, DOFVector<T2> *vec3, DOFVe
vec3->getLocalVector(el, vec3LocalCoeffs);
for (int i = 0; i < nResBasisFcts; i++) {
coords1 = vec2BasisFcts->getCoords(i);
coords2 = vec3BasisFcts->getCoords(i);
coords = resBasisFcts->getCoords(i);
(*res)[resLocalIndices[i]] = (*tertiary_op)(
val,
vec2BasisFcts->evalUh(*coords1, vec2LocalCoeffs),
vec3BasisFcts->evalUh(*coords2, vec3LocalCoeffs)
vec2BasisFcts->evalUh(*coords, vec2LocalCoeffs),
vec3BasisFcts->evalUh(*coords, vec3LocalCoeffs)
);
}
elInfo = stack.traverseNext(elInfo);
......
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