dune-fem 2.12-git
Loading...
Searching...
No Matches
defaultblockvectors.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SIMPLEBLOCKVECTOR_HH
2#define DUNE_FEM_SIMPLEBLOCKVECTOR_HH
3
4#include <algorithm>
5#include <cassert>
6#include <memory>
7
11
17
18#if HAVE_DUNE_ISTL
19#include <dune/istl/bvector.hh>
20#endif
21
22namespace Dune {
23
24 namespace Fem {
25
26 // tag for block vectors
27 class IsBlockVector {};
28
29
30
38 template< class Imp, class Field >
40 : public IsBlockVector
41 {
42 protected:
44
46
48 typedef Imp ThisType;
49 public:
51 typedef Field FieldType;
53 typedef Field DofType;
54
56 const ThisType& operator= ( const ThisType &other )
57 {
58 if( &asImp() != &other )
59 {
60 assign( other );
61 sequence_ = other.sequence_;
62 }
63 return asImp();
64 }
65
67 const ThisType &operator+= ( const ThisType &other )
68 {
69 assert( asImp().size() == other.size() );
70 const auto endit = asImp().end();
71 auto oit = other.begin();
72 for( auto it = asImp().begin(); it != endit; ++it, ++oit )
73 *it += *oit;
74
75 ++sequence_;
76 return asImp();
77 }
78
80 const ThisType &operator-= ( const ThisType &other )
81 {
82 assert( asImp().size() == other.size() );
83 const auto endit = asImp().end();
84 auto oit = other.begin();
85 for( auto it = asImp().begin(); it != endit; ++it, ++oit )
86 *it -= *oit;
87
88 ++sequence_;
89 return asImp();
90 }
91
93 FieldType operator* ( const ThisType &other ) const
94 {
95 assert( asImp().size() == other.size() );
96 FieldType sum( 0 );
97 const auto endit = asImp().end();
98 auto oit = other.asImp().begin();
99 for( auto it = asImp().begin(); it != endit; ++it, ++oit )
100 sum += (*it * *oit);
101
102 return sum;
103 }
104
110 const ThisType &operator*= ( const FieldType &scalar )
111 {
112 const auto endit = asImp().end();
113 for( auto it = asImp().begin(); it != endit; ++it )
114 *it *= scalar;
115
116 ++sequence_;
117 return asImp();
118 }
119
127 void axpy ( const FieldType &scalar, const ThisType &other )
128 {
129 assert( asImp().size() == other.size() );
130 const auto endit = asImp().end();
131 auto oit = other.begin();
132 for( auto it = asImp().begin(); it != endit; ++it, ++oit )
133 *it += scalar * (*oit);
134
135 ++sequence_;
136 }
137
139 void clear ()
140 {
141 std::fill( asImp().begin(), asImp().end(), FieldType( 0 ) );
142 ++sequence_;
143 }
144
147 {
148 return asImp().numDofs() * sizeof( FieldType ) ;
149 }
150
152 void copyContent( const size_t newIndex, const size_t oldIndex )
153 {
154 asImp()[ newIndex ] = asImp()[ oldIndex ];
155 }
156
158 void memMoveBackward(const size_t length, const size_t oldStartIdx, const size_t newStartIdx)
159 {
160 assert( newStartIdx >= oldStartIdx );
161 // get new end of block which is offSet + (length of block - 1)
162 size_t newIdx = newStartIdx + length - 1;
163 assert( newIdx < asImp().size() );
164 // copy all entries backwards
165 for(size_t oldIdx = oldStartIdx + length-1; oldIdx >= oldStartIdx; --oldIdx, --newIdx )
166 {
167 assert( oldIdx < asImp().size() );
168 // copy to new location
169 copyContent( newIdx, oldIdx );
170 }
171 }
172
174 void memMoveForward(const size_t length, const size_t oldStartIdx, const size_t newStartIdx)
175 {
176 assert( newStartIdx <= oldStartIdx );
177 const size_t upperBound = oldStartIdx + length;
178 // get new off set that should be smaller then old one
179 size_t newIdx = newStartIdx;
180 for(size_t oldIdx = oldStartIdx; oldIdx<upperBound; ++oldIdx, ++newIdx )
181 {
182 // copy to new location
183 copyContent( newIdx, oldIdx );
184 }
185 }
186
188 void setMemoryFactor( const double memFactor ) {}
189
190 protected:
191 // Copy block vectors.
192 // Note: No '++sequence_' here, sequence_ is only changed in public methods
193 void assign ( const ThisType &other )
194 {
195 assert( asImp().size() == other.size() );
196 std::copy( other.begin(), other.end(), asImp().begin() );
197 }
198
199 ThisType& asImp() { return static_cast< ThisType& > (*this); }
200 const ThisType& asImp() const { return static_cast< const ThisType& > (*this); }
201
202 mutable CounterType sequence_; // for consistency checks...
203 };
204
205
206
214 template< class Container, int BlockSize >
216 : public BlockVectorInterface< SimpleBlockVector< Container, BlockSize>, typename Container::value_type >
217 {
218 typedef BlockVectorInterface< SimpleBlockVector< Container, BlockSize>, typename Container::value_type > BaseType;
220 typedef Container ArrayType;
221
223
224 public:
225 typedef ArrayType DofContainerType;
226
228 typedef typename ArrayType::value_type FieldType;
230 typedef typename ArrayType::iterator IteratorType;
232 typedef typename ArrayType::const_iterator ConstIteratorType;
234 typedef typename ArrayType::size_type SizeType;
235
240
245
248
250 enum { blockSize = BlockSize };
251
253
254 protected:
255 template <class Array>
257 {
258 static FieldType* data( Array& array ) { return array.data(); }
259 static const FieldType* data( const Array& array ) { return array.data(); }
260 };
261
262 template <class K>
264 {
266 static FieldType* data( Array& array ) { return array.container().data(); }
267 static const FieldType* data( const Array& array ) { return array.container().data(); }
268 };
269
270 public:
272 explicit SimpleBlockVector ( ArrayType& array )
273 : array_( array )
274 {}
275
277 const ThisType& operator= ( const ThisType& other )
278 {
279 BaseType::operator=( other );
280 return *this;
281 }
282
284 ConstDofBlockType operator[] ( const unsigned int i ) const
285 {
286 assert( i < size() );
288 }
289
291 DofBlockType operator[] ( const unsigned int i )
292 {
293 assert( i < size() );
295 }
296
298 ConstDofBlockPtrType blockPtr( const unsigned int i ) const
299 {
300 return ConstDofBlockPtrType( this->operator[] ( i ) );
301 }
302
304 DofBlockPtrType blockPtr( const unsigned int i )
305 {
306 return DofBlockPtrType( this->operator[] ( i ) );
307 }
308
310 IteratorType begin() { return array().begin(); }
311
313 ConstIteratorType begin() const { return array().begin(); }
314
316 IteratorType end() { return array().end(); }
317
319 ConstIteratorType end() const { return array().end(); }
320
322 IteratorType beforeEnd() { return array().beforeEnd(); }
323
325 ConstIteratorType beforeEnd() const { return array().beforeEnd(); }
326
328 IteratorType beforeBegin() { return array().beforeBegin(); }
329
331 ConstIteratorType beforeBegin() const { return array().beforeBegin(); }
332
334 IteratorType find( const SizeType dof ) { return array().find( dof ); }
335
337 ConstIteratorType find( const SizeType dof ) const { return array().find( dof ); }
338
340 SizeType size () const { return array().size() / blockSize; }
341
343 SizeType numDofs() const { return array().size(); }
344
347
348 const ArrayType &array () const { return array_; }
349 ArrayType &array () { return array_; }
350
351 protected:
352 ArrayType& array_;
353 };
354
355
356
364 template< class Container, unsigned int BlockSize >
366 : public SimpleBlockVector< Container, BlockSize >
367 {
369 typedef SimpleBlockVector < Container, BlockSize > BaseType;
370
371 typedef Container ArrayType;
372 using BaseType :: array_;
374 public:
375
376 using BaseType :: array;
377 using BaseType :: blockSize ;
378 typedef typename BaseType :: SizeType SizeType;
379
382 : BaseType( *(new Container( size*blockSize ) ) )
383 {}
384
387 : BaseType( *(new Container( other.array().size() ) ) )
388 {
389 assign( other );
390 }
391
393 {
394 delete &array_;
395 }
396
398 void setMemoryFactor( const double memFactor )
399 {
400 doSetMemoryFactor( array_, memFactor );
401 }
402
411 void reserve ( const int size )
412 {
413 array().reserve( size*blockSize );
414 }
415
418 {
419 array().resize( size*blockSize );
420 ++sequence_;
421 }
422
423 private:
424 template <class T, class Allocator>
425 void doSetMemoryFactor( Dune::Fem::DynamicArray< T, Allocator >& array, const double memFactor )
426 {
427 array_.setMemoryFactor( memFactor );
428 }
429
430 template <class Array>
431 void doSetMemoryFactor( Array& , const double memFactor ) {}
432
433 };
434
435
436
444 template< class Field, unsigned int BlockSize >
445 class MutableBlockVector< DynamicArray< Field >, BlockSize >
446 : public SimpleBlockVector< StaticArray< Field >, BlockSize >
447 {
452
453 protected:
454 using BaseType :: array_;
456
458 public:
459 using BaseType :: blockSize ;
460 typedef typename BaseType :: SizeType SizeType;
461
464 : BaseType( allocateContainer( size*blockSize ) ),
465 container_( static_cast< MutableContainer* > (&array_) )
466 {}
467
470 : BaseType( allocateContainer( other.array().size() ) ),
471 container_( static_cast< MutableContainer* > (&array_) )
472 {
473 assign( other );
474 }
475
484 void reserve ( const int size )
485 {
486 assert( container_ );
487 container_->reserve( size*blockSize );
488 }
489
492 {
493 assert( container_ );
494 container_->resize( size*blockSize );
495 ++sequence_;
496 }
497
498 protected:
500 {
501 MutableContainer* container = new MutableContainer( size );
502 return *container;
503 }
504 };
505
506
507
512 template< class DofBlock >
514 : public BlockVectorInterface< ISTLBlockVector< DofBlock >, typename DofBlock :: value_type >
515 {
517#if HAVE_DUNE_ISTL
519#else
520 // fallback in case dune-istl is not present
522#endif
523 typedef BlockVectorInterface< ISTLBlockVector< DofBlock >, typename DofBlock :: value_type > BaseType;
524
525
527
528 public:
529 ISTLBlockVector ( const ThisType& ) = default;
530
532
533 enum { blockSize = DofBlock :: dimension };
535
536 typedef typename DofBlock :: value_type FieldType;
537
538 protected:
539 template <class EmbeddedIterator, class V>
541 : public ForwardIteratorFacade< Iterator< EmbeddedIterator,V >, V >
542 {
543 public:
544 typedef V FieldType;
545 protected:
546 mutable EmbeddedIterator it_;
547#ifndef NDEBUG
548 EmbeddedIterator end_;
549#endif
551 public:
553 Iterator( const EmbeddedIterator& it
554#ifndef NDEBUG
555 , const EmbeddedIterator& end = EmbeddedIterator()
556#endif
557 )
558 : Iterator( it, 0
559#ifndef NDEBUG
560 , end
561#endif
562 )
563 {}
564
566 Iterator( const EmbeddedIterator& it, const int index
567#ifndef NDEBUG
568 , const EmbeddedIterator& end = EmbeddedIterator()
569#endif
570 )
571 : it_( it ),
572#ifndef NDEBUG
573 end_( end ),
574#endif
575 index_( index )
576 {}
577
580 {
581 assert( it_ != end_ );
582 assert( index_ < blockSize );
583 return (*it_)[ index_ ];
584 }
585
587 void increment ()
588 {
589 ++index_;
590 if( index_ >= blockSize )
591 {
592 index_ = 0;
593 ++it_;
594 }
595 }
596
598 bool equals ( const Iterator &other ) const
599 {
600 return (it_ == other.it_) && (index_ == other.index_);
601 }
602
603 }; // end DofIteratorBlockVectorDiscreteFunction
604
605 public:
608
609 typedef DofBlock DofBlockType;
610 typedef const DofBlock ConstDofBlockType;
611
614
618
621 : array_( array )
622 {}
623
624 ISTLBlockVector () = default;
625
627 const ThisType& operator= ( const ThisType& other )
628 {
629 if( this != &other )
630 {
631 array() = other.array();
632 }
633 return *this;
634 }
635
636 DofBlockPtrType blockPtr(const unsigned int i ) { return &array()[ i ]; }
637 ConstDofBlockPtrType blockPtr(const unsigned int i ) const { return &array()[ i ]; }
638
639 DofBlockType& operator[] (const unsigned int i ) { return array()[ i ]; }
640 ConstDofBlockType& operator[] (const unsigned int i ) const { return array()[ i ]; }
641
643#ifndef NDEBUG
644 , array().end()
645#endif
646 ); }
648 {
649 return ConstIteratorType( array().begin()
650#ifndef NDEBUG
651 , array().end()
652#endif
653 ); }
654
655 IteratorType end() { return IteratorType( array().end() ); }
657
659 {
660 DUNE_THROW(NotImplemented,"ISTLBlockVector::beforeEnd not implemented yet");
661 return array().end();
662 }
663
665 {
666 DUNE_THROW(NotImplemented,"ISTLBlockVector::beforeEnd not implemented yet");
667 return array().end();
668 }
669
671 {
672 DUNE_THROW(NotImplemented,"ISTLBlockVector::beforeBegin not implemented yet");
673 return array().end();
674 }
675
677 {
678 DUNE_THROW(NotImplemented,"ISTLBlockVector::beforeBegin not implemented yet");
679 return array().end();
680 }
681
684 {
685 const SizeType block = dof / blockSize;
686 const SizeType index = dof % blockSize;
687 return IteratorType( array().find( block ), index
688#ifndef NDEBUG
689 , array().end()
690#endif
691 );
692 }
693
695 ConstIteratorType find( const SizeType dof ) const
696 {
697 const SizeType block = dof / blockSize;
698 const SizeType index = dof % blockSize;
699 return ConstIteratorType( array().find( block ), index
700#ifndef NDEBUG
701 , array().end()
702#endif
703 );
704 }
705
706 SizeType size() const { return array().size(); }
707
709 SizeType numDofs() const { return array().size() * DofBlock::dimension; }
710
719 void reserve ( const int size )
720 {
721 array().reserve( size );
722 }
723
726 {
727 array().resize( size );
728 ++sequence_;
729 }
730
731 ArrayType& array() { assert( array_ ); return *array_; }
732 const ArrayType& array() const { assert( array_ ); return *array_; }
733
734 protected:
735 // ISTL BlockVector
737 };
738
739} // namespace Fem
740} // namespace Dune
741
742#endif // DUNE_FEM_REFERENCEBLOCKVECTOR_HH
int size() const
iterator end()
iterator begin()
std::ptrdiff_t index() const
#define DUNE_THROW(E,...)
constexpr Iterator end()
void resize(size_type n, value_type c=value_type())
Base::size_type size_type
size_type size() const
Base::value_type value_type
void reserve(size_type n)
Definition hybrid.hh:86
Definition defaultblockvectors.hh:27
Definition defaultblockvectors.hh:41
CounterType sequence_
Definition defaultblockvectors.hh:202
void memMoveBackward(const size_t length, const size_t oldStartIdx, const size_t newStartIdx)
move memory blocks backwards
Definition defaultblockvectors.hh:158
Field FieldType
Type of the field the dofs lie in.
Definition defaultblockvectors.hh:51
Imp ThisType
Type of derived class (implementation)
Definition defaultblockvectors.hh:48
DebugCounter< size_t > CounterType
Definition defaultblockvectors.hh:43
std::size_t usedMemorySize() const
Definition defaultblockvectors.hh:146
void axpy(const FieldType &scalar, const ThisType &other)
Add a scalar multiple of another block vector to this block vector.
Definition defaultblockvectors.hh:127
const ThisType & operator*=(const FieldType &scalar)
Scale this block vector.
Definition defaultblockvectors.hh:110
void copyContent(const size_t newIndex, const size_t oldIndex)
Definition defaultblockvectors.hh:152
ThisType & asImp()
Definition defaultblockvectors.hh:199
BlockVectorInterface()
Definition defaultblockvectors.hh:45
const ThisType & operator-=(const ThisType &other)
Subtract another block vector from *this.
Definition defaultblockvectors.hh:80
const ThisType & asImp() const
Definition defaultblockvectors.hh:200
const ThisType & operator+=(const ThisType &other)
Add another block vector to *this.
Definition defaultblockvectors.hh:67
void setMemoryFactor(const double memFactor)
set memory overestimate factor, here does nothing
Definition defaultblockvectors.hh:188
void memMoveForward(const size_t length, const size_t oldStartIdx, const size_t newStartIdx)
move memory blocks forward
Definition defaultblockvectors.hh:174
Field DofType
make consistent with discrete function
Definition defaultblockvectors.hh:53
FieldType operator*(const ThisType &other) const
Scalar product between *this and another block vector.
Definition defaultblockvectors.hh:93
void assign(const ThisType &other)
Definition defaultblockvectors.hh:193
void clear()
Clear this block vector, i.e. set each dof to 0.
Definition defaultblockvectors.hh:139
const ThisType & operator=(const ThisType &other)
Copy assignment operator.
Definition defaultblockvectors.hh:56
This is the reference implementation of a block vector as it is expected as the second template param...
Definition defaultblockvectors.hh:217
ArrayType::size_type SizeType
Used for indexing the blocks, for example.
Definition defaultblockvectors.hh:234
ConstIteratorType find(const SizeType dof) const
Iterator pointing to a given dof (non blocked numbering)
Definition defaultblockvectors.hh:337
SubVector< DofContainerType, StaticOffsetSubMapper< BlockSize > > DofBlockType
Type of one (mutable) block.
Definition defaultblockvectors.hh:242
Fem::Envelope< DofBlockType > DofBlockPtrType
Definition defaultblockvectors.hh:246
SizeType numDofs() const
Number of dofs in the block vector.
Definition defaultblockvectors.hh:343
SizeType size() const
Number of blocks.
Definition defaultblockvectors.hh:340
ConstIteratorType beforeBegin() const
Iterator pointing to before the first dof.
Definition defaultblockvectors.hh:331
ArrayType DofContainerType
Definition defaultblockvectors.hh:225
ArrayType::const_iterator ConstIteratorType
Constant iterator to iterate over the dofs.
Definition defaultblockvectors.hh:232
ConstIteratorType end() const
Const-iterator pointing to the last dof.
Definition defaultblockvectors.hh:319
ArrayType::value_type FieldType
Type of the field the dofs lie in.
Definition defaultblockvectors.hh:228
const ArrayType & array() const
Definition defaultblockvectors.hh:348
Hybrid::IndexRange< int, blockSize > BlockIndices
Definition defaultblockvectors.hh:252
ConstDofBlockPtrType blockPtr(const unsigned int i) const
Constant access for the i-th block.
Definition defaultblockvectors.hh:298
ConstIteratorType begin() const
Const-iterator pointing to the first dof.
Definition defaultblockvectors.hh:313
const ThisType & operator=(const ThisType &other)
Copy assignment operator.
Definition defaultblockvectors.hh:277
ArrayType & array_
Definition defaultblockvectors.hh:352
ArrayType::iterator IteratorType
Iterator to iterate over the dofs.
Definition defaultblockvectors.hh:230
IteratorType end()
Iterator pointing to the last dof.
Definition defaultblockvectors.hh:316
IteratorType beforeBegin()
Iterator pointing to before the first dof.
Definition defaultblockvectors.hh:328
SimpleBlockVector(ArrayType &array)
Constructor.
Definition defaultblockvectors.hh:272
DofBlockPtrType blockPtr(const unsigned int i)
Access the i-th block.
Definition defaultblockvectors.hh:304
ArrayType & array()
Definition defaultblockvectors.hh:349
SizeType size_type
Typedef to make this class STL-compatible.
Definition defaultblockvectors.hh:239
IteratorType beforeEnd()
Iterator pointing to last dof.
Definition defaultblockvectors.hh:322
@ blockSize
Definition defaultblockvectors.hh:250
FieldType value_type
Typedef to make this class STL-compatible.
Definition defaultblockvectors.hh:237
DofBlockType ConstDofBlockType
Type of one constant block.
Definition defaultblockvectors.hh:244
IteratorType find(const SizeType dof)
Iterator pointing to a given dof (non blocked numbering)
Definition defaultblockvectors.hh:334
IteratorType begin()
Iterator pointing to the first dof.
Definition defaultblockvectors.hh:310
ConstDofBlockType operator[](const unsigned int i) const
Constant access the i-th block.
Definition defaultblockvectors.hh:284
ConstIteratorType beforeEnd() const
Iterator pointing to last dof.
Definition defaultblockvectors.hh:325
FieldType * data()
Definition defaultblockvectors.hh:345
Fem::Envelope< ConstDofBlockType > ConstDofBlockPtrType
Definition defaultblockvectors.hh:247
const FieldType * data() const
Definition defaultblockvectors.hh:346
Definition defaultblockvectors.hh:257
static const FieldType * data(const Array &array)
Definition defaultblockvectors.hh:259
static FieldType * data(Array &array)
Definition defaultblockvectors.hh:258
static const FieldType * data(const Array &array)
Definition defaultblockvectors.hh:267
static FieldType * data(Array &array)
Definition defaultblockvectors.hh:266
Dune::DynamicVector< K > Array
Definition defaultblockvectors.hh:265
Definition defaultblockvectors.hh:367
MutableBlockVector(const ThisType &other)
Copy constructor.
Definition defaultblockvectors.hh:386
void reserve(const int size)
Reserve memory.
Definition defaultblockvectors.hh:411
BaseType::SizeType SizeType
Definition defaultblockvectors.hh:378
~MutableBlockVector()
Definition defaultblockvectors.hh:392
MutableBlockVector(SizeType size)
Construct a block vector with 'size' blocks (not initialized)
Definition defaultblockvectors.hh:381
void resize(SizeType size)
Resize the block vector.
Definition defaultblockvectors.hh:417
void setMemoryFactor(const double memFactor)
set memory overestimate factor, here does nothing
Definition defaultblockvectors.hh:398
MutableBlockVector(const ThisType &other)
Copy constructor.
Definition defaultblockvectors.hh:469
void resize(SizeType size)
Resize the block vector.
Definition defaultblockvectors.hh:491
std::unique_ptr< MutableContainer > container_
Definition defaultblockvectors.hh:457
MutableBlockVector(SizeType size)
Construct a block vector with 'size' blocks (not initialized)
Definition defaultblockvectors.hh:463
BaseType::SizeType SizeType
Definition defaultblockvectors.hh:460
void reserve(const int size)
Reserve memory.
Definition defaultblockvectors.hh:484
StaticContainer & allocateContainer(const SizeType size)
Definition defaultblockvectors.hh:499
Definition defaultblockvectors.hh:515
ArrayType & array()
Definition defaultblockvectors.hh:731
const ThisType & operator=(const ThisType &other)
Copy assignment operator.
Definition defaultblockvectors.hh:627
ConstIteratorType begin() const
Definition defaultblockvectors.hh:647
ConstIteratorType beforeBegin() const
Definition defaultblockvectors.hh:676
IteratorType find(const SizeType dof)
Iterator pointing to a given dof (non blocked numbering)
Definition defaultblockvectors.hh:683
void reserve(const int size)
Reserve memory.
Definition defaultblockvectors.hh:719
ConstIteratorType beforeEnd() const
Definition defaultblockvectors.hh:664
DofBlock DofBlockType
Definition defaultblockvectors.hh:609
IteratorType end()
Definition defaultblockvectors.hh:655
DofBlock::value_type FieldType
Definition defaultblockvectors.hh:536
SizeType numDofs() const
Number of dofs in the block vector.
Definition defaultblockvectors.hh:709
ConstDofBlockType * ConstDofBlockPtrType
Definition defaultblockvectors.hh:613
ConstIteratorType end() const
Definition defaultblockvectors.hh:656
ArrayType DofContainerType
Definition defaultblockvectors.hh:531
DofBlockType * DofBlockPtrType
Definition defaultblockvectors.hh:612
SizeType size() const
Definition defaultblockvectors.hh:706
ISTLBlockVector(const ThisType &)=default
DofBlockType & operator[](const unsigned int i)
Definition defaultblockvectors.hh:639
ArrayType::value_type value_type
Typedef to make this class STL-compatible.
Definition defaultblockvectors.hh:617
const ArrayType & array() const
Definition defaultblockvectors.hh:732
ArrayType::size_type SizeType
Definition defaultblockvectors.hh:615
Iterator< typename ArrayType::ConstIterator, const FieldType > ConstIteratorType
Definition defaultblockvectors.hh:607
Hybrid::IndexRange< int, blockSize > BlockIndices
Definition defaultblockvectors.hh:534
IteratorType begin()
Definition defaultblockvectors.hh:642
DofBlockPtrType blockPtr(const unsigned int i)
Definition defaultblockvectors.hh:636
Iterator< typename ArrayType::Iterator, FieldType > IteratorType
Definition defaultblockvectors.hh:606
IteratorType beforeEnd()
Definition defaultblockvectors.hh:658
@ blockSize
Definition defaultblockvectors.hh:533
IteratorType beforeBegin()
Definition defaultblockvectors.hh:670
ISTLBlockVector(ArrayType *array)
Constructor.
Definition defaultblockvectors.hh:620
const DofBlock ConstDofBlockType
Definition defaultblockvectors.hh:610
ArrayType * array_
Definition defaultblockvectors.hh:736
ConstDofBlockPtrType blockPtr(const unsigned int i) const
Definition defaultblockvectors.hh:637
ConstIteratorType find(const SizeType dof) const
Iterator pointing to a given dof (non blocked numbering)
Definition defaultblockvectors.hh:695
void resize(SizeType size)
Resize the block vector.
Definition defaultblockvectors.hh:725
Definition defaultblockvectors.hh:542
void increment()
go to next dof
Definition defaultblockvectors.hh:587
EmbeddedIterator end_
Definition defaultblockvectors.hh:548
EmbeddedIterator it_
Definition defaultblockvectors.hh:546
int index_
Definition defaultblockvectors.hh:550
V FieldType
Definition defaultblockvectors.hh:544
bool equals(const Iterator &other) const
compare
Definition defaultblockvectors.hh:598
Iterator(const EmbeddedIterator &it, const EmbeddedIterator &end=EmbeddedIterator())
Default constructor.
Definition defaultblockvectors.hh:553
FieldType & dereference() const
return dof
Definition defaultblockvectors.hh:579
Iterator(const EmbeddedIterator &it, const int index, const EmbeddedIterator &end=EmbeddedIterator())
Default constructor.
Definition defaultblockvectors.hh:566
A counter only present if NDEBUG is not defined.
Definition debug.hh:30
An implementation of DenseVector which uses a C-array of fixed size as storage.
Definition dynamicarray.hh:148
An implementation of DenseVector which uses a C-array of dynamic size as storage.
Definition dynamicarray.hh:244
Definition envelope.hh:11
An implementation of DenseVector to extract a portion, not necessarly contiguos, of a vector.
Definition subvector.hh:161
Index mapper with static size which simply adds an offset to the index.
Definition subvector.hh:121
T copy(T... args)
T fill(T... args)