SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DenseVector3dField3d.hpp
Go to the documentation of this file.
1 /*
2  * Copyright(c):
3  * Signal Image and Communications (SIC) Department
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * - University of Poitiers, France http://www.univ-poitiers.fr
6  * - XLIM Institute UMR CNRS 7252 http://www.xlim.fr/
7  *
8  * and
9  *
10  * D2 Fluid, Thermic and Combustion
11  * - University of Poitiers, France http://www.univ-poitiers.fr
12  * - PPRIME Institute - UPR CNRS 3346 http://www.pprime.fr
13  * - ISAE-ENSMA http://www.ensma.fr
14  *
15  * Contributor(s):
16  * The SLIP team,
17  * Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>,
18  * Laurent David <laurent.david_AT_lea.univ-poitiers.fr>,
19  * Ludovic Chatellier <ludovic.chatellier_AT_univ-poitiers.fr>,
20  * Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>,
21  * Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>,
22  * Julien Dombre <julien.dombre_AT_univ-poitiers.fr>.
23  *
24  * Description:
25  * The Simple Library of Image Processing (SLIP) is a new image processing
26  * library. It is written in the C++ language following as much as possible
27  * the ISO/ANSI C++ standard. It is consequently compatible with any system
28  * satisfying the ANSI C++ complience. It works on different Unix , Linux ,
29  * Mircrosoft Windows and Mac OS X plateforms. SLIP is a research library that
30  * was created by the Signal, Image and Communications (SIC) departement of
31  * the XLIM, UMR 7252 CNRS Institute in collaboration with the Fluids, Thermic
32  * and Combustion departement of the P', UPR 3346 CNRS Institute of the
33  * University of Poitiers.
34  *
35  * The SLIP Library source code has been registered to the APP (French Agency
36  * for the Protection of Programs) by the University of Poitiers and CNRS,
37  * under registration number IDDN.FR.001.300034.000.S.P.2010.000.21000.
38 
39  * http://www.sic.sp2mi.univ-poitiers.fr/slip/
40  *
41  * This software is governed by the CeCILL-C license under French law and
42  * abiding by the rules of distribution of free software. You can use,
43  * modify and/ or redistribute the software under the terms of the CeCILL-C
44  * license as circulated by CEA, CNRS and INRIA at the following URL
45  * http://www.cecill.info.
46  * As a counterpart to the access to the source code and rights to copy,
47  * modify and redistribute granted by the license, users are provided only
48  * with a limited warranty and the software's author, the holder of the
49  * economic rights, and the successive licensors have only limited
50  * liability.
51  *
52  * In this respect, the user's attention is drawn to the risks associated
53  * with loading, using, modifying and/or developing or reproducing the
54  * software by the user in light of its specific status of free software,
55  * that may mean that it is complicated to manipulate, and that also
56  * therefore means that it is reserved for developers and experienced
57  * professionals having in-depth computer knowledge. Users are therefore
58  * encouraged to load and test the software's suitability as regards their
59  * requirements in conditions enabling the security of their systems and/or
60  * data to be ensured and, more generally, to use and operate it in the
61  * same conditions as regards security.
62  *
63  * The fact that you are presently reading this means that you have had
64  * knowledge of the CeCILL-C license and that you accept its terms.
65  */
66 
67 
74 #ifndef SLIP_DENSEVECTOR3DFIELD3D_HPP
75 #define SLIP_DENSEVECTOR3DFIELD3D_HPP
76 
77 #include <iostream>
78 #include <fstream>
79 #include <iterator>
80 #include <cassert>
81 #include <numeric>
82 #include <cmath>
83 #include <string>
84 #include <cstddef>
85 #include "Matrix3d.hpp"
86 #include "stride_iterator.hpp"
87 #include "kstride_iterator.hpp"
88 #include "iterator3d_box.hpp"
89 #include "iterator3d_range.hpp"
90 #include "apply.hpp"
91 #include "Vector3d.hpp"
93 #include "derivatives.hpp"
94 #include "arithmetic_op.hpp"
95 #include "io_tools.hpp"
97 
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>
102 
103 namespace slip
104 {
105 
106 template<class T>
107 class stride_iterator;
108 
109 template<class T>
111 
112 template<typename T>
114 
115 template<typename T>
117 
118 template<typename T>
120 
121 template <class T>
122 class DPoint3d;
123 
124 template <class T>
125 class Point3d;
126 
127 template <class T>
128 class Box3d;
129 
130 template <typename T>
132 
133 
134 
154 template <typename T>
155 class DenseVector3dField3d:public slip::GenericMultiComponent3d<slip::Vector3d<T> >
156 {
157 public :
158 
162 
163 
164  typedef value_type* pointer;
165  typedef const value_type* const_pointer;
167  typedef const value_type& const_reference;
168 
169  typedef ptrdiff_t difference_type;
170  typedef std::size_t size_type;
171 
172  typedef pointer iterator;
174 
175  typedef std::reverse_iterator<iterator> reverse_iterator;
176  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
177 
178 
183 
184  typedef std::reverse_iterator<iterator> reverse_row_iterator;
185  typedef std::reverse_iterator<const_iterator> const_reverse_row_iterator;
186  typedef std::reverse_iterator<col_iterator> reverse_col_iterator;
187  typedef std::reverse_iterator<const_col_iterator> const_reverse_col_iterator;
188 
191 
199 
201  static const std::size_t DIM = 3;
202 public:
207 
212  base()
213  {}
214 
222  const size_type rows,
223  const size_type cols):
224  base(slices,rows,cols)
225  {}
226 
235  const size_type rows,
236  const size_type cols,
237  const slip::Vector3d<T>& val):
238  base(slices,rows,cols,val)
239  {}
240 
249  const size_type rows,
250  const size_type cols,
251  const T* val):
252  base(slices,rows,cols,val)
253  {}
254 
263  const size_type rows,
264  const size_type cols,
265  const slip::Vector3d<T>* val):
266  base(slices,rows,cols,val)
267  {}
268 
269 
281  template<typename InputIterator>
283  const size_type rows,
284  const size_type cols,
285  InputIterator first,
286  InputIterator last):
287  base(slices,rows,cols,first,last)
288  {}
289 
290 
291 
292 
309  template<typename InputIterator>
311  const size_type rows,
312  const size_type cols,
313  InputIterator first1,
314  InputIterator last1,
315  InputIterator first2,
316  InputIterator first3):
317  base(slices,rows,cols)
318  {
319 
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);
325 
326  }
327 
328 
332  DenseVector3dField3d(const self& rhs):
333  base(rhs)
334  {}
335 
340  {}
341 
342 
350  std::string name() const;
351 
352 
353 
358 
359 
376  void write_tecplot(const std::string& file_path_name,
377  const std::string& title,
378  const std::string& zone);
379 
380 
381 
382 
396  void read_tecplot(const std::string& file_path_name);
397 
398 
405 
406 
407 
413  self& operator=(const slip::Vector3d<T>& val);
414 
415 
421  self& operator=(const T& val);
422 
423 
424 
425 
426 
448  T& Vx1(const size_type k,
449  const size_type i,
450  const size_type j);
451 
467  const T& Vx1(const size_type k,
468  const size_type i,
469  const size_type j) const;
485  T& u(const size_type k,
486  const size_type i,
487  const size_type j);
488 
504  const T& u(const size_type k,
505  const size_type i,
506  const size_type j) const;
507 
508 
524  T& Vx2(const size_type k,
525  const size_type i,
526  const size_type j);
527 
543  const T& Vx2(const size_type k,
544  const size_type i,
545  const size_type j) const;
561  T& v(const size_type k,
562  const size_type i,
563  const size_type j);
564 
580  const T& v(const size_type k,
581  const size_type i,
582  const size_type j) const;
583 
584 
585 
601  T& Vx3(const size_type k,
602  const size_type i,
603  const size_type j);
604 
620  const T& Vx3(const size_type k,
621  const size_type i,
622  const size_type j) const;
623 
639  T& w(const size_type k,
640  const size_type i,
641  const size_type j);
642 
658  const T& w(const size_type k,
659  const size_type i,
660  const size_type j) const;
661 
677  norm_type norm(const size_type k,
678  const size_type i,
679  const size_type j) const;
680 
687 
688 
701  self& operator+=(const T& val);
702  self& operator-=(const T& val);
703  self& operator*=(const T& val);
704  self& operator/=(const T& val);
705 
706 // self& operator%=(const T& val);
707 // self& operator^=(const T& val);
708 // self& operator&=(const T& val);
709 // self& operator|=(const T& val);
710 // self& operator<<=(const T& val);
711 // self& operator>>=(const T& val);
712 
713 
714  self operator-() const;
715 // self operator!() const;
716 
722  self& operator+=(const slip::Vector3d<T>& val);
723  self& operator-=(const slip::Vector3d<T>& val);
724  self& operator*=(const slip::Vector3d<T>& val);
725  self& operator/=(const slip::Vector3d<T>& val);
726 
727 
728 
729  self& operator+=(const self& rhs);
730  self& operator-=(const self& rhs);
731  self& operator*=(const self& rhs);
732  self& operator/=(const self& rhs);
733 
734 
741 
742 
743 
752  template<typename Container3D>
753  void norm(Container3D& result)
754  {
755  //typedef slip::Vector3d<double> vector;
756  std::transform(this->begin(),this->end(),result.begin(),std::mem_fun_ref(&value_type::Euclidean_norm));
757 
758  }
759 
760 
762 private :
764  template<class Archive>
765  void save(Archive & ar, const unsigned int version) const
766  {
767  ar & boost::serialization::base_object<slip::GenericMultiComponent3d<slip::Vector3d<T> > >(*this);
768  }
769  template<class Archive>
770  void load(Archive & ar, const unsigned int version)
771  {
772  ar & boost::serialization::base_object<slip::GenericMultiComponent3d<slip::Vector3d<T> > >(*this);
773  }
774  BOOST_SERIALIZATION_SPLIT_MEMBER()
775  };
776 
797 
798 
799 }//slip::
800 
801 namespace slip{
802 
804  /* @{ */
811 template<typename T>
812 DenseVector3dField3d<T> operator+(const DenseVector3dField3d<T>& M1,
813  const T& val);
814 
821  template<typename T>
822  DenseVector3dField3d<T> operator+(const T& val,
823  const DenseVector3dField3d<T>& M1);
824 
825 
832 template<typename T>
833 DenseVector3dField3d<T> operator-(const DenseVector3dField3d<T>& M1,
834  const T& val);
835 
842  template<typename T>
843  DenseVector3dField3d<T> operator-(const T& val,
844  const DenseVector3dField3d<T>& M1);
845 
846 
847 
854  template<typename T>
855  DenseVector3dField3d<T> operator*(const DenseVector3dField3d<T>& M1,
856  const T& val);
857 
864  template<typename T>
865  DenseVector3dField3d<T> operator*(const T& val,
866  const DenseVector3dField3d<T>& M1);
867 
868 
869 
876  template<typename T>
877  DenseVector3dField3d<T> operator/(const DenseVector3dField3d<T>& M1,
878  const T& val);
879 
880 
889 template<typename T>
890 DenseVector3dField3d<T> operator+(const DenseVector3dField3d<T>& M1,
891  const DenseVector3dField3d<T>& M2);
892 
899 template<typename T>
900 DenseVector3dField3d<T> operator+(const DenseVector3dField3d<T>& M1,
901  const slip::Vector3d<T>& val);
902 
909  template<typename T>
910  DenseVector3dField3d<T> operator+(const slip::Vector3d<T>& val,
911  const DenseVector3dField3d<T>& M1);
912 
913 
914 
923 template<typename T>
924 DenseVector3dField3d<T> operator-(const DenseVector3dField3d<T>& M1,
925  const DenseVector3dField3d<T>& M2);
926 
927 
934 template<typename T>
935 DenseVector3dField3d<T> operator-(const DenseVector3dField3d<T>& M1,
936  const slip::Vector3d<T>& val);
937 
944  template<typename T>
945  DenseVector3dField3d<T> operator-(const slip::Vector3d<T>& val,
946  const DenseVector3dField3d<T>& M1);
947 
948 
949 
958  template<typename T>
959  DenseVector3dField3d<T> operator*(const DenseVector3dField3d<T>& M1,
960  const DenseVector3dField3d<T>& M2);
961 
962 
969 template<typename T>
970 DenseVector3dField3d<T> operator*(const DenseVector3dField3d<T>& M1,
971  const slip::Vector3d<T>& val);
972 
979  template<typename T>
980  DenseVector3dField3d<T> operator*(const slip::Vector3d<T>& val,
981  const DenseVector3dField3d<T>& M1);
982 
983 
984 
993  template<typename T>
994  DenseVector3dField3d<T> operator/(const DenseVector3dField3d<T>& M1,
995  const DenseVector3dField3d<T>& M2);
996 
1003 template<typename T>
1004 DenseVector3dField3d<T> operator/(const DenseVector3dField3d<T>& M1,
1005  const slip::Vector3d<T>& val);
1006 
1007 
1008 /* @} */
1009 
1010 }//slip::
1011 
1012 namespace slip
1013 {
1014 
1015 
1016 
1017  template<typename T>
1018  inline
1020  {
1021  std::fill_n(this->begin(),this->size(),val);
1022  return *this;
1023  }
1024 
1025 
1026  template<typename T>
1027  inline
1029  {
1030  std::fill_n(this->begin(),this->size(),val);
1031  return *this;
1032  }
1033 
1034 
1035  template<typename T>
1036  inline
1038  const typename DenseVector3dField3d::size_type i,
1039  const typename DenseVector3dField3d::size_type j)
1040  {
1041  return (*this)[k][i][j][0];
1042  }
1043 
1044  template<typename T>
1045  inline
1047  const typename DenseVector3dField3d::size_type i,
1048  const typename DenseVector3dField3d::size_type j) const
1049  {
1050  return (*this)[k][i][j][0];
1051  }
1052  template<typename T>
1053  inline
1055  const typename DenseVector3dField3d::size_type i,
1056  const typename DenseVector3dField3d::size_type j)
1057  {
1058  return this->Vx1(k,i,j);
1059  }
1060 
1061  template<typename T>
1062  inline
1064  const typename DenseVector3dField3d::size_type i,
1065  const typename DenseVector3dField3d::size_type j) const
1066  {
1067  return this->Vx1(k,i,j);
1068  }
1069 
1070  template<typename T>
1071  inline
1073  const typename DenseVector3dField3d::size_type i,
1074  const typename DenseVector3dField3d::size_type j)
1075  {
1076  return (*this)[k][i][j][1];
1077  }
1078 
1079 
1080  template<typename T>
1081  inline
1083  const typename DenseVector3dField3d::size_type i,
1084  const typename DenseVector3dField3d::size_type j) const
1085  {
1086  return (*this)[k][i][j][1];
1087  }
1088 
1089  template<typename T>
1090  inline
1092  const typename DenseVector3dField3d::size_type i,
1093  const typename DenseVector3dField3d::size_type j)
1094  {
1095  return this->Vx2(k,i,j);
1096  }
1097 
1098 
1099  template<typename T>
1100  inline
1102  const typename DenseVector3dField3d::size_type i,
1103  const typename DenseVector3dField3d::size_type j) const
1104  {
1105  return this->Vx2(k,i,j);
1106  }
1107 
1108  template<typename T>
1109  inline
1111  const typename DenseVector3dField3d::size_type i,
1112  const typename DenseVector3dField3d::size_type j)
1113  {
1114  return (*this)[k][i][j][2];
1115  }
1116 
1117  template<typename T>
1118  inline
1120  const typename DenseVector3dField3d::size_type i,
1121  const typename DenseVector3dField3d::size_type j) const
1122  {
1123  return (*this)[k][i][j][2];
1124  }
1125  template<typename T>
1126  inline
1128  const typename DenseVector3dField3d::size_type i,
1129  const typename DenseVector3dField3d::size_type j)
1130  {
1131  return this->Vx3(k,i,j);
1132  }
1133 
1134  template<typename T>
1135  inline
1137  const typename DenseVector3dField3d::size_type i,
1138  const typename DenseVector3dField3d::size_type j) const
1139  {
1140  return this->Vx3(k,i,j);
1141  }
1142  template<typename T>
1143  inline
1146  const typename DenseVector3dField3d::size_type i,
1147  const typename DenseVector3dField3d::size_type j) const
1148  {
1149  return (*this)[k][i][j].Euclidean_norm();
1150  }
1151 
1152 
1153  template<typename T>
1154  inline
1156  {
1157  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::plus<slip::Vector3d<T> >(),val));
1158  return *this;
1159  }
1160 
1161  template<typename T>
1162  inline
1164  {
1165  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::minus<slip::Vector3d<T> >(),val));
1166  return *this;
1167  }
1168 
1169  template<typename T>
1170  inline
1172  {
1173  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::multiplies<slip::Vector3d<T> >(),val));
1174  return *this;
1175  }
1176 
1177  template<typename T>
1178  inline
1180  {
1181  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::divides<slip::Vector3d<T> >(),val));
1182  return *this;
1183  }
1184 
1185 
1186 
1187  template<typename T>
1188  inline
1190  {
1191  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::plus<slip::Vector3d<T> >(),val));
1192  return *this;
1193  }
1194 
1195  template<typename T>
1196  inline
1198  {
1199  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::minus<slip::Vector3d<T> >(),val));
1200  return *this;
1201  }
1202 
1203  template<typename T>
1204  inline
1206  {
1207  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::multiplies<slip::Vector3d<T> >(),val));
1208  return *this;
1209  }
1210 
1211  template<typename T>
1212  inline
1214  {
1215  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::divides<slip::Vector3d<T> >(),val));
1216  return *this;
1217  }
1218 
1219 
1220 
1221  template<typename T>
1222  inline
1224  {
1225  DenseVector3dField3d<T> tmp(*this);
1226  std::transform(this->begin(),this->end(),tmp.begin(),std::negate<slip::Vector3d<T> >());
1227  return tmp;
1228  }
1229 
1230  template<typename T>
1231  inline
1233  {
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>());
1238  return *this;
1239  }
1240 
1241  template<typename T>
1242  inline
1244  {
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>());
1249  return *this;
1250  }
1251 
1252  template<typename T>
1253  inline
1255  {
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>());
1260  return *this;
1261  }
1262 
1263  template<typename T>
1264  inline
1266  {
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>());
1271  return *this;
1272  }
1273 
1274  template<typename T>
1275  inline
1276  std::string
1277  DenseVector3dField3d<T>::name() const {return "DenseVector3dField3d";}
1278 
1279 
1280  // template<typename T>
1281 // inline
1282 // void DenseVector3dField3d<T>::write_gnuplot(const std::string& file_path_name)
1283 // {
1284 // slip::write_gnuplot_vect3d<DenseVector3dField3d<T> >(*this,file_path_name);
1285 // }
1286 
1287  template<typename T>
1288  inline
1289  void DenseVector3dField3d<T>::write_tecplot(const std::string& file_path_name,
1290  const std::string& title,
1291  const std::string& zone)
1292  {
1293  slip::write_tecplot_vect3d<DenseVector3dField3d<T> >(*this,file_path_name,
1294  title,zone);
1295 
1296  }
1297 
1298  // template<typename T>
1299 // inline
1300 // void DenseVector3dField3d<T>::read_gnuplot(const std::string& file_path_name)
1301 // {
1302 // slip::read_gnuplot_vect3d<DenseVector3dField3d<T> >(file_path_name,*this);
1303 // }
1304 
1305  template<typename T>
1306  inline
1307  void DenseVector3dField3d<T>::read_tecplot(const std::string& file_path_name)
1308  {
1309  slip::read_tecplot_vect3d<DenseVector3dField3d<T> >(file_path_name,*this);
1310  }
1311 
1312 
1313  template<typename T>
1314  inline
1316  const T& val)
1317  {
1318  DenseVector3dField3d<T> tmp = M1;
1319  tmp += val;
1320  return tmp;
1321  }
1322 
1323  template<typename T>
1324  inline
1326  const DenseVector3dField3d<T>& M1)
1327  {
1328  return M1 + val;
1329  }
1330 
1331  template<typename T>
1332  inline
1334  const T& val)
1335  {
1336  DenseVector3dField3d<T> tmp = M1;
1337  tmp -= val;
1338  return tmp;
1339  }
1340 
1341  template<typename T>
1342  inline
1344  const DenseVector3dField3d<T>& M1)
1345  {
1346  return -(M1 - val);
1347  }
1348 
1349 
1350  template<typename T>
1351  inline
1353  const T& val)
1354  {
1355  DenseVector3dField3d<T> tmp = M1;
1356  tmp *= val;
1357  return tmp;
1358  }
1359 
1360  template<typename T>
1361  inline
1363  const DenseVector3dField3d<T>& M1)
1364  {
1365  return M1 * val;
1366  }
1367 
1368 
1369  template<typename T>
1370  inline
1372  const T& val)
1373  {
1374  DenseVector3dField3d<T> tmp = M1;
1375  tmp /= val;
1376  return tmp;
1377  }
1378 
1379  template<typename T>
1380  inline
1382  const DenseVector3dField3d<T>& M2)
1383  {
1384  assert(M1.dim1() == M2.dim1());
1385  assert(M1.dim2() == M2.dim2());
1386  assert(M1.dim3() == M2.dim3());
1387  DenseVector3dField3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
1388  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::plus<slip::Vector3d<T> >());
1389  return tmp;
1390  }
1391 
1392 
1393  template<typename T>
1394  inline
1396  const slip::Vector3d<T>&val)
1397  {
1398  DenseVector3dField3d<T> tmp = M1;
1399  tmp += val;
1400  return tmp;
1401  }
1402 
1403  template<typename T>
1404  inline
1406  const DenseVector3dField3d<T>& M1)
1407  {
1408  return M1 + val;
1409  }
1410 
1411 
1412 
1413  template<typename T>
1414  inline
1416  const DenseVector3dField3d<T>& M2)
1417  {
1418  assert(M1.dim1() == M2.dim1());
1419  assert(M1.dim2() == M2.dim2());
1420  assert(M1.dim3() == M2.dim3());
1421  DenseVector3dField3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
1422  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::minus<slip::Vector3d<T> >());
1423  return tmp;
1424  }
1425 
1426 
1427  template<typename T>
1428  inline
1430  const slip::Vector3d<T>&val)
1431  {
1432  DenseVector3dField3d<T> tmp = M1;
1433  tmp -= val;
1434  return tmp;
1435  }
1436 
1437  template<typename T>
1438  inline
1440  const DenseVector3dField3d<T>& M1)
1441  {
1442  return -(M1 - val);
1443  }
1444 
1445 
1446  template<typename T>
1447  inline
1449  const DenseVector3dField3d<T>& M2)
1450  {
1451  assert(M1.dim1() == M2.dim1());
1452  assert(M1.dim2() == M2.dim2());
1453  assert(M1.dim3() == M2.dim3());
1454  DenseVector3dField3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
1455  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::multiplies<slip::Vector3d<T> >());
1456  return tmp;
1457  }
1458 
1459 
1460  template<typename T>
1461  inline
1463  const slip::Vector3d<T>&val)
1464  {
1465  DenseVector3dField3d<T> tmp = M1;
1466  tmp *= val;
1467  return tmp;
1468  }
1469 
1470  template<typename T>
1471  inline
1473  const DenseVector3dField3d<T>& M1)
1474  {
1475  return M1 * val;
1476  }
1477 
1478 
1479  template<typename T>
1480  inline
1482  const DenseVector3dField3d<T>& M2)
1483  {
1484  assert(M1.dim1() == M2.dim1());
1485  assert(M1.dim2() == M2.dim2());
1486  assert(M1.dim3() == M2.dim3());
1487  DenseVector3dField3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
1488  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::divides<slip::Vector3d<T> >());
1489  return tmp;
1490  }
1491 
1492 
1493  template<typename T>
1494  inline
1496  const slip::Vector3d<T>&val)
1497  {
1498  DenseVector3dField3d<T> tmp = M1;
1499  tmp /= val;
1500  return tmp;
1501  }
1502 
1503 
1504 
1505 
1506 }//slip::
1507 
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.
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.
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...
Definition: Vector3d.hpp:96
norm_type Euclidean_norm() const
Returns the Euclidean norm of the elements of the kvector.
Definition: KVector.hpp:832
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)
Definition: Color.hpp:602
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.
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
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...
Definition: KVector.hpp:196
vector3d_value_type * vector3d_pointer
slip::DenseVector3dField3d< char > DenseVector3dField3d_c
char alias
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
DenseVector3dField3d(const size_type slices, const size_type rows, const size_type cols, InputIterator first, InputIterator last)
Contructs a DenseVector3dField3d from a range.
Provides some input/ouput algorithms.
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.
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...
Definition: Box3d.hpp:121
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.
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)
Definition: Color.hpp:658
self & operator+=(const T &val)
Add val to each element of the DenseVector3dField3d.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:686
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)
Definition: Color.hpp:630
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...