SyFi  0.3
SyFi::Dof Class Reference

#include <Dof.h>

List of all members.

Public Member Functions

 Dof (bool create_glob2dof=false, bool create_glob2loc=false)
 ~Dof ()
void clear ()
unsigned int insert_dof (unsigned int e, unsigned int i, GiNaC::ex Li)
unsigned int size () const
unsigned int num_elements () const
unsigned int max_dofs_per_element () const
unsigned int glob_dof (unsigned int e, unsigned int i)
unsigned int glob_dof (GiNaC::ex Lj)
GiNaC::ex glob_dof (unsigned int j)
vector_ii glob2loc (unsigned int j)
def __init__
def clear
def insert_dof
def size
def num_elements
def max_dofs_per_element
def glob_dof
def glob2loc

Static Public Attributes

tuple thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

Protected Attributes

unsigned int counter
unsigned int emax
unsigned int imax
std::map< std::pair< unsigned
int, unsigned int >, unsigned
int > 
loc2glob
bool create_glob2loc
std::map< unsigned int, vector_iiglob2loc_map
std::map< GiNaC::ex, unsigned
int, GiNaC::ex_is_less > 
dof2glob
bool create_glob2dof
std::map< unsigned int, GiNaC::ex > glob2dof

Static Private Attributes

 __repr__ = _swig_repr
 __swig_destroy__ = _SyFi.delete_Dof

Detailed Description

Proxy of C++ SyFi::Dof class

Definition at line 35 of file Dof.h.


Constructor & Destructor Documentation

SyFi::Dof::Dof ( bool  create_glob2dof = false,
bool  create_glob2loc = false 
) [inline]

Definition at line 65 of file Dof.h.

SyFi::Dof::~Dof ( ) [inline]

Definition at line 74 of file Dof.h.

{}
def SyFi::Dof::__init__ (   self,
  create_glob2dof = False,
  create_glob2loc = False 
)
__init__(SyFi::Dof self, bool create_glob2dof=False, bool create_glob2loc=False) -> Dof
__init__(SyFi::Dof self, bool create_glob2dof=False) -> Dof
__init__(SyFi::Dof self) -> Dof

Definition at line 2479 of file SyFi.py.

02479 
02480     def __init__(self, create_glob2dof=False, create_glob2loc=False):
02481         """
02482         __init__(SyFi::Dof self, bool create_glob2dof=False, bool create_glob2loc=False) -> Dof
02483         __init__(SyFi::Dof self, bool create_glob2dof=False) -> Dof
02484         __init__(SyFi::Dof self) -> Dof
02485         """
        _SyFi.Dof_swiginit(self,_SyFi.new_Dof(create_glob2dof, create_glob2loc))

Member Function Documentation

void SyFi::Dof::clear ( )

Definition at line 25 of file Dof.cpp.

Referenced by clear().

        {
                counter = 0;
                emax = 0;
                imax = 0;

                loc2glob.clear();
                dof2glob.clear();
                glob2dof.clear();
                glob2loc_map.clear();
        }
def SyFi::Dof::clear (   self)
clear(Dof self)

Definition at line 2488 of file SyFi.py.

References clear().

02488 
02489     def clear(self):
02490         """clear(Dof self)"""
02491         return _SyFi.Dof_clear(self)
02492 

vector_ii SyFi::Dof::glob2loc ( unsigned int  j)

Definition at line 138 of file Dof.cpp.

Referenced by glob2loc(), and main().

        {
                if ( !create_glob2loc )
                {
                        throw std::runtime_error("This structure has not been created, you must turn on the create_glob2loc flag before initialization!");
                }

                return glob2loc_map[j];
        }
def SyFi::Dof::glob2loc (   self,
  j 
)
glob2loc(Dof self, unsigned int j) -> SyFi::vector_ii

Definition at line 2522 of file SyFi.py.

References glob2loc(), and SyFi.new_instancemethod.

02522 
02523     def glob2loc(self, j):
02524         """glob2loc(Dof self, unsigned int j) -> SyFi::vector_ii"""
02525         return _SyFi.Dof_glob2loc(self, j)
02526 
02527 Dof.clear = new_instancemethod(_SyFi.Dof_clear, None, Dof)
02528 Dof.insert_dof = new_instancemethod(_SyFi.Dof_insert_dof, None, Dof)
02529 Dof.size = new_instancemethod(_SyFi.Dof_size, None, Dof)
02530 Dof.num_elements = new_instancemethod(_SyFi.Dof_num_elements, None, Dof)
02531 Dof.max_dofs_per_element = new_instancemethod(_SyFi.Dof_max_dofs_per_element, None, Dof)
02532 Dof.glob_dof = new_instancemethod(_SyFi.Dof_glob_dof, None, Dof)
Dof.glob2loc = new_instancemethod(_SyFi.Dof_glob2loc, None, Dof)
unsigned int SyFi::Dof::glob_dof ( unsigned int  e,
unsigned int  i 
)

Definition at line 92 of file Dof.cpp.

References run_all::res.

Referenced by SyFi::compute_mixed_Poisson_element_matrix(), compute_nlconvdiff_element_matrix(), compute_Poisson_element_matrix(), SyFi::compute_Poisson_element_matrix(), SyFi::compute_Stokes_element_matrix(), glob_dof(), and main().

        {
                pair_ii index(e, i);
                std::map<pair_ii, unsigned int >::iterator res = loc2glob.find(index);

                if ( res == loc2glob.end() )
                {
                        //throw std::runtime_error("In glob_dof(e,i): Not found");
                        return -1;
                }

                return res->second;
        }
unsigned int SyFi::Dof::glob_dof ( GiNaC::ex  Lj)

Definition at line 106 of file Dof.cpp.

References run_all::res.

        {
                std::map<GiNaC::ex, unsigned int, GiNaC::ex_is_less>::iterator res = dof2glob.find(Lj);

                if ( res == dof2glob.end() )
                {
                        //throw std::runtime_error("In glob_dof(Lj): Not found");
                        return -1;
                }

                return res->second;
        }
GiNaC::ex SyFi::Dof::glob_dof ( unsigned int  j)

Definition at line 119 of file Dof.cpp.

        {
                if ( !create_glob2dof )
                {
                        throw std::runtime_error("This structure has not been created, you must turn on the create_glob2dof flag before initialization!");
                }

                std::map<unsigned int, GiNaC::ex>::iterator iter = glob2dof.find(j);

                if ( iter == glob2dof.end() )
                {
                        //throw std::runtime_error("In glob_dof(j): Not found");
                        std::cerr << "In glob_dof(j): Not found" << std::endl;
                        return GiNaC::ex();
                }

                return iter->second;
        }
def SyFi::Dof::glob_dof (   self,
  args 
)
glob_dof(Dof self, unsigned int e, unsigned int i) -> unsigned int
glob_dof(Dof self, GiNaC::ex Lj) -> unsigned int
glob_dof(Dof self, unsigned int j) -> GiNaC::ex

Definition at line 2513 of file SyFi.py.

References glob_dof().

02513 
02514     def glob_dof(self, *args):
02515         """
02516         glob_dof(Dof self, unsigned int e, unsigned int i) -> unsigned int
02517         glob_dof(Dof self, GiNaC::ex Lj) -> unsigned int
02518         glob_dof(Dof self, unsigned int j) -> GiNaC::ex
02519         """
02520         return _SyFi.Dof_glob_dof(self, *args)
02521 

unsigned int SyFi::Dof::insert_dof ( unsigned int  e,
unsigned int  i,
GiNaC::ex  Li 
)

Definition at line 37 of file Dof.cpp.

References SyFi::p.

Referenced by SyFi::compute_mixed_Poisson_element_matrix(), compute_nlconvdiff_element_matrix(), compute_Poisson_element_matrix(), SyFi::compute_Poisson_element_matrix(), SyFi::compute_Stokes_element_matrix(), insert_dof(), and main().

        {
                if (e > emax) emax = e;
                if (i > imax) imax = i;

                unsigned int return_dof;

                // check if the dof is new, if so
                // update counter, dof2glob and create
                // a new vector in glob2loc_map

                std::map< GiNaC::ex, unsigned int, GiNaC::ex_is_less >::iterator index_iter = dof2glob.find(Li);

                if( index_iter == dof2glob.end() )
                {
                        // define a new dof
                        return_dof = counter;

                        // count inserted global indices
                        counter++;

                        // the central "D -> global index" map
                        dof2glob[Li] = return_dof;

                        if ( create_glob2dof )
                        {
                                std::pair<unsigned int, GiNaC::ex> p(return_dof, Li);
                                glob2dof.insert(p);
                        }

                        if ( create_glob2loc )
                        {
                                // initialize with empty vector
                                glob2loc_map[return_dof] = vector_ii();
                                glob2loc_map[return_dof].reserve(imax);
                        }
                }
                else                                     // dof is not new
                {
                        return_dof = index_iter->second;
                }

                // loc2glob should always be updated
                pair_ii index(e, i);
                loc2glob[index] = return_dof;

                // insert (e,i) in glob2loc_map[Li]
                if ( create_glob2loc )
                {
                        glob2loc_map[return_dof].push_back(index);
                }

                return return_dof;
        }
def SyFi::Dof::insert_dof (   self,
  e,
  i,
  Li 
)
insert_dof(Dof self, unsigned int e, unsigned int i, GiNaC::ex Li) -> unsigned int

Definition at line 2493 of file SyFi.py.

References insert_dof().

02493 
02494     def insert_dof(self, e, i, Li):
02495         """insert_dof(Dof self, unsigned int e, unsigned int i, GiNaC::ex Li) -> unsigned int"""
02496         return _SyFi.Dof_insert_dof(self, e, i, Li)
02497 

unsigned int SyFi::Dof::max_dofs_per_element ( ) const [inline]

Definition at line 93 of file Dof.h.

References imax.

Referenced by max_dofs_per_element().

                                { return imax+1; }
max_dofs_per_element(Dof self) -> unsigned int

Definition at line 2508 of file SyFi.py.

References max_dofs_per_element().

02508 
02509     def max_dofs_per_element(self):
02510         """max_dofs_per_element(Dof self) -> unsigned int"""
02511         return _SyFi.Dof_max_dofs_per_element(self)
02512 

unsigned int SyFi::Dof::num_elements ( ) const [inline]

Definition at line 89 of file Dof.h.

References emax.

Referenced by num_elements().

                                { return emax+1; }
def SyFi::Dof::num_elements (   self)
num_elements(Dof self) -> unsigned int

Definition at line 2503 of file SyFi.py.

References num_elements().

02503 
02504     def num_elements(self):
02505         """num_elements(Dof self) -> unsigned int"""
02506         return _SyFi.Dof_num_elements(self)
02507 

unsigned int SyFi::Dof::size ( ) const [inline]

Definition at line 85 of file Dof.h.

References counter.

Referenced by main(), and size().

                                { return counter; }
def SyFi::Dof::size (   self)
size(Dof self) -> unsigned int

Definition at line 2498 of file SyFi.py.

References size().

02498 
02499     def size(self):
02500         """size(Dof self) -> unsigned int"""
02501         return _SyFi.Dof_size(self)
02502 


Member Data Documentation

SyFi::Dof::__repr__ = _swig_repr [static, private]

Definition at line 2477 of file SyFi.py.

SyFi::Dof::__swig_destroy__ = _SyFi.delete_Dof [static, private]

Definition at line 2486 of file SyFi.py.

unsigned int SyFi::Dof::counter [protected]

Definition at line 39 of file Dof.h.

Referenced by size().

bool SyFi::Dof::create_glob2dof [protected]

Definition at line 61 of file Dof.h.

bool SyFi::Dof::create_glob2loc [protected]

Definition at line 54 of file Dof.h.

std::map<GiNaC::ex , unsigned int, GiNaC::ex_is_less > SyFi::Dof::dof2glob [protected]

Definition at line 58 of file Dof.h.

unsigned int SyFi::Dof::emax [protected]

Definition at line 42 of file Dof.h.

Referenced by num_elements().

std::map< unsigned int, GiNaC::ex > SyFi::Dof::glob2dof [protected]

Definition at line 62 of file Dof.h.

std::map< unsigned int, vector_ii > SyFi::Dof::glob2loc_map [protected]

Definition at line 55 of file Dof.h.

unsigned int SyFi::Dof::imax [protected]

Definition at line 45 of file Dof.h.

Referenced by max_dofs_per_element().

std::map<std::pair<unsigned int,unsigned int>, unsigned int> SyFi::Dof::loc2glob [protected]

Definition at line 51 of file Dof.h.

tuple SyFi::Dof::thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') [static]

Definition at line 2476 of file SyFi.py.


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