KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
array_1d.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 // Riccardo Rossi
12 //
13 //
14 
15 #pragma once
16 
17 // System includes
18 #include <string>
19 #include <iostream>
20 #include <array>
21 #include <algorithm>
22 #include <initializer_list>
23 
24 // External includes
25 
26 // Project includes
27 #include "includes/define.h"
29 
30 #include <boost/numeric/ublas/vector_expression.hpp>
31 #include <boost/numeric/ublas/storage.hpp>
32 #include <boost/numeric/ublas/detail/vector_assign.hpp>
33 
34 namespace Kratos
35 {
36 
39 
43 
47 
51 
55 
57 
59 template<class T, std::size_t N>
60 class array_1d : public boost::numeric::ublas::vector_expression< array_1d<T, N> >
61 {
62 public:
63 //#ifndef BOOST_UBLAS_NO_PROXY_SHORTCUTS
64 // BOOST_UBLAS_USING vector_expression<array_1d<T, N> >::operator ();
65 //#endif
66 
69 
72 
73  typedef std::size_t size_type;
74  typedef std::ptrdiff_t difference_type;
75  typedef T value_type;
76  typedef typename boost::numeric::ublas::type_traits<T>::const_reference const_reference;
77  typedef T &reference;
78  typedef std::array<T,N> array_type;
79  typedef T *pointer;
81  typedef const boost::numeric::ublas::vector_reference<const self_type> const_closure_type;
82  typedef boost::numeric::ublas::vector_reference<self_type> closure_type;
84  typedef boost::numeric::ublas::dense_tag storage_category;
85 // typedef concrete_tag simd_category; //removed for the new ublas
86 
90 
92  BOOST_UBLAS_INLINE
95  {
96  // intentionally does not initialize the contents for performance reasons
97  }
98 
99  explicit BOOST_UBLAS_INLINE
100  array_1d (size_type array_size):
102  {
103  // intentionally does not initialize the contents for performance reasons
104  }
105 
106  explicit BOOST_UBLAS_INLINE
109  {
110  KRATOS_DEBUG_ERROR_IF(array_size>N) << "Given size is greater than the size of the array!" << std::endl;
111 
112  std::fill(data().begin(), data().begin() + array_size, v);
113  // intentionally does not initialize the remaining entries for performance reasons
114  }
115 
116  explicit BOOST_UBLAS_INLINE
117  array_1d (const std::initializer_list<value_type>& rInitList):
119  {
120  KRATOS_DEBUG_ERROR_IF(rInitList.size()>N) << "Size of list greater than the size of the array!" << std::endl;
121 
122  std::copy(rInitList.begin(), rInitList.end(), data().begin()); // copy content of initializer list
123  // intentionally does not initialize the remaining entries for performance reasons
124  }
125 
126  BOOST_UBLAS_INLINE
127  array_1d (size_type array_size, const array_type & rdata):
129  data_ (rdata) {}
130 
131  BOOST_UBLAS_INLINE
132  array_1d (const array_1d &v):
134  data_ (v.data_) {}
135 
136 // template<class AE>
137 // BOOST_UBLAS_INLINE
138 // array_1d (const vector_expression<AE> &ae):
139 // vector_expression<self_type> () {
140 // vector_assign (scalar_assign<reference, typename AE::value_type> (), *this, ae);
141 // template<class AE> //boost 1.33.1
142 // BOOST_UBLAS_INLINE
143 // array_1d (const vector_expression<AE> &ae):
144 // vector_expression<self_type> () {
145 // vector_assign<scalar_assign> (*this, ae);
146 
147  template<class AE>
148  BOOST_UBLAS_INLINE
149  array_1d (const boost::numeric::ublas::vector_expression<AE> &ae)
150  {
151  boost::numeric::ublas::vector_assign<boost::numeric::ublas::scalar_assign> (*this, ae);
152  }
153 
157 
158  // Element access
159  BOOST_UBLAS_INLINE
161  {
162  KRATOS_DEBUG_ERROR_IF(i>=N) << "Index greater than the size of the array - index is i = " << i << std::endl;
163  return data_[i];
164  }
165  BOOST_UBLAS_INLINE
167  {
168  KRATOS_DEBUG_ERROR_IF(i>=N) << "Index greater than the size of the array - index is i = " << i << std::endl;
169  return data_[i];
170  }
171 
172  BOOST_UBLAS_INLINE
174  {
175  KRATOS_DEBUG_ERROR_IF(i>=N) << "Index greater than the size of the array - index is i = " << i << std::endl;
176  return data_[i];
177  }
178  BOOST_UBLAS_INLINE
180  {
181  KRATOS_DEBUG_ERROR_IF(i>=N) << "Index greater than the size of the array - index is i = " << i << std::endl;
182  return data_[i];
183  }
184 
185  // Assignment
186  BOOST_UBLAS_INLINE
188  {
189  data_ = v.data_;
190  return *this;
191  }
192 
193  template<class AE>
194  BOOST_UBLAS_INLINE
195  array_1d &operator = (const boost::numeric::ublas::vector_expression<AE> &ae)
196  {
197  return assign (self_type (ae));
198  //self_type temporary (ae);
199  //return assign_temporary (temporary);
200  }
201  template<class AE>
202  BOOST_UBLAS_INLINE
203  array_1d &operator += (const boost::numeric::ublas::vector_expression<AE> &ae)
204  {
205  return assign (self_type (*this + ae));
206  //self_type temporary (*this + ae);
207  //return assign_temporary (temporary);
208  }
209  template<class AE>
210  BOOST_UBLAS_INLINE
211  array_1d &operator -= (const boost::numeric::ublas::vector_expression<AE> &ae)
212  {
213  return assign (self_type (*this - ae));
214  //self_type temporary (*this - ae);
215  //return assign_temporary (temporary);
216  }
217  template<class AT>
218  BOOST_UBLAS_INLINE
219  array_1d &operator /= (const AT &at)
220  {
221  vector_assign_scalar<scalar_divides_assign> (*this, at); //included for ublas 1.33.1
222  return *this;
223  }
224 
230  BOOST_UBLAS_INLINE
231  bool operator == (const array_1d &v) const
232  {
233  return std::equal (data_.begin(), data_.end(), v.data_.begin());
234  }
235 
239 
240  // Resizing
241  BOOST_UBLAS_INLINE
242  void resize (size_type array_size, bool preserve = true)
243  {
244  if (!preserve)
245  std::fill (data_.begin(), data_.end(), value_type ());
246  }
247 
248  BOOST_UBLAS_INLINE
250  {
251  swap (v);
252  return *this;
253  }
254 
255 
256  template<class AT>
257  BOOST_UBLAS_INLINE
258  array_1d &operator *= (const AT &at)
259  {
260  vector_assign_scalar<scalar_multiplies_assign> (*this, at); //included for ublas 1.33.1
261  return *this;
262  }
263  template<class AE>
264  BOOST_UBLAS_INLINE
265  array_1d &plus_assign (const boost::numeric::ublas::vector_expression<AE> &ae)
266  {
267  vector_assign<scalar_plus_assign> (*this, ae); //included for ublas 1.33.1
268  //vector_assign (scalar_plus_assign<reference, typename AE::value_type> (), *this, ae);
269  return *this;
270  }
271  template<class AE>
272  BOOST_UBLAS_INLINE
273  array_1d &assign (const boost::numeric::ublas::vector_expression<AE> &ae)
274  {
275  vector_assign<scalar_assign> (*this, ae); //included for ublas 1.33.1
276  //vector_assign (scalar_assign<reference, typename AE::value_type> (), *this, ae);
277  return *this;
278  }
279  // Swapping
280  BOOST_UBLAS_INLINE
281  void swap (array_1d &v)
282  {
283  if (this != &v)
284  {
285  data ().swap (v.data ());
286  }
287  }
288 #ifndef BOOST_UBLAS_NO_MEMBER_FRIENDS
289  BOOST_UBLAS_INLINE
290  friend void swap (array_1d &v1, array_1d &v2)
291  {
292  v1.swap (v2);
293  }
294 #endif
295 
296  // Element insertion and erasure
297  // These functions should work with std::vector.
298  // Thanks to Kresimir Fresl for spotting this.
299 // BOOST_UBLAS_INLINE
300 // void insert (size_type i, const_reference t) {
301  // FIXME: only works for EqualityComparable value types.
302  // BOOST_UBLAS_CHECK (data () [i] == value_type (0), bad_index ());
303  // Previously: data ().insert (data ().begin () + i, t);
304 // data () [i] = t;
305 // }
306 // BOOST_UBLAS_INLINE
307 // void erase (size_type i) {
308 // // Previously: data ().erase (data ().begin () + i);
309 // data () [i] = value_type (0);
310 // }
311  // Element assignment
312  BOOST_UBLAS_INLINE
314  {
315  BOOST_UBLAS_CHECK (i < N, bad_index ());
316  return (data_ [i] = t);
317  }
318  BOOST_UBLAS_INLINE
320  {
321  BOOST_UBLAS_CHECK (i < N, bad_index ());
322  data_ [i] = value_type/*zero*/();
323  }
324  BOOST_UBLAS_INLINE
325  void clear ()
326  {
327  // Previously: data ().clear ();
328  std::fill (data ().begin (), data ().end (), value_type (0));
329  }
330 
334 
335  // Iterator types
336 private:
337  // Use the storage array1 iterator
338  typedef typename array_type::const_iterator const_iterator_type;
339  typedef typename array_type::iterator iterator_type;
340 
341 public:
342 #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR
343  typedef indexed_iterator<self_type, dense_random_access_iterator_tag> iterator;
344  typedef indexed_const_iterator<self_type, dense_random_access_iterator_tag> const_iterator;
345 #else
346  class const_iterator;
347  class iterator;
348 #endif
349 
350  // Element lookup
351  BOOST_UBLAS_INLINE
353  {
354 #ifndef BOOST_UBLAS_USE_INDEXED_ITERATOR
355  return const_iterator (*this, data ().begin () + i);
356 #else
357  return const_iterator (*this, i);
358 #endif
359  }
360  BOOST_UBLAS_INLINE
362  {
363 #ifndef BOOST_UBLAS_USE_INDEXED_ITERATOR
364  return iterator (*this, data ().begin () + i);
365 #else
366  return iterator (*this, i);
367 #endif
368  }
369  BOOST_UBLAS_INLINE
370  size_type size () const
371  {
372  return N;
373  }
374  template<class AE>
375  BOOST_UBLAS_INLINE
376  array_1d &minus_assign (const boost::numeric::ublas::vector_expression<AE> &ae)
377  {
378  vector_assign<scalar_minus_assign>(*this,ae);
379  //vector_assign (scalar_minus_assign<reference, typename AE::value_type> (), *this, ae);
380  return *this;
381  }
382  BOOST_UBLAS_INLINE
383  const array_type &data () const
384  {
385  return data_;
386  }
387  BOOST_UBLAS_INLINE
389  {
390  return data_;
391  }
392 
393 #ifndef BOOST_UBLAS_USE_INDEXED_ITERATOR
395  public container_const_reference<array_1d>,
396  public random_access_iterator_base<dense_random_access_iterator_tag,
397  const_iterator, value_type, difference_type>
398  {
399  public:
400  typedef dense_random_access_iterator_tag iterator_category;
401 #ifdef BOOST_MSVC_STD_ITERATOR
402  typedef const_reference reference;
403 #else
407  typedef const typename array_1d::pointer pointer;
408 #endif
409 
410  // Construction and destruction
411  BOOST_UBLAS_INLINE
413  container_const_reference<self_type> (), it_ () {}
414  BOOST_UBLAS_INLINE
415  const_iterator (const self_type &v, const const_iterator_type &it):
416  container_const_reference<self_type> (v), it_ (it) {}
417  BOOST_UBLAS_INLINE
418 #ifndef BOOST_UBLAS_QUALIFIED_TYPENAME
420 #else
421  const_iterator (const typename self_type::iterator &it):
422 #endif
423  container_const_reference<self_type> (it ()), it_ (it.it_) {}
424 
425  // Arithmetic
426  BOOST_UBLAS_INLINE
428  {
429  ++ it_;
430  return *this;
431  }
432  BOOST_UBLAS_INLINE
434  {
435  -- it_;
436  return *this;
437  }
438  BOOST_UBLAS_INLINE
440  {
441  it_ += n;
442  return *this;
443  }
444  BOOST_UBLAS_INLINE
446  {
447  it_ -= n;
448  return *this;
449  }
450  BOOST_UBLAS_INLINE
452  {
453  BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ());
454  return it_ - it.it_;
455  }
456 
457  // Dereference
458  BOOST_UBLAS_INLINE
460  {
461  BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ());
462  return *it_;
463  }
464 
465  // Index
466  BOOST_UBLAS_INLINE
467  size_type index () const
468  {
469  BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ());
470  return it_ - (*this) ().begin ().it_;
471  }
472 
473  // Assignment
474  BOOST_UBLAS_INLINE
476  {
477  container_const_reference<self_type>::assign (&it ());
478  it_ = it.it_;
479  return *this;
480  }
481 
482  // Comparison
483  BOOST_UBLAS_INLINE
484  bool operator == (const const_iterator &it) const
485  {
486  BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ());
487  return it_ == it.it_;
488  }
489  BOOST_UBLAS_INLINE
490  bool operator < (const const_iterator &it) const
491  {
492  BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ());
493  return it_ < it.it_;
494  }
495 
496  private:
497  const_iterator_type it_;
498 
499  friend class iterator;
500  };
501 #endif
502 
503 #ifndef BOOST_UBLAS_USE_INDEXED_ITERATOR
504  class iterator:
505  public container_reference<array_1d>,
506  public random_access_iterator_base<dense_random_access_iterator_tag,
507  iterator, value_type, difference_type>
508  {
509  public:
510  typedef dense_random_access_iterator_tag iterator_category;
511 #ifndef BOOST_MSVC_STD_ITERATOR
514  typedef typename array_1d::reference reference;
515  typedef typename array_1d::pointer pointer;
516 #endif
517 
518  // Construction and destruction
519  BOOST_UBLAS_INLINE
521  container_reference<self_type> (), it_ () {}
522  BOOST_UBLAS_INLINE
523  iterator (self_type &v, const iterator_type &it):
524  container_reference<self_type> (v), it_ (it) {}
525 
526  // Arithmetic
527  BOOST_UBLAS_INLINE
529  {
530  ++ it_;
531  return *this;
532  }
533  BOOST_UBLAS_INLINE
535  {
536  -- it_;
537  return *this;
538  }
539  BOOST_UBLAS_INLINE
541  {
542  it_ += n;
543  return *this;
544  }
545  BOOST_UBLAS_INLINE
547  {
548  it_ -= n;
549  return *this;
550  }
551  BOOST_UBLAS_INLINE
553  {
554  BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ());
555  return it_ - it.it_;
556  }
557 
558  // Dereference
559  BOOST_UBLAS_INLINE
561  {
562  BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_ , bad_index ());
563  return *it_;
564  }
565 
566  // Index
567  BOOST_UBLAS_INLINE
568  size_type index () const
569  {
570  BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_ , bad_index ());
571  return it_ - (*this) ().begin ().it_;
572  }
573 
574  // Assignment
575  BOOST_UBLAS_INLINE
577  {
578  container_reference<self_type>::assign (&it ());
579  it_ = it.it_;
580  return *this;
581  }
582 
583  // Comparison
584  BOOST_UBLAS_INLINE
585  bool operator == (const iterator &it) const
586  {
587  BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ());
588  return it_ == it.it_;
589  }
590  BOOST_UBLAS_INLINE
591  bool operator < (const iterator &it) const
592  {
593  BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ());
594  return it_ < it.it_;
595  }
596 
597  private:
598  iterator_type it_;
599 
600  friend class const_iterator;
601  };
602 #endif
603 
604 
605  BOOST_UBLAS_INLINE
607  {
608  return find (0);
609  }
610  BOOST_UBLAS_INLINE
612  {
613  return find (data_.size ());
614  }
615 
616  BOOST_UBLAS_INLINE
618  {
619  return find (0);
620  }
621  BOOST_UBLAS_INLINE
623  {
624  return find (data_.size ());
625  }
626 
627  // Reverse iterator
628 
629 #ifdef BOOST_MSVC_STD_ITERATOR
630  typedef reverse_iterator_base<const_iterator, value_type, const_reference> const_reverse_iterator;
631 #else
632  typedef boost::numeric::ublas::reverse_iterator_base<const_iterator> const_reverse_iterator;
633 #endif
634 
635  BOOST_UBLAS_INLINE
637  {
638  return const_reverse_iterator (end ());
639  }
640  BOOST_UBLAS_INLINE
642  {
643  return const_reverse_iterator (begin ());
644  }
645 
646 #ifdef BOOST_MSVC_STD_ITERATOR
647  typedef reverse_iterator_base<iterator, value_type, reference> reverse_iterator;
648 #else
649  typedef boost::numeric::ublas::reverse_iterator_base<iterator> reverse_iterator;
650 #endif
651 
652  BOOST_UBLAS_INLINE
654  {
655  return reverse_iterator (end ());
656  }
657  BOOST_UBLAS_INLINE
659  {
660  return reverse_iterator (begin ());
661  }
665 
666 
670 
671 
675 
676 
678 
679 protected:
682 
683 
687 
688 
692 
693 
697 
698 
702 
703 
707 
708 
712 
713 
715 
716 private:
717 
718 
721 
722 
726 
727  array_type data_;
728 
732 
733 
737 
738 
742 
743 
747 
748 
752 
753 
755 
756 }; // Class array_1d
757 
761 
765 
767 
768 
769 } // namespace Kratos.
770 
772 {
781  template <class TClassType>
782  inline void HashCombine(
783  std::size_t& rSeed,
784  const TClassType& rValue
785  )
786  {
787  std::hash<TClassType> hasher;
788  rSeed ^= hasher(rValue) + 0x9e3779b9 + (rSeed<<6) + (rSeed>>2);
789  }
790 }
791 
792 namespace std
793 {
794 template<class T, std::size_t N>
795 struct hash<Kratos::array_1d<T,N>>
796 {
797  std::size_t operator()(const Kratos::array_1d<T,N>& rArray) {
798  std::size_t seed = 0;
799  for (auto component : rArray) {AuxiliaryHashCombine::HashCombine(seed, component);}
800  return seed;
801  }
802 };
803 } // namespace std.
Definition: array_1d.h:398
BOOST_UBLAS_INLINE const_iterator & operator++()
Definition: array_1d.h:427
BOOST_UBLAS_INLINE const_iterator(const iterator &it)
Definition: array_1d.h:419
BOOST_UBLAS_INLINE const_iterator(const self_type &v, const const_iterator_type &it)
Definition: array_1d.h:415
BOOST_UBLAS_INLINE const_iterator()
Definition: array_1d.h:412
BOOST_UBLAS_INLINE const_iterator & operator=(const const_iterator &it)
Definition: array_1d.h:475
array_1d::const_reference reference
Definition: array_1d.h:406
BOOST_UBLAS_INLINE difference_type operator-(const const_iterator &it) const
Definition: array_1d.h:451
BOOST_UBLAS_INLINE const_iterator & operator-=(difference_type n)
Definition: array_1d.h:445
BOOST_UBLAS_INLINE bool operator<(const const_iterator &it) const
Definition: array_1d.h:490
array_1d::difference_type difference_type
Definition: array_1d.h:404
BOOST_UBLAS_INLINE const_iterator & operator+=(difference_type n)
Definition: array_1d.h:439
BOOST_UBLAS_INLINE bool operator==(const const_iterator &it) const
Definition: array_1d.h:484
array_1d::value_type value_type
Definition: array_1d.h:405
dense_random_access_iterator_tag iterator_category
Definition: array_1d.h:400
BOOST_UBLAS_INLINE size_type index() const
Definition: array_1d.h:467
BOOST_UBLAS_INLINE const_reference operator*() const
Definition: array_1d.h:459
BOOST_UBLAS_INLINE const_iterator & operator--()
Definition: array_1d.h:433
const array_1d::pointer pointer
Definition: array_1d.h:407
Definition: array_1d.h:508
dense_random_access_iterator_tag iterator_category
Definition: array_1d.h:510
BOOST_UBLAS_INLINE iterator(self_type &v, const iterator_type &it)
Definition: array_1d.h:523
array_1d::difference_type difference_type
Definition: array_1d.h:512
BOOST_UBLAS_INLINE iterator & operator--()
Definition: array_1d.h:534
BOOST_UBLAS_INLINE reference operator*() const
Definition: array_1d.h:560
BOOST_UBLAS_INLINE iterator()
Definition: array_1d.h:520
BOOST_UBLAS_INLINE size_type index() const
Definition: array_1d.h:568
array_1d::value_type value_type
Definition: array_1d.h:513
BOOST_UBLAS_INLINE bool operator==(const iterator &it) const
Definition: array_1d.h:585
array_1d::pointer pointer
Definition: array_1d.h:515
BOOST_UBLAS_INLINE bool operator<(const iterator &it) const
Definition: array_1d.h:591
BOOST_UBLAS_INLINE difference_type operator-(const iterator &it) const
Definition: array_1d.h:552
array_1d::reference reference
Definition: array_1d.h:514
BOOST_UBLAS_INLINE iterator & operator=(const iterator &it)
Definition: array_1d.h:576
BOOST_UBLAS_INLINE iterator & operator-=(difference_type n)
Definition: array_1d.h:546
BOOST_UBLAS_INLINE iterator & operator+=(difference_type n)
Definition: array_1d.h:540
BOOST_UBLAS_INLINE iterator & operator++()
Definition: array_1d.h:528
Short class definition.
Definition: array_1d.h:61
boost::numeric::ublas::reverse_iterator_base< iterator > reverse_iterator
Definition: array_1d.h:649
self_type vector_temporary_type
Definition: array_1d.h:83
T & reference
Definition: array_1d.h:77
BOOST_UBLAS_INLINE void swap(array_1d &v)
Definition: array_1d.h:281
T * pointer
Definition: array_1d.h:79
BOOST_UBLAS_INLINE array_1d & assign(const boost::numeric::ublas::vector_expression< AE > &ae)
Definition: array_1d.h:273
BOOST_UBLAS_INLINE array_1d & minus_assign(const boost::numeric::ublas::vector_expression< AE > &ae)
Definition: array_1d.h:376
std::size_t size_type
Definition: array_1d.h:73
boost::numeric::ublas::reverse_iterator_base< const_iterator > const_reverse_iterator
Definition: array_1d.h:632
BOOST_UBLAS_INLINE reverse_iterator rbegin()
Definition: array_1d.h:653
std::ptrdiff_t difference_type
Definition: array_1d.h:74
BOOST_UBLAS_INLINE array_1d(size_type array_size, value_type v)
Definition: array_1d.h:107
BOOST_UBLAS_INLINE array_1d()
Default constructor.
Definition: array_1d.h:93
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
BOOST_UBLAS_INLINE void resize(size_type array_size, bool preserve=true)
Definition: array_1d.h:242
BOOST_UBLAS_INLINE iterator end()
Definition: array_1d.h:622
BOOST_UBLAS_INLINE array_1d & operator=(const array_1d &v)
Definition: array_1d.h:187
BOOST_UBLAS_INLINE array_1d & operator+=(const boost::numeric::ublas::vector_expression< AE > &ae)
Definition: array_1d.h:203
BOOST_UBLAS_INLINE const_reference operator()(size_type i) const
Definition: array_1d.h:160
BOOST_UBLAS_INLINE array_1d & operator-=(const boost::numeric::ublas::vector_expression< AE > &ae)
Definition: array_1d.h:211
BOOST_UBLAS_INLINE friend void swap(array_1d &v1, array_1d &v2)
Definition: array_1d.h:290
BOOST_UBLAS_INLINE const_reference operator[](size_type i) const
Definition: array_1d.h:173
BOOST_UBLAS_INLINE array_1d(size_type array_size, const array_type &rdata)
Definition: array_1d.h:127
BOOST_UBLAS_INLINE array_1d(size_type array_size)
Definition: array_1d.h:100
BOOST_UBLAS_INLINE const array_type & data() const
Definition: array_1d.h:383
BOOST_UBLAS_INLINE const_iterator find(size_type i) const
Definition: array_1d.h:352
boost::numeric::ublas::vector_reference< self_type > closure_type
Definition: array_1d.h:82
BOOST_UBLAS_INLINE array_type & data()
Definition: array_1d.h:388
BOOST_UBLAS_INLINE size_type size() const
Definition: array_1d.h:370
boost::numeric::ublas::type_traits< T >::const_reference const_reference
Definition: array_1d.h:76
BOOST_UBLAS_INLINE reverse_iterator rend()
Definition: array_1d.h:658
BOOST_UBLAS_INLINE iterator begin()
Definition: array_1d.h:617
std::array< T, N > array_type
Definition: array_1d.h:78
const boost::numeric::ublas::vector_reference< const self_type > const_closure_type
Definition: array_1d.h:81
BOOST_UBLAS_INLINE const_reverse_iterator rbegin() const
Definition: array_1d.h:636
BOOST_UBLAS_INLINE array_1d(const std::initializer_list< value_type > &rInitList)
Definition: array_1d.h:117
BOOST_UBLAS_INLINE reference insert_element(size_type i, const_reference t)
Definition: array_1d.h:313
boost::numeric::ublas::dense_tag storage_category
Definition: array_1d.h:84
BOOST_UBLAS_INLINE array_1d & operator*=(const AT &at)
Definition: array_1d.h:258
BOOST_UBLAS_INLINE const_iterator end() const
Definition: array_1d.h:611
BOOST_UBLAS_INLINE array_1d & operator/=(const AT &at)
Definition: array_1d.h:219
BOOST_UBLAS_INLINE void erase_element(size_type i)
Definition: array_1d.h:319
array_1d< T, N > self_type
Definition: array_1d.h:80
BOOST_UBLAS_INLINE array_1d & assign_temporary(array_1d &v)
Definition: array_1d.h:249
KRATOS_CLASS_POINTER_DEFINITION(array_1d)
Pointer definition of array_1d.
BOOST_UBLAS_INLINE iterator find(size_type i)
Definition: array_1d.h:361
T value_type
Definition: array_1d.h:75
BOOST_UBLAS_INLINE array_1d(const array_1d &v)
Definition: array_1d.h:132
BOOST_UBLAS_INLINE array_1d(const boost::numeric::ublas::vector_expression< AE > &ae)
Definition: array_1d.h:149
BOOST_UBLAS_INLINE array_1d & plus_assign(const boost::numeric::ublas::vector_expression< AE > &ae)
Definition: array_1d.h:265
BOOST_UBLAS_INLINE bool operator==(const array_1d &v) const
Compares whether this array_1d is equal to the given array_1d.
Definition: array_1d.h:231
BOOST_UBLAS_INLINE const_iterator begin() const
Definition: array_1d.h:606
BOOST_UBLAS_INLINE const_reverse_iterator rend() const
Definition: array_1d.h:641
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
Definition: array_1d.h:772
void HashCombine(std::size_t &rSeed, const TClassType &rValue)
This method creates an "unique" hash for the input value.
Definition: array_1d.h:782
int seed
Definition: GenerateWind.py:138
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > vector_expression
Definition: amatrix_interface.h:490
v
Definition: generate_convection_diffusion_explicit_element.py:114
tuple const
Definition: ode_solve.py:403
int t
Definition: ode_solve.py:392
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
N
Definition: sensitivityMatrix.py:29
namespace
Definition: array_1d.h:793
integer i
Definition: TensorModule.f:17
std::size_t operator()(const Kratos::array_1d< T, N > &rArray)
Definition: array_1d.h:797