SyFi  0.3
SyFi::MixedFE Class Reference

#include <MixedFE.h>

Inheritance diagram for SyFi::MixedFE:
SyFi::FE

List of all members.

Public Member Functions

 MixedFE ()
 MixedFE (StandardFE *fe1, StandardFE *fe2)
virtual ~MixedFE ()
virtual void set_polygon (Polygon &p)
virtual Polygonget_polygon ()
virtual void compute_basis_functions ()
StandardFEget (unsigned int i)
void append (StandardFE *fe)
virtual GiNaC::ex N (unsigned int i)
virtual GiNaC::ex dof (unsigned int i)
virtual unsigned int nbf () const
virtual std::string str ()

Public Attributes

std::vector< StandardFE * > mfe

Private Attributes

std::string description

Detailed Description

Definition at line 38 of file MixedFE.h.


Constructor & Destructor Documentation

Definition at line 25 of file MixedFE.cpp.

References description.

                         : FE()
        {
                description = "MixedFE";
        }

Definition at line 30 of file MixedFE.cpp.

References description, mfe, and SyFi::StandardFE::str().

                                                         : FE()
        {
                mfe.push_back(fe1);
                mfe.push_back(fe2);
                description = "MixedFE_" + fe1->str() + "_" +  fe2->str();
        }
SyFi::MixedFE::~MixedFE ( ) [virtual]

Definition at line 37 of file MixedFE.cpp.

References mfe.

        {
                mfe.clear();
        }

Member Function Documentation

Definition at line 51 of file MixedFE.cpp.

References description, mfe, and SyFi::StandardFE::str().

        {
                mfe.push_back(fe);
                description = description + "_" + fe->str();
        }
virtual void SyFi::MixedFE::compute_basis_functions ( ) [inline, virtual]

Implements SyFi::FE.

Definition at line 58 of file MixedFE.h.

{ }
GiNaC::ex SyFi::MixedFE::dof ( unsigned int  i) [virtual]

Implements SyFi::FE.

Definition at line 86 of file MixedFE.cpp.

References mfe, and nbf().

        {

                if ( i < 0 || i > nbf()-1)
                {
                        throw(std::out_of_range("The index is out of range!"));
                }

                bool found = false;
                unsigned int e = 0;
                unsigned int tmp_nbf = (*mfe[0]).nbf() ;
                unsigned int tmp_i = i;

                while ( e < mfe.size() && !found)
                {
                        if ( tmp_i < tmp_nbf)
                        {
                                found = true;
                        }
                        else
                        {
                                tmp_i -= (*mfe[e]).nbf();
                                e++;
                        }
                }
                return (*mfe[e]).dof(tmp_i);
        }
StandardFE * SyFi::MixedFE::get ( unsigned int  i)

Definition at line 42 of file MixedFE.cpp.

References mfe.

        {
                if ( i < 0 || i > mfe.size())
                {
                        throw(std::out_of_range("The index is out of range!"));
                }
                return mfe[i];
        }
virtual Polygon& SyFi::MixedFE::get_polygon ( ) [inline, virtual]

Implements SyFi::FE.

Definition at line 54 of file MixedFE.h.

References mfe.

                        {
                                return (*(mfe[0])).get_polygon();
                        }
GiNaC::ex SyFi::MixedFE::N ( unsigned int  i) [virtual]

Implements SyFi::FE.

Definition at line 57 of file MixedFE.cpp.

References mfe, and nbf().

        {

                if ( i < 0 || i > nbf()-1)
                {
                        throw(std::out_of_range("The index is out of range!"));
                }

                bool found = false;
                unsigned int e = 0;
                unsigned int tmp_nbf = (*mfe[0]).nbf() ;
                unsigned int tmp_i = i;

                while ( e < mfe.size() && !found)
                {
                        tmp_nbf = (*mfe[0]).nbf() ;
                        if ( tmp_i < tmp_nbf )
                        {
                                found = true;
                        }
                        else
                        {
                                tmp_i -= (*mfe[e]).nbf();
                                e++;
                        }
                }
                return (*mfe[e]).N(tmp_i);
        }
unsigned int SyFi::MixedFE::nbf ( ) const [virtual]

Implements SyFi::FE.

Definition at line 114 of file MixedFE.cpp.

References mfe.

Referenced by dof(), and N().

        {
                int sum = 0;
                for (unsigned int i=0; i< mfe.size(); i++)
                {
                        sum += (*mfe[i]).nbf();
                }
                return sum;
        }
virtual void SyFi::MixedFE::set_polygon ( Polygon p) [inline, virtual]

Implements SyFi::FE.

Definition at line 50 of file MixedFE.h.

                        {
                        }
std::string SyFi::MixedFE::str ( ) [virtual]

Implements SyFi::FE.

Definition at line 124 of file MixedFE.cpp.

References description.

        {
                return description;
        }

Member Data Documentation

std::string SyFi::MixedFE::description [private]

Definition at line 40 of file MixedFE.h.

Referenced by append(), MixedFE(), and str().

Definition at line 42 of file MixedFE.h.

Referenced by append(), dof(), get(), get_polygon(), MixedFE(), N(), nbf(), and ~MixedFE().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator