Skip to content
Snippets Groups Projects
Commit 53896f23 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

last bugfix extended to all dimensions

[[Imported from SVN: r4068]]
parent 5089df9f
No related branches found
No related tags found
No related merge requests found
...@@ -191,14 +191,18 @@ template <int dim, class ctype, class TargetSpace> ...@@ -191,14 +191,18 @@ template <int dim, class ctype, class TargetSpace>
TargetSpace LocalGeodesicFEFunction<dim,ctype,TargetSpace>:: TargetSpace LocalGeodesicFEFunction<dim,ctype,TargetSpace>::
evaluate(const Dune::FieldVector<ctype, dim>& local) evaluate(const Dune::FieldVector<ctype, dim>& local)
{ {
assert(dim==2); ctype extraCoord = 1;
ctype extraCoord = 1-local[0]-local[1]; for (int i=0; i<dim; i++)
ctype factor = extraCoord+local[0]; extraCoord -= local[i];
TargetSpace result = TargetSpace::interpolate(coefficients_[0], coefficients_[1], local[0]/factor); ctype normalizingFactor = extraCoord+local[0];
for (int i=1; i<dim; i++) TargetSpace result = TargetSpace::interpolate(coefficients_[0], coefficients_[1], local[0]/normalizingFactor);
result = TargetSpace::interpolate(result, coefficients_[i+1], local[i]);
for (int i=1; i<dim; i++) {
normalizingFactor += local[i];
result = TargetSpace::interpolate(result, coefficients_[i+1], local[i] / normalizingFactor);
}
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment