27#ifndef OOMPH_FIXED_SIZE_VECTOR_HEADER
28#define OOMPH_FIXED_SIZE_VECTOR_HEADER
32#include <initializer_list>
46 template<
class T,
unsigned N>
66 if (values.size() != N)
68 std::stringstream error_message;
70 error_message <<
"Initialiser list contains " << values.size()
71 <<
" entries but FixedSizeVector has size " << N
81 for (
const auto& value : values)
91 for (
unsigned i = 0;
i < N;
i++)
109 std::stringstream error_message;
110 error_message <<
"Range error: trying to access entry " <<
i
111 <<
" in a fixed-size vector of size " << N << std::endl;
128 std::stringstream error_message;
129 error_message <<
"Range error: trying to access entry " <<
i
130 <<
" in a fixed-size vector of size " << N << std::endl;
165 template<
class T,
unsigned NROW,
unsigned NCOL>
207 std::stringstream error_message;
209 error_message <<
"Range error: trying to access entry (" <<
i <<
","
211 <<
"in a fixed-size matrix of size " <<
NROW <<
" x "
212 <<
NCOL << std::endl;
229 std::stringstream error_message;
231 error_message <<
"Range error: trying to access entry (" <<
i <<
","
233 <<
"in a fixed-size matrix of size " <<
NROW <<
" x "
234 <<
NCOL << std::endl;
276 template<
class T,
unsigned N1,
unsigned N2,
unsigned N3>
292 for (
unsigned i = 0;
i <
N1 *
N2 *
N3;
i++)
304 std::stringstream error_message;
306 error_message <<
"Range error: trying to access entry (" <<
i <<
","
307 <<
j <<
"," <<
k <<
") "
308 <<
"in a fixed-size rank-three tensor of size " <<
N1
309 <<
" x " <<
N2 <<
" x " <<
N3 << std::endl;
323 const unsigned&
k)
const
328 std::stringstream error_message;
330 error_message <<
"Range error: trying to access entry (" <<
i <<
","
331 <<
j <<
"," <<
k <<
") "
332 <<
"in a fixed-size rank-three tensor of size " <<
N1
333 <<
" x " <<
N2 <<
" x " <<
N3 << std::endl;
365 template<
class T,
unsigned N1,
unsigned N2,
unsigned N3,
unsigned N4>
396 std::stringstream error_message;
398 error_message <<
"Range error: trying to access entry (" <<
i <<
","
399 <<
j <<
"," <<
k <<
"," <<
l <<
") "
400 <<
"in a fixed-size rank-four tensor of size " <<
N1
401 <<
" x " <<
N2 <<
" x " <<
N3 <<
" x " <<
N4 << std::endl;
416 const unsigned&
l)
const
421 std::stringstream error_message;
423 error_message <<
"Range error: trying to access entry (" <<
i <<
","
424 <<
j <<
"," <<
k <<
"," <<
l <<
") "
425 <<
"in a fixed-size rank-four tensor of size " <<
N1
426 <<
" x " <<
N2 <<
" x " <<
N3 <<
" x " <<
N4 << std::endl;
A class that represents a collection of data; each Data object may contain many different individual ...
Class for fixed-size matrix storing NROW x NCOL objects of type T.
unsigned nrow() const
Number of rows.
const T & operator()(const unsigned &i, const unsigned &j) const
Read access to (i,j)-th entry.
T & operator()(const unsigned &i, const unsigned &j)
Read/write access to (i,j)-th entry.
void initialise(const T &value)
Fill all entries with specified value.
FixedSizeMatrix(const T &value)
Construct and fill all entries with specified value.
FixedSizeMatrix()
Default constructor.
void fill(const T &value)
Fill all entries with specified value.
unsigned ncol() const
Number of columns.
Class for fixed-size rank-four tensor storing N1 x N2 x N3 x N4 objects of type T.
T & operator()(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l)
Read/write access to (i,j,k,l)-th entry.
const T & operator()(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Read access to (i,j,k,l)-th entry.
FixedSizeRankFourTensor(const T &value)
Constructor with initialisation.
void fill(const T &value)
Fill all entries with specified value.
FixedSizeRankFourTensor()
Default constructor.
Class for fixed-size rank-three tensor storing N1 x N2 x N3 objects of type T.
FixedSizeRankThreeTensor()
Default constructor.
void fill(const T &value)
Fill all entries with specified value.
FixedSizeRankThreeTensor(const T &value)
Constructor with initialisation.
T & operator()(const unsigned &i, const unsigned &j, const unsigned &k)
Read/write access to (i,j,k)-th entry.
const T & operator()(const unsigned &i, const unsigned &j, const unsigned &k) const
Read access to (i,j,k)-th entry.
Class for fixed-size vector storing N objects of type T. No resize or other STL functionality but (th...
T & operator[](const unsigned &i)
Read/write access to i-th entry.
unsigned size() const
Size of vector.
FixedSizeVector(const T &value)
Constructor with initialisation to value.
const T & operator[](const unsigned &i) const
Read access to i-th entry.
FixedSizeVector()
Constructor; no initialisiation.
FixedSizeVector(std::initializer_list< T > values)
Constructor from initializer list. Allows FixedSizeVector<double,3> = {0.0,1.0,2.0}; say.
void fill(const T &value)
Fill all entries with specified value.
An OomphLibError object which should be thrown when an run-time error is encountered....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).