32 #include <boost/tuple/tuple.hpp>
33 #include <boost/multi_index_container.hpp>
34 #include <boost/multi_index/member.hpp>
35 #include <boost/multi_index/composite_key.hpp>
36 #include <boost/multi_index/mem_fun.hpp>
37 #include <boost/multi_index/ordered_index.hpp>
48 class Dof :
public boost::tuple<size_type, int16_type, bool, uint16_type, bool, size_type>
50 typedef boost::tuple<size_type, int16_type, bool, uint16_type, bool, size_type> super;
85 this->get<2>() =
false;
89 Dof( boost::tuple<size_type, int16_type, bool>
const& t )
93 this->get<0>() = t.get<0>();
94 this->get<1>() = t.get<1>();
95 this->get<2>() = t.get<2>();
103 Dof(
size_type _index, int16_type _sign,
bool per, uint16_type _entity = 0,
bool _location =
false,
size_type _marker = 0 )
105 super(_index, _sign, per, _entity, _location, _marker)
139 this->get<2>() =
false;
142 Dof&
operator=( boost::tuple<size_type, int16_type, bool>
const& t )
144 this->get<0>() = t.get<0>();
145 this->get<1>() = t.get<1>();
146 this->get<2>() = t.get<2>();
158 return this->get<0>();
164 return this->get<1>();
169 return this->get<2>();
175 return this->get<3>();
181 return this->get<4>();
187 return this->get<5>();
193 ublas::vector<double>
const&
coords()
const
232 ublas::vector<double> M_coords;
235 typedef multi_index::multi_index_container<
237 multi_index::indexed_by<
240 multi_index::ordered_unique<multi_index::const_mem_fun<Dof,
245 multi_index::ordered_non_unique<multi_index::tag<detail::by_entity>,
246 multi_index::const_mem_fun<Dof,
250 multi_index::ordered_non_unique<multi_index::tag<detail::by_location>,
251 multi_index::const_mem_fun<Dof,
255 multi_index::ordered_non_unique<multi_index::tag<detail::by_marker>,
256 multi_index::const_mem_fun<Dof,
259 > > dof_container_type;
262 class LocalDof:
public std::pair<size_type,uint16_type>
265 typedef std::pair<size_type,uint16_type> super;
268 super( std::make_pair( 0, 0 ) )
272 super( std::make_pair( e, l ) )
274 LocalDof( std::pair<int,int>
const& p )
278 size_type elementId()
const {
return this->first; }
279 size_type localDof()
const {
return this->second; }
282 class LocalDofSet :
public std::vector<LocalDof>
285 typedef std::vector<LocalDof> super;
291 LocalDofSet(
size_type eid, uint16_type nLocalDof )
295 for(uint16_type i = 0; i < nLocalDof; ++i )
297 this->at( i ) = LocalDof( eid, i );
300 LocalDofSet
const& update(
size_type eid )
302 DCHECK( !this->empty() ) <<
"Invalid Local Dof Set";
303 std::for_each( this->begin(), this->end(), [eid]( LocalDof& d ) { d.first = eid; } );
uint16_type entity() const
Definition: dof.hpp:173
Dof()
default constructor
Definition: dof.hpp:73
bool isPeriodic() const
Definition: dof.hpp:167
size_type marker() const
Definition: dof.hpp:185
class that represents a degree of freedom
Definition: dof.hpp:48
int16_type sign() const
Definition: dof.hpp:162
size_t size_type
Indices (starting from 0)
Definition: feelcore/feel.hpp:319
Dof(Dof const &dof)
copy constructor
Definition: dof.hpp:110
bool isOnBoundary() const
Definition: dof.hpp:179
Elements & operator=(Elements const &e)
Definition: elements.hpp:335
ublas::vector< double > const & coords() const
Definition: dof.hpp:193
void setCoordinates(ublas::vector< double > const &coords)
Definition: dof.hpp:213
Dof & operator=(Dof const &o)
copy operator
Definition: dof.hpp:126
~Dof()
destructor
Definition: dof.hpp:116
size_type index() const
Definition: dof.hpp:156