74 #ifndef SLIP_DENSEVECTOR3DFIELD3D_HPP
75 #define SLIP_DENSEVECTOR3DFIELD3D_HPP
98 #include <boost/serialization/access.hpp>
99 #include <boost/serialization/split_member.hpp>
100 #include <boost/serialization/version.hpp>
101 #include <boost/serialization/base_object.hpp>
107 class stride_iterator;
130 template <
typename T>
154 template <
typename T>
201 static const std::size_t
DIM = 3;
224 base(slices,rows,cols)
238 base(slices,rows,cols,val)
252 base(slices,rows,cols,val)
266 base(slices,rows,cols,val)
281 template<
typename InputIterator>
287 base(slices,rows,cols,first,last)
309 template<
typename InputIterator>
313 InputIterator first1,
315 InputIterator first2,
316 InputIterator first3):
317 base(slices,rows,cols)
320 std::vector<InputIterator> first_iterators_list(3);
321 first_iterators_list[0] = first1;
322 first_iterators_list[1] = first2;
323 first_iterators_list[2] = first3;
324 this->
fill(first_iterators_list,last1);
350 std::string
name()
const;
377 const std::string& title,
378 const std::string& zone);
752 template<
typename Container3D>
764 template<
class Archive>
765 void save(Archive & ar,
const unsigned int version)
const
767 ar & boost::serialization::base_object<slip::GenericMultiComponent3d<slip::Vector3d<T> > >(*this);
769 template<
class Archive>
770 void load(Archive & ar,
const unsigned int version)
772 ar & boost::serialization::base_object<slip::GenericMultiComponent3d<slip::Vector3d<T> > >(*this);
774 BOOST_SERIALIZATION_SPLIT_MEMBER()
812 DenseVector3dField3d<T>
operator+(
const DenseVector3dField3d<T>& M1,
822 DenseVector3dField3d<T>
operator+(
const T& val,
823 const DenseVector3dField3d<T>& M1);
833 DenseVector3dField3d<T>
operator-(
const DenseVector3dField3d<T>& M1,
843 DenseVector3dField3d<T>
operator-(
const T& val,
844 const DenseVector3dField3d<T>& M1);
855 DenseVector3dField3d<T>
operator*(
const DenseVector3dField3d<T>& M1,
865 DenseVector3dField3d<T>
operator*(
const T& val,
866 const DenseVector3dField3d<T>& M1);
877 DenseVector3dField3d<T>
operator/(
const DenseVector3dField3d<T>& M1,
890 DenseVector3dField3d<T>
operator+(
const DenseVector3dField3d<T>& M1,
891 const DenseVector3dField3d<T>& M2);
900 DenseVector3dField3d<T>
operator+(
const DenseVector3dField3d<T>& M1,
911 const DenseVector3dField3d<T>& M1);
924 DenseVector3dField3d<T>
operator-(
const DenseVector3dField3d<T>& M1,
925 const DenseVector3dField3d<T>& M2);
935 DenseVector3dField3d<T>
operator-(
const DenseVector3dField3d<T>& M1,
946 const DenseVector3dField3d<T>& M1);
959 DenseVector3dField3d<T>
operator*(
const DenseVector3dField3d<T>& M1,
960 const DenseVector3dField3d<T>& M2);
970 DenseVector3dField3d<T>
operator*(
const DenseVector3dField3d<T>& M1,
981 const DenseVector3dField3d<T>& M1);
994 DenseVector3dField3d<T>
operator/(
const DenseVector3dField3d<T>& M1,
995 const DenseVector3dField3d<T>& M2);
1003 template<
typename T>
1004 DenseVector3dField3d<T>
operator/(
const DenseVector3dField3d<T>& M1,
1017 template<
typename T>
1021 std::fill_n(this->begin(),this->size(),val);
1026 template<
typename T>
1030 std::fill_n(this->begin(),this->size(),val);
1035 template<
typename T>
1041 return (*
this)[k][i][j][0];
1044 template<
typename T>
1050 return (*
this)[k][i][j][0];
1052 template<
typename T>
1058 return this->Vx1(k,i,j);
1061 template<
typename T>
1067 return this->Vx1(k,i,j);
1070 template<
typename T>
1076 return (*
this)[k][i][j][1];
1080 template<
typename T>
1086 return (*
this)[k][i][j][1];
1089 template<
typename T>
1095 return this->Vx2(k,i,j);
1099 template<
typename T>
1105 return this->Vx2(k,i,j);
1108 template<
typename T>
1114 return (*
this)[k][i][j][2];
1117 template<
typename T>
1123 return (*
this)[k][i][j][2];
1125 template<
typename T>
1131 return this->Vx3(k,i,j);
1134 template<
typename T>
1140 return this->Vx3(k,i,j);
1142 template<
typename T>
1149 return (*
this)[k][i][j].Euclidean_norm();
1153 template<
typename T>
1161 template<
typename T>
1169 template<
typename T>
1177 template<
typename T>
1187 template<
typename T>
1195 template<
typename T>
1203 template<
typename T>
1211 template<
typename T>
1221 template<
typename T>
1226 std::transform(this->begin(),this->end(),tmp.
begin(),std::negate<slip::Vector3d<T> >());
1230 template<
typename T>
1234 assert(this->dim1() == rhs.
dim1());
1235 assert(this->dim2() == rhs.
dim2());
1236 assert(this->dim3() == rhs.
dim3());
1237 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::plus<typename DenseVector3dField3d::value_type>());
1241 template<
typename T>
1245 assert(this->dim1() == rhs.
dim1());
1246 assert(this->dim2() == rhs.
dim2());
1247 assert(this->dim3() == rhs.
dim3());
1248 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::minus<typename DenseVector3dField3d::value_type>());
1252 template<
typename T>
1256 assert(this->dim1() == rhs.
dim1());
1257 assert(this->dim2() == rhs.
dim2());
1258 assert(this->dim3() == rhs.
dim3());
1259 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::multiplies<typename DenseVector3dField3d::value_type>());
1263 template<
typename T>
1267 assert(this->dim1() == rhs.
dim1());
1268 assert(this->dim2() == rhs.
dim2());
1269 assert(this->dim3() == rhs.
dim3());
1270 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::divides<typename DenseVector3dField3d::value_type>());
1274 template<
typename T>
1287 template<
typename T>
1290 const std::string& title,
1291 const std::string& zone)
1293 slip::write_tecplot_vect3d<DenseVector3dField3d<T> >(*
this,file_path_name,
1305 template<
typename T>
1309 slip::read_tecplot_vect3d<DenseVector3dField3d<T> >(file_path_name,*
this);
1313 template<
typename T>
1323 template<
typename T>
1331 template<
typename T>
1341 template<
typename T>
1350 template<
typename T>
1360 template<
typename T>
1369 template<
typename T>
1379 template<
typename T>
1388 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::plus<slip::Vector3d<T> >());
1393 template<
typename T>
1403 template<
typename T>
1413 template<
typename T>
1422 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::minus<slip::Vector3d<T> >());
1427 template<
typename T>
1437 template<
typename T>
1446 template<
typename T>
1455 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::multiplies<slip::Vector3d<T> >());
1460 template<
typename T>
1470 template<
typename T>
1479 template<
typename T>
1488 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::divides<slip::Vector3d<T> >());
1493 template<
typename T>
1508 #endif //SLIP_DENSEVECTOR3DFIELD3D_HPP
void minus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the difference of two ranges.
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
std::reverse_iterator< const_iterator > const_reverse_iterator
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Vector3d< T > *val)
Constructs a DenseVector3dField3d initialized by an array val.
slip::DenseVector3dField3d< long > DenseVector3dField3d_l
long alias
slip::GenericMultiComponent3d< slip::Vector3d< T > >::iterator3d iterator3d
T & Vx3(const size_type k, const size_type i, const size_type j)
Subscript access to third element of the data contained in the DenseVector3dField3d.
self & operator*=(const T &val)
slip::DenseVector3dField3d< unsigned char > DenseVector3dField3d_uc
unsigned char alias
std::reverse_iterator< iterator > reverse_iterator
Difference of Point3D class, specialization of DPoint<CoordType,DIM> with DIM = 3.
self & operator-=(const T &val)
slip::DenseVector3dField3d< short > DenseVector3dField3d_s
short alias
std::reverse_iterator< iterator > reverse_row_iterator
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols, InputIterator first1, InputIterator last1, InputIterator first2, InputIterator first3)
Contructs a DenseVector3dField3d from a 3 ranges.
vector3d_value_type & vector3d_reference
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
void write_tecplot(const std::string &file_path_name, const std::string &title, const std::string &zone)
Writes a DenseVector3dField3d to a tecplot file path name.
size_type dim3() const
Returns the number of columns (third dimension size) in the GenericMultiComponent3d.
size_type rows() const
Returns the number of rows (first dimension size) in the GenericMultiComponent3d. ...
This is a Vector3d struct. It is a specialization of kvector. It implements some specific 3d operatio...
norm_type Euclidean_norm() const
Returns the Euclidean norm of the elements of the kvector.
iterator begin()
Returns a read/write iterator that points to the first element in the GenericMultiComponent3d. Iteration is done in ordinary element order.
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols)
Constructs a DenseVector3dField3d.
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
size_type dim2() const
Returns the number of rows (second dimension size) in the GenericMultiComponent3d.
void divides(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise division of two ranges.
void norm(Container3D &result)
Computes Eucliean norm of each element in the field and write it to a Container3D.
~DenseVector3dField3d()
Destructor of the DenseVector3dField3d.
Provides some derivative algorithms and derivative functors.
size_type slices() const
Returns the number of slices (first dimension size) in the GenericMultiComponent3d.
Provides a class to iterate a 1d range according to a constant step.
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const T *val)
Constructs a DenseVector3dField3d initialized by an array val.
slip::DenseVector3dField3d< double > DenseVector3dField3d_d
double alias
slip::kstride_iterator< const_vector3d_pointer, 3 > const_vector3d_iterator
Provides a class to manipulate iterator3d within a slip::Range. It is used to iterate throw 3d contai...
T & w(const size_type k, const size_type i, const size_type j)
Subscript access to third element of the data contained in the DenseVector3dField3d.
DenseVector3dField3d()
Constructs a DenseVector3dField3d.
const value_type * const_pointer
self & operator=(const slip::Vector3d< T > &val)
Affects all the element of the DenseVector3dField3d by val.
slip::stride_iterator< pointer > col_iterator
slip::stride_iterator< const_pointer > const_col_iterator
slip::DenseVector3dField3d< unsigned long > DenseVector3dField3d_ul
unsigned long alias
const_pointer const_row_iterator
T & u(const size_type k, const size_type i, const size_type j)
Subscript access to first element of the data contained in the DenseVector3dField3d.
slip::GenericMultiComponent3d< slip::Vector3d< T > >::const_iterator2d const_iterator3d
slip::DenseVector3dField3d< int > DenseVector3dField3d_i
int alias
iterator begin()
Returns a read/write iterator that points to the first element in the kvector. Iteration is done in o...
ptrdiff_t difference_type
vector3d_value_type * vector3d_pointer
slip::DenseVector3dField3d< char > DenseVector3dField3d_c
char alias
const_pointer const_iterator
This is a GenericMultiComponent3d class. This container statisfies the BidirectionnalContainer concep...
void plus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the addition of two ranges.
void multiplies(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise product of two ranges.
Provides a class to manipulate 3d Vector.
Provides a class to manipulate iterator2d within a slip::Box3d. It is used to iterate throw 3d contai...
slip::DenseVector3dField3d< unsigned short > DenseVector3dField3d_us
unsigned long alias
slip::DenseVector3dField3d< float > DenseVector3dField3d_f
float alias
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Vector3d< T > &val)
Constructs a DenseVector3dField3d initialized by the scalar value val.
static const std::size_t DIM
const value_type & const_reference
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols, InputIterator first, InputIterator last)
Contructs a DenseVector3dField3d from a range.
T & v(const size_type k, const size_type i, const size_type j)
Subscript access to second element of the data contained in the DenseVector3dField3d.
DenseVector3dField3d(const self &rhs)
Constructs a copy of the DenseVector3dField3d rhs.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...
std::reverse_iterator< const_iterator > const_reverse_row_iterator
Provides some algorithms to computes arithmetical operations on ranges.
Provides a class to manipulate Matrix3d.
void fill(const slip::Vector3d< T > &value)
Fills the container range [begin(),begin()+size()) with copies of value.
This is a Dense Vector3d Field. This container statisfies the BidirectionnalContainer concepts of the...
friend class boost::serialization::access
std::reverse_iterator< col_iterator > reverse_col_iterator
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
iterator end()
Returns a read/write iterator that points one past the last element in the GenericMultiComponent3d. Iteration is done in ordinary element order.
slip::Vector3d< T > value_type
Provides some algorithms to apply C like functions to ranges.
This is a Box3d class, a specialized version of slip::Box<CoordType,DIM> with DIM = 3...
std::string name() const
Returns the name of the class.
Provides a class to iterate a 1d range according to a step.
slip::lin_alg_traits< value_type >::value_type norm_type
const vector3d_value_type * const_vector3d_pointer
void read_tecplot(const std::string &file_path_name)
Reads a DenseVector3dField3d from a tecplot file path name.
self & operator/=(const T &val)
GenericMultiComponent3d< slip::Vector3d< T > > base
slip::kstride_iterator< vector3d_pointer, 3 > vector3d_iterator
const vector3d_value_type const_vector3d_reference
slip::DenseVector3dField3d< unsigned int > DenseVector3dField3d_ui
unsigned int alias
norm_type norm(const size_type k, const size_type i, const size_type j) const
Subscript access to a local norm contained in the DenseVector3dField3d.
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
self & operator+=(const T &val)
Add val to each element of the DenseVector3dField3d.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
size_type cols() const
Returns the number of columns (third dimension size) in the GenericMultiComponent3d.
T & Vx2(const size_type k, const size_type i, const size_type j)
Subscript access to second element of the data contained in the DenseVector3dField3d.
This is a point3d class, a specialized version of Point<CoordType,DIM> with DIM = 3...
T & Vx1(const size_type k, const size_type i, const size_type j)
Subscript access to first element of the data contained in the DenseVector3dField3d.
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
size_type dim1() const
Returns the number of slices (first dimension size) in the GenericMultiComponent3d.
Provides a class to manipulate multicomponent 3d containers.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...