Skip to content
Snippets Groups Projects
Commit 0633c805 authored by Youett, Jonathan's avatar Youett, Jonathan Committed by akbib@FU-BERLIN.DE
Browse files

change return type of LocalGFETestFunction. Instead of a...

change return type of LocalGFETestFunction. Instead of a std::vector(lagrangepoints * tangentdim) it now returns a vector<arrays< ,tangentdim> >(lagrangepoints). This way it is easier to identify local coefficients with their corresponding basis functions.   

[[Imported from SVN: r7916]]
parent c806b7dd
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
#include <vector>
#include <dune/common/fvector.hh>
#include <dune/common/array.hh>
#include <dune/gfe/localgeodesicfefunction.hh>
#include <dune/gfe/tensor3.hh>
......@@ -43,11 +44,11 @@ public:
/** \brief Evaluate all shape functions at the given point */
void evaluateFunction(const Dune::FieldVector<ctype, dim>& local,
std::vector<typename TargetSpace::EmbeddedTangentVector>& out) const;
std::vector<Dune::array<typename TargetSpace::EmbeddedTangentVector,spaceDim> >& out) const;
/** \brief Evaluate the derivatives of all shape functions function */
void evaluateJacobian(const Dune::FieldVector<ctype, dim>& local,
std::vector<Dune::FieldMatrix<ctype, EmbeddedTangentVector::dimension, dim> >& out) const;
std::vector<Dune::array<Dune::FieldMatrix<ctype, EmbeddedTangentVector::dimension, dim>,spaceDim> >& out) const;
/** \brief Polynomial order */
unsigned int order() const
......@@ -65,9 +66,9 @@ private:
template <int dim, class ctype, class LocalFiniteElement, class TargetSpace>
void LocalGFETestFunction<dim,ctype,LocalFiniteElement,TargetSpace>::evaluateFunction(const Dune::FieldVector<ctype, dim>& local,
std::vector<typename TargetSpace::EmbeddedTangentVector>& out) const
std::vector<Dune::array<typename TargetSpace::EmbeddedTangentVector, spaceDim> >& out) const
{
out.resize(size() * spaceDim);
out.resize(size());
for (size_t i=0; i<size(); i++) {
......@@ -80,7 +81,7 @@ void LocalGFETestFunction<dim,ctype,LocalFiniteElement,TargetSpace>::evaluateFun
Dune::FieldMatrix<ctype,spaceDim,embeddedDim> basisVectors = localGFEFunction_.coefficients_[i].orthonormalFrame();
for (int j=0; j<spaceDim; j++)
derivative.mv(basisVectors[j], out[i*spaceDim + j]);
derivative.mv(basisVectors[j], out[i][j]);
}
......@@ -88,9 +89,9 @@ void LocalGFETestFunction<dim,ctype,LocalFiniteElement,TargetSpace>::evaluateFun
template <int dim, class ctype, class LocalFiniteElement, class TargetSpace>
void LocalGFETestFunction<dim,ctype,LocalFiniteElement,TargetSpace>::evaluateJacobian(const Dune::FieldVector<ctype, dim>& local,
std::vector<Dune::FieldMatrix<ctype, EmbeddedTangentVector::dimension, dim> >& out) const
std::vector<Dune::array<Dune::FieldMatrix<ctype, EmbeddedTangentVector::dimension, dim>,spaceDim> >& out) const
{
out.resize(size() * spaceDim);
out.resize(size());
for (size_t i=0; i<size(); i++) {
......@@ -103,14 +104,14 @@ void LocalGFETestFunction<dim,ctype,LocalFiniteElement,TargetSpace>::evaluateJac
for (int j=0; j<spaceDim; j++) {
out[i*spaceDim + j] = 0;
out[i][j] = 0;
// Contract the second index of the derivative with the tangent vector at the i-th Lagrange point.
// Add that to the result.
for (int k=0; k<embeddedDim; k++)
for (int l=0; l<embeddedDim; l++)
for (size_t m=0; m<dim; m++)
out[i*spaceDim+j][k][m] += derivative[k][l][m] * basisVectors[j][l];
out[i][j][k][m] += derivative[k][l][m] * basisVectors[j][l];
}
}
......
......@@ -4,6 +4,7 @@
#include <iostream>
#include <dune/common/fvector.hh>
#include <dune/common/array.hh>
#include <dune/localfunctions/lagrange/pqkfactory.hh>
#include <dune/gfe/rotation.hh>
......@@ -50,7 +51,7 @@ void test()
LocalGFETestFunction<domainDim,double,LocalFiniteElement,TargetSpace> testFunctionSet(feCache.get(simplex),coefficients);
FieldVector<double,domainDim> stupidTestPoint(0);
std::vector<typename TargetSpace::EmbeddedTangentVector> values;
std::vector<Dune::array<typename TargetSpace::EmbeddedTangentVector, TargetSpace::TangentVector::dimension> > values;
testFunctionSet.evaluateFunction(stupidTestPoint, values);
}
......
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