SyFi::Dof Class Reference

#include <Dof.h>

Inheritance diagram for SyFi::Dof:

SyFi::_object

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

Public Attributes

 this

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

dictionary __swig_setmethods__ = {}
tuple __setattr__ = lambdaself,name,value:_swig_setattr(self, Dof, name, value)
dictionary __swig_getmethods__ = {}
tuple __getattr__ = lambdaself,name:_swig_getattr(self, Dof, name)
 __repr__ = _swig_repr
 __swig_destroy__ = _SyFi.delete_Dof
 __del__ = lambdaself:None;


Detailed Description

Proxy of C++ SyFi::Dof class

Definition at line 21 of file Dof.h.


Constructor & Destructor Documentation

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

Definition at line 51 of file Dof.h.

00051                                                                                        :
00052                         counter(0),
00053                                 emax(0),
00054                                 imax(0),
00055                                 create_glob2loc(create_glob2loc),
00056                                 create_glob2dof(create_glob2dof)
00057                         {
00058                         }

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

Definition at line 60 of file Dof.h.

00060 {}


Member Function Documentation

def SyFi::Dof::__init__ (   self,
  create_glob2dof = False,
  create_glob2loc = False 
)

__init__(self, bool create_glob2dof = False, bool create_glob2loc = False) -> Dof
__init__(self, bool create_glob2dof = False) -> Dof
__init__(self) -> Dof

Definition at line 2220 of file SyFi.py.

02220                                                                         : 
02221         """
02222         __init__(self, bool create_glob2dof = False, bool create_glob2loc = False) -> Dof
02223         __init__(self, bool create_glob2dof = False) -> Dof
02224         __init__(self) -> Dof
02225         """
02226         this = _SyFi.new_Dof(create_glob2dof, create_glob2loc)
02227         try: self.this.append(this)
02228         except: self.this = this

def SyFi::Dof::clear (   self  ) 

clear(self)

Definition at line 2231 of file SyFi.py.

02231                    :
02232         """clear(self)"""
02233         return _SyFi.Dof_clear(self)
02234 
    def insert_dof(self, *args):

void SyFi::Dof::clear (  ) 

Definition at line 11 of file Dof.cpp.

References counter, dof2glob, emax, glob2dof, glob2loc_map, imax, and loc2glob.

00012         {
00013                 counter = 0;
00014                 emax = 0;
00015                 imax = 0;
00016 
00017                 loc2glob.clear();
00018                 dof2glob.clear();
00019                 glob2dof.clear();
00020                 glob2loc_map.clear();
00021         }

def SyFi::Dof::glob2loc (   self,
  args 
)

glob2loc(self, unsigned int j) -> vector_ii

Definition at line 2259 of file SyFi.py.

02259                              :
02260         """glob2loc(self, unsigned int j) -> vector_ii"""
02261         return _SyFi.Dof_glob2loc(self, *args)
02262 
Dof_swigregister = _SyFi.Dof_swigregister

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

Definition at line 124 of file Dof.cpp.

References create_glob2loc, and glob2loc_map.

Referenced by main().

00125         {
00126                 if ( !create_glob2loc )
00127                 {
00128                         throw std::runtime_error("This structure has not been created, you must turn on the create_glob2loc flag before initialization!");
00129                 }
00130 
00131                 return glob2loc_map[j];
00132         }

def SyFi::Dof::glob_dof (   self,
  args 
)

glob_dof(self, unsigned int e, unsigned int i) -> unsigned int
glob_dof(self, GiNaC::ex Lj) -> unsigned int
glob_dof(self, unsigned int j) -> GiNaC::ex

Definition at line 2251 of file SyFi.py.

02251                              :
02252         """
02253         glob_dof(self, unsigned int e, unsigned int i) -> unsigned int
02254         glob_dof(self, GiNaC::ex Lj) -> unsigned int
02255         glob_dof(self, unsigned int j) -> GiNaC::ex
02256         """
02257         return _SyFi.Dof_glob_dof(self, *args)
02258 
    def glob2loc(self, *args):

GiNaC::ex SyFi::Dof::glob_dof ( unsigned int  j  ) 

Definition at line 105 of file Dof.cpp.

References create_glob2dof, and glob2dof.

00106         {
00107                 if ( !create_glob2dof )
00108                 {
00109                         throw std::runtime_error("This structure has not been created, you must turn on the create_glob2dof flag before initialization!");
00110                 }
00111 
00112                 std::map<unsigned int, GiNaC::ex>::iterator iter = glob2dof.find(j);
00113 
00114                 if ( iter == glob2dof.end() )
00115                 {
00116                         //throw std::runtime_error("In glob_dof(j): Not found");
00117                         std::cerr << "In glob_dof(j): Not found" << std::endl;
00118                         return GiNaC::ex();
00119                 }
00120 
00121                 return iter->second;
00122         }

unsigned int SyFi::Dof::glob_dof ( GiNaC::ex  Lj  ) 

Definition at line 92 of file Dof.cpp.

References dof2glob, and run_all::res.

00093         {
00094                 std::map<GiNaC::ex, unsigned int, GiNaC::ex_is_less>::iterator res = dof2glob.find(Lj);
00095 
00096                 if ( res == dof2glob.end() )
00097                 {
00098                         //throw std::runtime_error("In glob_dof(Lj): Not found");
00099                         return -1;
00100                 }
00101 
00102                 return res->second;
00103         }

unsigned int SyFi::Dof::glob_dof ( unsigned int  e,
unsigned int  i 
)

Definition at line 78 of file Dof.cpp.

References loc2glob, and run_all::res.

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

00079         {
00080                 pair_ii index(e, i);
00081                 std::map<pair_ii, unsigned int >::iterator res = loc2glob.find(index);
00082 
00083                 if ( res == loc2glob.end() )
00084                 {
00085                         //throw std::runtime_error("In glob_dof(e,i): Not found");
00086                         return -1;
00087                 }
00088 
00089                 return res->second;
00090         }

def SyFi::Dof::insert_dof (   self,
  args 
)

insert_dof(self, unsigned int e, unsigned int i, GiNaC::ex Li) -> unsigned int

Definition at line 2235 of file SyFi.py.

02235                                :
02236         """insert_dof(self, unsigned int e, unsigned int i, GiNaC::ex Li) -> unsigned int"""
02237         return _SyFi.Dof_insert_dof(self, *args)
02238 
    def size(self):

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

Definition at line 23 of file Dof.cpp.

References counter, create_glob2dof, create_glob2loc, dof2glob, emax, glob2dof, glob2loc_map, imax, loc2glob, and SyFi::p.

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

00024         {
00025                 if (e > emax) emax = e;
00026                 if (i > imax) imax = i;
00027 
00028                 unsigned int return_dof;
00029 
00030                 // check if the dof is new, if so
00031                 // update counter, dof2glob and create
00032                 // a new vector in glob2loc_map
00033 
00034                 std::map< GiNaC::ex, unsigned int, GiNaC::ex_is_less >::iterator index_iter = dof2glob.find(Li);
00035 
00036                 if( index_iter == dof2glob.end() )
00037                 {
00038                         // define a new dof
00039                         return_dof = counter;
00040 
00041                         // count inserted global indices
00042                         counter++;
00043 
00044                         // the central "D -> global index" map
00045                         dof2glob[Li] = return_dof;
00046 
00047                         if ( create_glob2dof )
00048                         {
00049                                 std::pair<unsigned int, GiNaC::ex> p(return_dof, Li);
00050                                 glob2dof.insert(p);
00051                         }
00052 
00053                         if ( create_glob2loc )
00054                         {
00055                                 // initialize with empty vector
00056                                 glob2loc_map[return_dof] = vector_ii();
00057                                 glob2loc_map[return_dof].reserve(imax);
00058                         }
00059                 }
00060                 else                                     // dof is not new
00061                 {
00062                         return_dof = index_iter->second;
00063                 }
00064 
00065                 // loc2glob should always be updated
00066                 pair_ii index(e, i);
00067                 loc2glob[index] = return_dof;
00068 
00069                 // insert (e,i) in glob2loc_map[Li]
00070                 if ( create_glob2loc )
00071                 {
00072                         glob2loc_map[return_dof].push_back(index);
00073                 }
00074 
00075                 return return_dof;
00076         }

def SyFi::Dof::max_dofs_per_element (   self  ) 

max_dofs_per_element(self) -> unsigned int

Definition at line 2247 of file SyFi.py.

02247                                   :
02248         """max_dofs_per_element(self) -> unsigned int"""
02249         return _SyFi.Dof_max_dofs_per_element(self)
02250 
    def glob_dof(self, *args):

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

Definition at line 79 of file Dof.h.

References imax.

00080                                 { return imax+1; }

def SyFi::Dof::num_elements (   self  ) 

num_elements(self) -> unsigned int

Definition at line 2243 of file SyFi.py.

02243                           :
02244         """num_elements(self) -> unsigned int"""
02245         return _SyFi.Dof_num_elements(self)
02246 
    def max_dofs_per_element(self):

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

Definition at line 75 of file Dof.h.

References emax.

00076                                 { return emax+1; }

def SyFi::Dof::size (   self  ) 

size(self) -> unsigned int

Definition at line 2239 of file SyFi.py.

02239                   :
02240         """size(self) -> unsigned int"""
02241         return _SyFi.Dof_size(self)
02242 
    def num_elements(self):

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

Definition at line 71 of file Dof.h.

References counter.

Referenced by main().

00072                                 { return counter; }


Member Data Documentation

SyFi::Dof::__del__ = lambdaself:None; [static, private]

Definition at line 2230 of file SyFi.py.

tuple SyFi::Dof::__getattr__ = lambdaself,name:_swig_getattr(self, Dof, name) [static, private]

Definition at line 2218 of file SyFi.py.

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

Definition at line 2219 of file SyFi.py.

tuple SyFi::Dof::__setattr__ = lambdaself,name,value:_swig_setattr(self, Dof, name, value) [static, private]

Definition at line 2216 of file SyFi.py.

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

Definition at line 2229 of file SyFi.py.

dictionary SyFi::Dof::__swig_getmethods__ = {} [static, private]

Definition at line 2217 of file SyFi.py.

dictionary SyFi::Dof::__swig_setmethods__ = {} [static, private]

Definition at line 2215 of file SyFi.py.

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

Definition at line 25 of file Dof.h.

Referenced by clear(), insert_dof(), and size().

bool SyFi::Dof::create_glob2dof [protected]

Definition at line 47 of file Dof.h.

Referenced by glob_dof(), and insert_dof().

bool SyFi::Dof::create_glob2loc [protected]

Definition at line 40 of file Dof.h.

Referenced by glob2loc(), and insert_dof().

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

Definition at line 44 of file Dof.h.

Referenced by clear(), glob_dof(), and insert_dof().

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

Definition at line 28 of file Dof.h.

Referenced by clear(), insert_dof(), and num_elements().

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

Definition at line 48 of file Dof.h.

Referenced by clear(), glob_dof(), and insert_dof().

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

Definition at line 41 of file Dof.h.

Referenced by clear(), glob2loc(), and insert_dof().

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

Definition at line 31 of file Dof.h.

Referenced by clear(), insert_dof(), and max_dofs_per_element().

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

Definition at line 37 of file Dof.h.

Referenced by clear(), glob_dof(), and insert_dof().

Definition at line 2228 of file SyFi.py.


The documentation for this class was generated from the following files:

Generated on Mon Aug 31 16:17:06 2009 for SyFi by  doxygen 1.5.9