Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

hp2D/neumannTrace.hh
Go to the documentation of this file.
00001 
00008 #ifndef hp2dneumanntrace_hh
00009 #define hp2dneumanntrace_hh
00010 
00011 #include "toolbox/sequence.hh"
00012 #include "integration/shapefunction.hh"
00013 #include "space/space.hh"
00014 #include "space/element.hh"
00015 #include "vectorial/vectorial.hh"
00016 #include "hp1D/element.hh"
00017 #include "hp2D/quad.hh"
00018 
00019 namespace hp2D {
00020 
00021   using concepts::Real;
00022 
00023   // forward declaration
00024   template<typename F>
00025   class Quad;
00026 
00027   // **************************************************** NeumannTraceElement **
00028 
00037   template<class F = Real>
00038   class NeumannTraceElement : public concepts::ElementWithCell<F> 
00039                             , public hp1D::IntegrableElm {
00040   public:
00041     typedef concepts::ElementAndFacette<hp2D::Element<F> > UnderlyingElement;
00042 
00043     class ShapeFunction : public concepts::ShapeFunction1D<Real> {
00044     public:
00050       ShapeFunction(const uint n, const uint nP, Real* values)
00051         : concepts::ShapeFunction1D<Real>(n, nP)
00052       {
00053         values_ = values;
00054       }
00055     protected:
00056       virtual std::ostream& info(std::ostream& os) const {
00057         return os << "NeumannTraceElement::ShapeFunction(n = " << n()
00058                   << ", nP = " << nP() << ", values = " 
00059                   << concepts::Array<Real>(values_, n()*nP()) << ')';
00060       }
00061     };
00062     
00067     NeumannTraceElement(const concepts::Edge2d& cell);
00068     virtual ~NeumannTraceElement();
00069 
00070     virtual const concepts::Edge& support() const {
00071       return cell_.connector(); }
00072     virtual concepts::Real3d vertex(uint i) const;
00073     virtual const concepts::EdgeNd& cell() const { return cell_; }
00074 
00075     virtual const vectorial::TMatrix<F>& T() const { return T_; }
00076     
00080     void recomputeShapefunctions();
00081 
00083     const concepts::ShapeFunction1D<Real>* shpfct() const { 
00084       return shpfct_.get(); }
00089     const concepts::ShapeFunction1D<Real>* shpfctD() const {
00090       throw(concepts::MissingFeature("not implemented"));
00091       return shpfctD_.get();
00092     }
00093 
00097     void addElement(const hp2D::Quad<Real>& quad, uint k,
00098                     Real weight = 1.0);
00099 
00100   protected:
00101     virtual std::ostream& info(std::ostream& os) const;
00102 
00104     vectorial::TMatrix<Real> T_;
00105   private:
00107     const concepts::Edge2d& cell_;
00108     
00109     concepts::Sequence<UnderlyingElement> uelm_;
00110 
00112     std::auto_ptr<concepts::ShapeFunction1D<Real> > shpfct_;
00114     std::auto_ptr<concepts::ShapeFunction1D<Real> > shpfctD_;
00118     concepts::Array<Real> values_, valuesD_;
00120     concepts::Sequence<uint> dim_;
00122     concepts::Sequence<uint> p_;
00124     concepts::Sequence<Real> weights_;    
00125   };
00126 
00127 } // namespace hp2D
00128 
00129 #endif // hp2dneumanntrace_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)