Commit a231ee10 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Generic Operators corrected

parent ced7e4c9
...@@ -124,8 +124,8 @@ namespace result_of { ...@@ -124,8 +124,8 @@ namespace result_of {
typedef T value_type; typedef T value_type;
DOFVector<T>* vecDV; DOFVector<T>* vecDV;
// mutable mtl::dense_vector<typename GradientType<T>::type> vec; mutable mtl::dense_vector<typename GradientType<T>::type> vec;
mutable mtl::dense_vector<T> vec; // mutable mtl::dense_vector<T> vec;
mutable mtl::dense_vector<T> coeff; mutable mtl::dense_vector<T> coeff;
int comp; int comp;
...@@ -158,16 +158,11 @@ namespace result_of { ...@@ -158,16 +158,11 @@ namespace result_of {
void initElement(OT* ot, const ElInfo* elInfo, void initElement(OT* ot, const ElInfo* elInfo,
SubAssembler* subAssembler, Quadrature *quad, SubAssembler* subAssembler, Quadrature *quad,
const BasisFunction *basisFct = NULL) const BasisFunction *basisFct = NULL)
{ {
// if (op && subAssembler)
// ot->getGradientsAtQPs(vecDV, elInfo, subAssembler, quad, vec);
// else
// vecDV->getGrdAtQPs(elInfo, localQuad, NULL, vec);
if (ot && subAssembler) if (ot && subAssembler)
subAssembler->getDerivativeAtQPs(vecDV, elInfo, quad, comp, vec); ot->getGradientsAtQPs(vecDV, elInfo, subAssembler, quad, vec); //subAssembler->getDerivativeAtQPs(vecDV, elInfo, quad, comp, vec);
else if (quad) else if (quad)
vecDV->getDerivativeAtQPs(elInfo, quad, NULL, comp, vec); vecDV->getGrdAtQPs(elInfo, quad, NULL, vec); //vecDV->getDerivativeAtQPs(elInfo, quad, NULL, comp, vec);
else if (basisFct) { else if (basisFct) {
const BasisFunction *localBasisFct = vecDV->getFeSpace()->getBasisFcts(); const BasisFunction *localBasisFct = vecDV->getFeSpace()->getBasisFcts();
...@@ -177,15 +172,15 @@ namespace result_of { ...@@ -177,15 +172,15 @@ namespace result_of {
// eval basisfunctions of DOFVector at coords of given basisFct // eval basisfunctions of DOFVector at coords of given basisFct
size_t nBasisFct = basisFct->getNumber(); size_t nBasisFct = basisFct->getNumber();
mtl::dense_vector<typename GradientType<T>::type> helper(nBasisFct); // mtl::dense_vector<typename GradientType<T>::type> helper(nBasisFct);
const DimVec<WorldVector<double> > &grdLambda = elInfo->getGrdLambda(); const DimVec<WorldVector<double> > &grdLambda = elInfo->getGrdLambda();
vec.change_dim(nBasisFct);
for (size_t i = 0; i < nBasisFct; i++) for (size_t i = 0; i < nBasisFct; i++)
localBasisFct->evalGrdUh(*basisFct->getCoords(i), grdLambda, coeff, helper[i]); localBasisFct->evalGrdUh(*basisFct->getCoords(i), grdLambda, coeff, vec[i]); //helper[i]);
vec.change_dim(nBasisFct); // for (size_t i = 0; i < num_rows(helper); i++)
for (size_t i = 0; i < num_rows(helper); i++) // vec[i] = helper[i][comp];
vec[i] = helper[i][comp];
} }
} }
...@@ -201,9 +196,9 @@ namespace result_of { ...@@ -201,9 +196,9 @@ namespace result_of {
// vecDV->getGrdAtQPs(smallElInfo, largeElInfo, localQuad, NULL, vec); // vecDV->getGrdAtQPs(smallElInfo, largeElInfo, localQuad, NULL, vec);
if (ot && subAssembler) if (ot && subAssembler)
subAssembler->getDerivativeAtQPs(vecDV, smallElInfo, largeElInfo, quad, comp, vec); ot->getGradientsAtQPs(vecDV, smallElInfo, largeElInfo, subAssembler, quad, vec); //subAssembler->getDerivativeAtQPs(vecDV, smallElInfo, largeElInfo, quad, comp, vec);
else if (quad) else if (quad)
vecDV->getDerivativeAtQPs(smallElInfo, largeElInfo, quad, NULL, comp, vec); vecDV->getGrdAtQPs(smallElInfo, largeElInfo, quad, NULL, vec); // vecDV->getDerivativeAtQPs(smallElInfo, largeElInfo, quad, NULL, comp, vec);
else if (basisFct) { else if (basisFct) {
const BasisFunction *localBasisFct = vecDV->getFeSpace()->getBasisFcts(); const BasisFunction *localBasisFct = vecDV->getFeSpace()->getBasisFcts();
...@@ -213,20 +208,20 @@ namespace result_of { ...@@ -213,20 +208,20 @@ namespace result_of {
// eval basisfunctions of DOFVector at coords of given basisFct // eval basisfunctions of DOFVector at coords of given basisFct
size_t nBasisFct = basisFct->getNumber(); size_t nBasisFct = basisFct->getNumber();
mtl::dense_vector<typename GradientType<T>::type> helper(nBasisFct); // mtl::dense_vector<typename GradientType<T>::type> helper(nBasisFct);
const DimVec<WorldVector<double> > &grdLambda = smallElInfo->getGrdLambda(); const DimVec<WorldVector<double> > &grdLambda = smallElInfo->getGrdLambda();
vec.change_dim(nBasisFct);
for (size_t i = 0; i < nBasisFct; i++) for (size_t i = 0; i < nBasisFct; i++)
localBasisFct->evalGrdUh(*basisFct->getCoords(i), grdLambda, coeff, helper[i]); localBasisFct->evalGrdUh(*basisFct->getCoords(i), grdLambda, coeff, vec[i]); //helper[i]);
vec.change_dim(nBasisFct); // for (size_t i = 0; i < num_rows(helper); i++)
for (size_t i = 0; i < num_rows(helper); i++) // vec[i] = helper[i][comp];
vec[i] = helper[i][comp];
} }
} }
// value_type operator()(const int& iq) const { return vec[iq][comp]; } value_type operator()(const int& iq) const { return vec[iq][comp]; }
value_type operator()(const int& iq) const { return vec[iq]; } // value_type operator()(const int& iq) const { return vec[iq]; }
}; };
} // end namespace result_of } // end namespace result_of
......
...@@ -159,7 +159,7 @@ namespace result_of { ...@@ -159,7 +159,7 @@ namespace result_of {
// get coefficients of DOFVector // get coefficients of DOFVector
coeff[i].change_dim(localBasisFct->getNumber()); coeff[i].change_dim(localBasisFct->getNumber());
vecDV[i]->getLocalVector(elInfo->getElement(), coeff); vecDV[i]->getLocalVector(elInfo->getElement(), coeff[i]);
// eval basisfunctions of DOFVector at coords of given basisFct // eval basisfunctions of DOFVector at coords of given basisFct
size_t nBasisFct = basisFct->getNumber(); size_t nBasisFct = basisFct->getNumber();
...@@ -194,7 +194,7 @@ namespace result_of { ...@@ -194,7 +194,7 @@ namespace result_of {
// get coefficients of DOFVector // get coefficients of DOFVector
coeff[i].change_dim(localBasisFct->getNumber()); coeff[i].change_dim(localBasisFct->getNumber());
vecDV[i]->getLocalVector(smallElInfo->getElement(), coeff); vecDV[i]->getLocalVector(smallElInfo->getElement(), coeff[i]);
// eval basisfunctions of DOFVector at coords of given basisFct // eval basisfunctions of DOFVector at coords of given basisFct
size_t nBasisFct = basisFct->getNumber(); size_t nBasisFct = basisFct->getNumber();
......
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