SyFi  0.3
SyFi::SpaceTimeElement Class Reference

#include <SpaceTimeElement.h>

Inheritance diagram for SyFi::SpaceTimeElement:
SyFi::StandardFE SyFi::FE

List of all members.

Public Member Functions

 SpaceTimeElement ()
 SpaceTimeElement (Line *time_line_, unsigned int order_, StandardFE *fe_)
virtual ~SpaceTimeElement ()
void set_time_domain (Line *line)
void set_order_in_time (unsigned int order)
void set_spatial_element (StandardFE *fe)
virtual void compute_basis_functions ()

Private Attributes

int order
Linetime_line
StandardFEfe

Detailed Description

Definition at line 49 of file SpaceTimeElement.h.


Constructor & Destructor Documentation

Definition at line 92 of file SpaceTimeElement.cpp.

References SyFi::StandardFE::description.

                                            : StandardFE()
        {
                description = "SpaceTimeElement";
        }
SyFi::SpaceTimeElement::SpaceTimeElement ( Line time_line_,
unsigned int  order_,
StandardFE fe_ 
)

Definition at line 97 of file SpaceTimeElement.cpp.

References compute_basis_functions(), fe, order, and time_line.

        {
                time_line = time_line_;
                order = order_;
                fe = fe_;
                compute_basis_functions();
        }
virtual SyFi::SpaceTimeElement::~SpaceTimeElement ( ) [inline, virtual]

Definition at line 58 of file SpaceTimeElement.h.

{}

Member Function Documentation

Reimplemented from SyFi::StandardFE.

Definition at line 120 of file SpaceTimeElement.cpp.

References SyFi::StandardFE::description, SyFi::StandardFE::dof(), SyFi::StandardFE::dofs, fe, SyFi::StandardFE::N(), SyFi::StandardFE::nbf(), SyFi::StandardFE::Ns, order, SyFi::StandardFE::str(), SyFi::t, time_line, and SyFi::x.

Referenced by SpaceTimeElement().

        {

                // remove previously computed basis functions and dofs
                Ns.clear();
                dofs.clear();

                if ( order < 1 )
                {
                        throw(std::logic_error("The elements must be of order 1 or higher."));
                }

                if ( time_line == NULL )
                {
                        throw(std::logic_error("You need to set a time domain before the basisfunctions can be computed"));
                }

                if ( fe == NULL )
                {
                        throw(std::logic_error("You need to set a spatial element before the basisfunctions can be computed"));
                }

                StandardFE* time_element;
                if ( order == 0)
                {
                        time_element = new P0(*time_line);
                }
                else
                {
                        time_element = new Lagrange(*time_line, order);
                }

                for (unsigned int j = 0; j < fe->nbf(); j++)
                {
                        GiNaC::ex Nj = fe->N(j);
                        for (unsigned int i = 0; i < (*time_element).nbf(); i++)
                        {
                                GiNaC::ex Ni = (*time_element).N(i);
                                Ni = Ni.subs(x == t);
                                GiNaC::ex N = Nj*Ni;
                                Ns.insert(Ns.end(), N);
                                dofs.insert(dofs.end(), GiNaC::lst((*time_element).dof(i), fe->dof(j)));
                        }
                }

                description = time_element->str() + "_" +  fe->str();
                delete time_element;
        }
void SyFi::SpaceTimeElement::set_order_in_time ( unsigned int  order)

Definition at line 110 of file SpaceTimeElement.cpp.

References order.

        {
                order = order_;
        }

Definition at line 115 of file SpaceTimeElement.cpp.

References fe.

        {
                fe = fe_;
        }

Definition at line 105 of file SpaceTimeElement.cpp.

References time_line.

        {
                time_line = line_;
        }

Member Data Documentation

Reimplemented from SyFi::StandardFE.

Definition at line 51 of file SpaceTimeElement.h.

Referenced by compute_basis_functions(), set_order_in_time(), and SpaceTimeElement().


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