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

don't hardwire the coefficient type to be std::vector<TargetSpace>

[[Imported from SVN: r7936]]
parent 2b7551db
No related branches found
No related tags found
No related merge requests found
...@@ -13,10 +13,12 @@ ...@@ -13,10 +13,12 @@
* *
* \tparam Basis - The global basis type. * \tparam Basis - The global basis type.
* \tparam TargetSpace - The manifold that this functions takes its values in. * \tparam TargetSpace - The manifold that this functions takes its values in.
* \tparam CoefficientType - The coefficient vector type.
*/ */
template<class Basis, class TargetSpace> template<class Basis, class TargetSpace, class CoefficientType>
GlobalGeodesicFEFunction { GlobalGeodesicFEFunction {
typedef typename Basis::LocalFiniteElement LocalFiniteElement; typedef typename Basis::LocalFiniteElement LocalFiniteElement;
typedef typename Basis::GridView GridView; typedef typename Basis::GridView GridView;
typedef typename GridView::template Codim<0>::Entity Element; typedef typename GridView::template Codim<0>::Entity Element;
...@@ -34,7 +36,7 @@ GlobalGeodesicFEFunction { ...@@ -34,7 +36,7 @@ GlobalGeodesicFEFunction {
public: public:
//! Create global function by a global basis and the corresponding coefficient vector //! Create global function by a global basis and the corresponding coefficient vector
GlobalGeodesicFEFunction(const Basis& basis, const std::vector<TargetSpace>& coefficients) : GlobalGeodesicFEFunction(const Basis& basis, const CoefficientType& coefficients) :
basis_(basis), basis_(basis),
coefficients_(coefficients) coefficients_(coefficients)
{} {}
...@@ -78,6 +80,6 @@ private: ...@@ -78,6 +80,6 @@ private:
//! The global basis //! The global basis
const Basis& basis_; const Basis& basis_;
//! The coefficient vector //! The coefficient vector
const std::vector<TargetSpace>& coefficients_; const CoefficientType& coefficients_;
}; };
#endif #endif
...@@ -21,7 +21,7 @@ class LocalTestFunctionWrapper; ...@@ -21,7 +21,7 @@ class LocalTestFunctionWrapper;
* The other LocalFiniteElement methods are not wrapped/implemented by now but it shouldn't be too difficult to do so when they are * The other LocalFiniteElement methods are not wrapped/implemented by now but it shouldn't be too difficult to do so when they are
* needed. * needed.
*/ */
template <class Basis, class TargetSpace> template <class Basis, class TargetSpace, class CoefficientType>
class GlobalGFETestFunctionBasis : public FunctionSpaceBasis<typename Basis::GridView, typename TargetSpace::EmbeddedTangentVector, LocalTestFunctionWrapper<typename Basis::LocalFiniteElement, TargetSpace> > { class GlobalGFETestFunctionBasis : public FunctionSpaceBasis<typename Basis::GridView, typename TargetSpace::EmbeddedTangentVector, LocalTestFunctionWrapper<typename Basis::LocalFiniteElement, TargetSpace> > {
public: public:
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
const static int tangentDim = TargetSpace::TangentVector::dimension; const static int tangentDim = TargetSpace::TangentVector::dimension;
public: public:
GlobalGFETestFunctionBasis(const Basis& basis, std::vector<TargetSpace>& baseCoefficients) : GlobalGFETestFunctionBasis(const Basis& basis, const CoefficientType& baseCoefficients) :
Base(basis.getGridView()), Base(basis.getGridView()),
basis_(basis), basis_(basis),
baseCoefficients_(baseCoefficients), baseCoefficients_(baseCoefficients),
...@@ -89,7 +89,7 @@ private: ...@@ -89,7 +89,7 @@ private:
//! The global basis determining the weights //! The global basis determining the weights
const Basis& basis_; const Basis& basis_;
//! The coefficients of the configuration the tangent spaces are from. */ //! The coefficients of the configuration the tangent spaces are from. */
const std::vector<TargetSpace>& baseCoefficients_; const CoefficientType& baseCoefficients_;
//! Save the last local finite element - do I need to do this? //! Save the last local finite element - do I need to do this?
mutable LocalFiniteElement* lfe_; mutable LocalFiniteElement* lfe_;
}; };
......
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