Commit 808eac8e by Thomas Witkowski

Merge with Simons branch AMDiS_generic.

parent e43e8013
 ... ... @@ -37,75 +37,12 @@ namespace AMDiS { dow = Global::getGeo(WORLD); } BasisFunction::~BasisFunction() { delete nDOF; } /****************************************************************************/ /* some routines for evaluation of a finite element function, its gradient */ /* and second derivatives; all those with _fast use the preevaluated */ /* basis functions at that point. */ /****************************************************************************/ double BasisFunction::evalUh(const DimVec& lambda, const ElementVector& uh_loc) const { double val = 0.0; for (int i = 0; i < nBasFcts; i++) val += uh_loc[i] * (*(*phi)[i])(lambda); return(val); } const WorldVector& BasisFunction::evalUh(const DimVec& lambda, const mtl::dense_vector >& uh_loc, WorldVector* values) const { static WorldVector Values(DEFAULT_VALUE, 0.0); WorldVector *val = (NULL != values) ? values : &Values; for (int n = 0; n < dow; n++) (*val)[n] = 0.0; for (int i = 0; i < nBasFcts; i++) { double phil = (*(*phi)[i])(lambda); for (int n = 0; n < dow; n++) (*val)[n] += uh_loc[i][n] * phil; } return((*val)); } const WorldVector& BasisFunction::evalGrdUh(const DimVec& lambda, const DimVec >& grd_lambda, const ElementVector& uh_loc, WorldVector* val) const { TEST_EXIT_DBG(val)("Return value is NULL\n"); mtl::dense_vector grdTmp1(dim + 1); mtl::dense_vector grdTmp2(dim + 1, 0.0); for (int i = 0; i < nBasFcts; i++) { (*(*grdPhi)[i])(lambda, grdTmp1); for (int j = 0; j < dim + 1; j++) grdTmp2[j] += uh_loc[i] * grdTmp1[j]; } for (int i = 0; i < dow; i++) { (*val)[i] = 0.0; for (int j = 0; j < dim + 1; j++) (*val)[i] += grd_lambda[j][i] * grdTmp2[j]; } return ((*val)); } const WorldMatrix& BasisFunction::evalD2Uh(const DimVec& lambda, const DimVec >& grd_lambda, ... ...
 ... ... @@ -28,6 +28,7 @@ #include "Global.h" #include "Boundary.h" #include "MatrixVector.h" #include "FixVec.h" namespace AMDiS { ... ... @@ -311,17 +312,9 @@ namespace AMDiS { * Evaluates elements value at barycentric coordinates lambda with local * coefficient vector uh. */ double evalUh(const DimVec& lambda, const ElementVector& uh) const; template T evalUh(const DimVec& lambda, const mtl::dense_vector& uh) const; /** \brief * Evaluates elements value at barycentric coordinates lambda with local * coefficient vector uh. If val is not NULL the result will be stored * there, otherwise a pointer to a static local variable is returned which * will be overwritten after the next call. */ const WorldVector& evalUh(const DimVec& lambda, const mtl::dense_vector >& uh, WorldVector* val) const; /** \brief * Evaluates the gradient at barycentric coordinates lambda. Lambda is the ... ... @@ -330,10 +323,12 @@ namespace AMDiS { * there, otherwise a pointer to a static local variable is returned which * will be overwritten after the next call. */ const WorldVector& evalGrdUh(const DimVec& lambda, const DimVec >& Lambda, const ElementVector& uh, WorldVector* val) const; template typename GradientType::type& evalGrdUh(const DimVec& lambda, const DimVec >& Lambda, const mtl::dense_vector& uh, typename GradientType::type& val) const; /** \brief * Evaluates the second derivative at barycentric coordinates lambda. ... ... @@ -377,5 +372,6 @@ namespace AMDiS { }; } #include "BasisFunction.hh" #endif // AMDIS_BASISFUNCTION_H