SyFi
0.3
|
#include <DofT.h>
Public Member Functions | |
DofT (bool create_index2dof_=false, bool create_dof2loc_=false) | |
~DofT () | |
int | insert_dof (int e, int i, D Li) |
int | glob_dof (int e, int i) |
int | glob_dof (D Lj) |
D | glob_dof (int j) |
int | size () const |
int | num_elements () const |
int | num_basis_functions () const |
std::vector< std::pair< int, int > > | glob2loc (int j) |
void | clear () |
Protected Attributes | |
bool | create_index2dof |
bool | create_dof2loc |
int | counter |
int | emax |
int | imax |
std::map< std::pair< int, int > , int > | loc2dof |
std::map< D, int, C > | dof2index |
std::map< D, int, C >::iterator | iter |
std::map< int, D > | index2dof |
std::map< int, std::vector < std::pair< int, int > > > | dof2loc |
DofT< D, C >::DofT | ( | bool | create_index2dof_ = false , |
bool | create_dof2loc_ = false |
||
) | [inline] |
Definition at line 49 of file DofT.h.
References DofT< D, C >::counter, DofT< D, C >::create_dof2loc, DofT< D, C >::create_index2dof, DofT< D, C >::emax, and DofT< D, C >::imax.
{ counter = -1; emax = -1; imax = -1; create_index2dof = create_index2dof_; create_dof2loc = create_dof2loc_; }
Definition at line 195 of file DofT.h.
{ if ( create_dof2loc ) { return dof2loc[j]; } else { std::cout <<"This structure has not been created "<<std::endl; std::cout <<"You must turn on the create_dof2loc flag before initialization!"<<std::endl; return std::vector<std::pair<int,int> >(); } }
Definition at line 170 of file DofT.h.
{ if ( create_index2dof) { if ( index2dof.find(j) != index2dof.end() ) { return (*(index2dof.find(j))).second; } else { std::cout <<"not found "<<std::endl; return D(); } } else { std::cout <<"This structure has not been created "<<std::endl; std::cout <<"You must turn on the create_index2dof flag before initialization!"<<std::endl; return D(); } }
int DofT< D, C >::insert_dof | ( | int | e, |
int | i, | ||
D | Li | ||
) |
Definition at line 83 of file DofT.h.
References SyFi::p, and test_syfi::debug::v.
Referenced by main().
{ if (e > emax) emax = e; if (i > imax) imax = i; // first we update loc2dof, which always should be updated std::pair<int,int> index; index.first = e; index.second = i; int return_dof; // check if the dof is new, if so // update counter, dof2index and create // a new vector in dof2loc iter = dof2index.find(Li); //dof is new if ( iter == dof2index.end() ) { counter++; return_dof = counter; dof2index[Li] = counter; loc2dof[index] = counter; if ( create_index2dof) { std::pair<int, D> p(counter, Li); index2dof.insert(p); // index2dof[counter] = Li; // } if ( create_dof2loc ) { std::vector<std::pair<int,int> > v; dof2loc[counter] = v; } } // dof is not new else { loc2dof[index] = (*iter).second; return_dof = (*iter).second; } // insert (e,i) in dof2loc[Li] if (create_dof2loc) { dof2loc[return_dof].push_back(index); } return return_dof; }
int DofT< D, C >::num_basis_functions | ( | ) | const [inline] |
int DofT< D, C >::num_elements | ( | ) | const [inline] |
Definition at line 31 of file DofT.h.
Referenced by DofT< D, C >::DofT().
bool DofT< D, C >::create_dof2loc [protected] |
Definition at line 30 of file DofT.h.
Referenced by DofT< D, C >::DofT().
bool DofT< D, C >::create_index2dof [protected] |
Definition at line 30 of file DofT.h.
Referenced by DofT< D, C >::DofT().
Definition at line 32 of file DofT.h.
Referenced by DofT< D, C >::DofT(), and DofT< D, C >::num_elements().
Definition at line 33 of file DofT.h.
Referenced by DofT< D, C >::DofT(), and DofT< D, C >::num_basis_functions().