Dof.h
Go to the documentation of this file.00001
00002
00003
00004 #ifndef DOF_IS_INCLUDED
00005 #define DOF_IS_INCLUDED
00006
00007 #include "FE.h"
00008
00009 #include <map>
00010 #include <vector>
00011 #include <iterator>
00012 #include <iostream>
00013 #include <stdexcept>
00014
00015 namespace SyFi
00016 {
00017
00018 typedef std::pair<unsigned int, unsigned int> pair_ii;
00019 typedef std::vector< std::pair<unsigned int, unsigned int> > vector_ii;
00020
00021 class Dof
00022 {
00023 protected:
00024
00025 unsigned int counter;
00026
00027
00028 unsigned int emax;
00029
00030
00031 unsigned int imax;
00032
00033
00034
00035
00036
00037 std::map<std::pair<unsigned int,unsigned int>, unsigned int> loc2glob;
00038
00039
00040 bool create_glob2loc;
00041 std::map< unsigned int, vector_ii > glob2loc_map;
00042
00043
00044 std::map<GiNaC::ex , unsigned int, GiNaC::ex_is_less > dof2glob;
00045
00046
00047 bool create_glob2dof;
00048 std::map< unsigned int, GiNaC::ex > glob2dof;
00049
00050 public:
00051 Dof(bool create_glob2dof = false, bool create_glob2loc = false):
00052 counter(0),
00053 emax(0),
00054 imax(0),
00055 create_glob2loc(create_glob2loc),
00056 create_glob2dof(create_glob2dof)
00057 {
00058 }
00059
00060 ~Dof() {}
00061
00062 void clear();
00063
00064
00065 unsigned int insert_dof(unsigned int e, unsigned int i, GiNaC::ex Li);
00066
00067
00068
00069
00070
00071 unsigned int size() const
00072 { return counter; }
00073
00074
00075 unsigned int num_elements() const
00076 { return emax+1; }
00077
00078
00079 unsigned int max_dofs_per_element() const
00080 { return imax+1; }
00081
00082
00083 unsigned int glob_dof(unsigned int e, unsigned int i);
00084
00085
00086 unsigned int glob_dof(GiNaC::ex Lj);
00087
00088
00089 GiNaC::ex glob_dof(unsigned int j);
00090
00091
00092 vector_ii glob2loc(unsigned int j);
00093
00094 };
00095
00096 }
00097 #endif