SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RegularVector3dField3d.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 
68 
75 #ifndef SLIP_REGULARVECTOR3DFIELD3D_HPP
76 #define SLIP_REGULARVECTOR3DFIELD3D_HPP
77 
78 #include <iostream>
79 #include <fstream>
80 #include <iterator>
81 #include <cassert>
82 #include <numeric>
83 #include <cmath>
84 #include <string>
85 #include <cstddef>
86 #include "Matrix3d.hpp"
87 #include "stride_iterator.hpp"
88 #include "kstride_iterator.hpp"
89 #include "iterator3d_box.hpp"
90 #include "iterator3d_range.hpp"
91 #include "apply.hpp"
92 #include "Vector3d.hpp"
94 #include "derivatives.hpp"
95 #include "arithmetic_op.hpp"
96 #include "io_tools.hpp"
97 #include "linear_algebra_eigen.hpp"
99 #include "tecplot_binaries.hpp"
100 
101 #include <boost/serialization/access.hpp>
102 #include <boost/serialization/split_member.hpp>
103 #include <boost/serialization/version.hpp>
104 #include <boost/serialization/base_object.hpp>
105 
106 namespace slip
107 {
108 
109 template<class T>
110 class stride_iterator;
111 
112 template<class T>
113 class iterator3d_box;
114 
115 template<typename T>
116 class iterator3d_range;
117 
118 template<typename T>
119 class const_iterator3d_box;
120 
121 template<typename T>
122 class const_iterator3d_range;
123 
124 template <class T>
125 class DPoint3d;
126 
127 template <class T>
128 class Point3d;
129 
130 template <class T>
131 class Box3d;
132 
133  template <typename T, typename GridT>
135 
136  template <typename T, typename GridT>
137  std::ostream& operator<<(std::ostream & out, const slip::RegularVector3dField3d<T,GridT>& a);
138 
160  template <typename T, typename GridT = double>
161 class RegularVector3dField3d:public slip::GenericMultiComponent3d<slip::Vector3d<T> >
162 {
163 public :
164 
169 
170 
171  typedef value_type* pointer;
172  typedef const value_type* const_pointer;
174  typedef const value_type& const_reference;
175 
176  typedef ptrdiff_t difference_type;
177  typedef std::size_t size_type;
178 
179  typedef pointer iterator;
181 
182  typedef std::reverse_iterator<iterator> reverse_iterator;
183  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
184 
185 
190 
191  typedef std::reverse_iterator<iterator> reverse_row_iterator;
192  typedef std::reverse_iterator<const_iterator> const_reverse_row_iterator;
193  typedef std::reverse_iterator<col_iterator> reverse_col_iterator;
194  typedef std::reverse_iterator<const_col_iterator> const_reverse_col_iterator;
195 
198 
200  typedef GridT grid_value_type;
207 
209  static const std::size_t DIM = 3;
210 public:
215 
220  base(),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
221  {}
222 
230  const size_type rows,
231  const size_type cols):
232  base(slices,rows,cols),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
233  {}
234 
244  const size_type rows,
245  const size_type cols,
246  const slip::Point3d<GridT>& init_point,
247  const slip::Point3d<GridT>& grid_step):
248  base(slices,rows,cols),init_point_(init_point),grid_step_(grid_step)
249  {}
250 
251 
260  const size_type rows,
261  const size_type cols,
262  const slip::Vector3d<T>& val):
263  base(slices,rows,cols,val),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
264  {}
265 
276  const size_type rows,
277  const size_type cols,
278  const slip::Point3d<GridT>& init_point,
279  const slip::Point3d<GridT>& grid_step,
280  const slip::Vector3d<T>& val):
281  base(slices,rows,cols,val),init_point_(init_point),grid_step_(grid_step)
282  {}
283 
292  const size_type rows,
293  const size_type cols,
294  const T* val):
295  base(slices,rows,cols,val),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
296  {}
297 
309  const size_type rows,
310  const size_type cols,
311  const slip::Point3d<GridT>& init_point,
312  const slip::Point3d<GridT>& grid_step,
313  const T* val):
314  base(slices,rows,cols,val),init_point_(init_point),grid_step_(grid_step)
315  {}
316 
325  const size_type rows,
326  const size_type cols,
327  const slip::Vector3d<T>* val):
328  base(slices,rows,cols,val),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
329  {}
330 
331 
342  const size_type rows,
343  const size_type cols,
344  const slip::Point3d<GridT>& init_point,
345  const slip::Point3d<GridT>& grid_step,
346  const slip::Vector3d<T>* val):
347  base(slices,rows,cols,val),init_point_(init_point),grid_step_(grid_step)
348  {}
349 
350 
362  template<typename InputIterator>
364  const size_type rows,
365  const size_type cols,
366  InputIterator first,
367  InputIterator last):
368  base(slices,rows,cols,first,last),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
369  {}
370 
384  template<typename InputIterator>
386  const size_type rows,
387  const size_type cols,
388  const slip::Point3d<GridT>& init_point,
389  const slip::Point3d<GridT>& grid_step,
390  InputIterator first,
391  InputIterator last):
392  base(slices,rows,cols,first,last),init_point_(init_point),grid_step_(grid_step)
393  {}
394 
395 
412  template<typename InputIterator>
414  const size_type rows,
415  const size_type cols,
416  InputIterator first1,
417  InputIterator last1,
418  InputIterator first2,
419  InputIterator first3):
420  base(slices,rows,cols),init_point_(slip::Point3d<GridT>()),grid_step_(slip::Point3d<GridT>(GridT(1),GridT(1),GridT(1)))
421  {
422 
423  std::vector<InputIterator> first_iterators_list(3);
424  first_iterators_list[0] = first1;
425  first_iterators_list[1] = first2;
426  first_iterators_list[2] = first3;
427  this->fill(first_iterators_list,last1);
428 
429  }
430 
449  template<typename InputIterator>
451  const size_type rows,
452  const size_type cols,
453  const slip::Point3d<GridT>& init_point,
454  const slip::Point3d<GridT>& grid_step,
455  InputIterator first1,
456  InputIterator last1,
457  InputIterator first2,
458  InputIterator first3):
459  base(slices,rows,cols),init_point_(init_point),grid_step_(grid_step)
460  {
461 
462  std::vector<InputIterator> first_iterators_list(3);
463  first_iterators_list[0] = first1;
464  first_iterators_list[1] = first2;
465  first_iterators_list[2] = first3;
466  this->fill(first_iterators_list,last1);
467 
468  }
469 
473  RegularVector3dField3d(const self& rhs):
474  base(rhs),init_point_(rhs.init_point_),grid_step_(rhs.grid_step_)
475  {}
476 
481  {}
482 
483 
491  std::string name() const;
492 
493 
494 
499 
505  friend std::ostream& operator<< <>(std::ostream & out, const self& a);
506 
507 
508 
525  void write_tecplot(const std::string& file_path_name,
526  const std::string& title,
527  const std::string& zone) const;
528 
529 
536  void write_tecplot_bin(const std::string& file_path_name,
537  const std::string& title,
538  const std::string& zone) const;
539 
540 
541 
542 
556  void read_tecplot(const std::string& file_path_name);
557 
563  void read_tecplot_bin(const std::string& file_path_name,
564  const int zone_loaded=1);
565 
566 
573 
574 
580  self& operator=(const slip::Vector3d<T>& val);
581 
582 
588  self& operator=(const T& val);
589 
590 
591 
592 
593 
615  T& Vx1(const size_type k,
616  const size_type i,
617  const size_type j);
618 
634  const T& Vx1(const size_type k,
635  const size_type i,
636  const size_type j) const;
637 
653  T& u(const size_type k,
654  const size_type i,
655  const size_type j);
656 
672  const T& u(const size_type k,
673  const size_type i,
674  const size_type j) const;
675 
676 
677 
678 
694  T& Vx2(const size_type k,
695  const size_type i,
696  const size_type j);
697 
713  const T& Vx2(const size_type k,
714  const size_type i,
715  const size_type j) const;
716 
732  T& v(const size_type k,
733  const size_type i,
734  const size_type j);
735 
751  const T& v(const size_type k,
752  const size_type i,
753  const size_type j) const;
754 
755 
771  T& Vx3(const size_type k,
772  const size_type i,
773  const size_type j);
774 
790  const T& Vx3(const size_type k,
791  const size_type i,
792  const size_type j) const;
793 
809  T& w(const size_type k,
810  const size_type i,
811  const size_type j);
812 
828  const T& w(const size_type k,
829  const size_type i,
830  const size_type j) const;
831 
847  norm_type norm(const size_type k,
848  const size_type i,
849  const size_type j) const;
850 
851 
867  const GridT x1(const size_type k,
868  const size_type i,
869  const size_type j) const;
870 
886  const GridT x2(const size_type k,
887  const size_type i,
888  const size_type j) const;
889 
905  const GridT x3(const size_type k,
906  const size_type i,
907  const size_type j) const;
908 
924  const GridT x(const size_type k,
925  const size_type i,
926  const size_type j) const;
927 
943  const GridT y(const size_type k,
944  const size_type i,
945  const size_type j) const;
946 
962  const GridT z(const size_type k,
963  const size_type i,
964  const size_type j) const;
965 
970  void set_init_point(const slip::Point3d<GridT>& init_point);
971 
976  const slip::Point3d<GridT>& get_init_point() const;
977 
982  void set_grid_step(const slip::Point3d<GridT>& grid_step);
983 
988  const slip::Point3d<GridT>& get_grid_step() const;
1002  self& operator+=(const T& val);
1003  self& operator-=(const T& val);
1004  self& operator*=(const T& val);
1005  self& operator/=(const T& val);
1006 
1007 
1008 
1009  self operator-() const;
1010 
1016  self& operator+=(const slip::Vector3d<T>& val);
1017  self& operator-=(const slip::Vector3d<T>& val);
1018  self& operator*=(const slip::Vector3d<T>& val);
1019  self& operator/=(const slip::Vector3d<T>& val);
1020 
1021 
1022 
1023  self& operator+=(const self& rhs);
1024  self& operator-=(const self& rhs);
1025  self& operator*=(const self& rhs);
1026  self& operator/=(const self& rhs);
1027 
1028 
1035 
1071  template<typename Container3D>
1072  void derivative(const std::size_t component,
1073  const slip::SPATIAL_DIRECTION der_dir,
1074  const std::size_t der_order,
1075  const std::size_t sch_order,
1076  Container3D& result) const
1077  {
1078  assert(component < 3);
1079  assert(sch_order >= der_order);
1080  assert( ((der_dir == X_DIRECTION) && (this->rows() > sch_order))
1081  ||((der_dir == Y_DIRECTION) && (this->cols() > sch_order))
1082  ||((der_dir == Z_DIRECTION) && (this->cols() > sch_order)));
1083  assert(sch_order / 2 <= sch_order);
1084  const std::size_t sch_shift = sch_order / 2;
1085  //computes all kernels
1086  slip::Matrix<double> kernels(sch_order + 1, sch_order + 1);
1087  std::vector<slip::Matrix<double>::iterator> kernels_iterators(sch_order + 1);
1088  for(std::size_t i = 0; i < (sch_order + 1); ++i)
1089  {
1090  kernels_iterators[i] = kernels.row_begin(i);
1091  }
1092 
1093  if(der_dir == X_DIRECTION)
1094  {
1095  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1096  grid_step_[0],
1097  kernels_iterators);
1098  const size_type rows = this->rows();
1099  const size_type slices = this->slices();
1100  for(size_type k = 0; k < slices; ++k)
1101  {
1102  for(size_type i = 0; i < rows; ++i)
1103  {
1104  slip::derivative(this->row_begin(component,k,i),
1105  this->row_end(component,k,i),
1106  der_order,
1107  sch_order,
1108  sch_shift,
1109  kernels_iterators,
1110  result.row_begin(k,i));
1111  }
1112  }
1113  }
1114  if(der_dir == Y_DIRECTION)
1115  {
1116  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1117  grid_step_[1],
1118  kernels_iterators);
1119  const size_type cols = this->cols();
1120  const size_type slices = this->slices();
1121  for(size_type k = 0; k < slices; ++k)
1122  {
1123  for(size_type j = 0; j < cols; ++j)
1124  {
1125  slip::derivative(this->col_rbegin(component,k,j),
1126  this->col_rend(component,k,j),
1127  der_order,
1128  sch_order,
1129  sch_shift,
1130  kernels_iterators,
1131  result.col_rbegin(k,j));
1132  }
1133  }
1134  }
1135  if(der_dir == Z_DIRECTION)
1136  {
1137  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1138  grid_step_[2],
1139  kernels_iterators);
1140  const size_type rows = this->rows();
1141  const size_type cols = this->cols();
1142  for(size_type i = 0; i < rows; ++i)
1143  {
1144  for(size_type j = 0; j < cols; ++j)
1145  {
1146  slip::derivative(this->slice_rbegin(component,i,j),
1147  this->slice_rend(component,i,j),
1148  der_order,
1149  sch_order,
1150  sch_shift,
1151  kernels_iterators,
1152  result.slice_rbegin(i,j));
1153  }
1154  }
1155  }
1156  }
1157 
1158 
1198  template<typename Container3D>
1199  void derivative(const std::size_t component,
1200  const slip::SPATIAL_DIRECTION der_dir,
1201  const std::size_t der_order,
1202  const std::size_t sch_order,
1203  const slip::Box3d<int> box,
1204  Container3D& result) const
1205  {
1206  assert(component < 3);
1207  assert(sch_order >= der_order);
1208  assert( ((der_dir == X_DIRECTION) && (this->rows() > sch_order))
1209  ||((der_dir == Y_DIRECTION) && (this->cols() > sch_order))
1210  ||((der_dir == Z_DIRECTION) && (this->cols() > sch_order)));
1211  assert(sch_order / 2 <= sch_order);
1212  const std::size_t sch_shift = sch_order / 2;
1213  //computes all kernels
1214  slip::Matrix<double> kernels(sch_order + 1, sch_order + 1);
1215  std::vector<slip::Matrix<double>::iterator> kernels_iterators(sch_order + 1);
1216  for(std::size_t i = 0; i < (sch_order + 1); ++i)
1217  {
1218  kernels_iterators[i] = kernels.row_begin(i);
1219  }
1220 
1221  const size_type slices=box.depth();
1222  const size_type rows=box.height();
1223  const size_type cols=box.width();
1224 
1225  if(der_dir == X_DIRECTION)
1226  {
1227  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1228  grid_step_[0],
1229  kernels_iterators);
1230  const slip::Range<int> range_row(box.front_upper_left()[2],box.back_bottom_right()[2],1);
1231  for(int k = box.front_upper_left()[0]; k <= box.back_bottom_right()[0]; ++k)
1232  {
1233  for(int i = box.front_upper_left()[1]; i <= box.back_bottom_right()[1]; ++i)
1234  {
1235  slip::derivative(this->row_begin(component, k,i,range_row),
1236  this->row_end(component, k,i, range_row),
1237  der_order,
1238  sch_order,
1239  sch_shift,
1240  kernels_iterators,
1241  result.row_begin(k,i, range_row));
1242  }
1243  }
1244  }
1245  if(der_dir == Y_DIRECTION)
1246  {
1247  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1248  grid_step_[1],
1249  kernels_iterators);
1250  const slip::Range<int> range_col(box.front_upper_left()[1],box.back_bottom_right()[1],1);
1251  for(int k = box.front_upper_left()[0]; k <= box.back_bottom_right()[0]; ++k)
1252  {
1253  for(int j = box.front_upper_left()[2]; j <= box.back_bottom_right()[2]; ++j)
1254  {
1255  slip::derivative(this->col_rbegin(component, k,j,range_col),
1256  this->col_rend(component, k,j, range_col),
1257  der_order,
1258  sch_order,
1259  sch_shift,
1260  kernels_iterators,
1261  result.col_rbegin(k,j, range_col));
1262  }
1263  }
1264  }
1265  if(der_dir == Z_DIRECTION)
1266  {
1267  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1268  grid_step_[2],
1269  kernels_iterators);
1270  const slip::Range<int> range_slice(box.front_upper_left()[0],box.back_bottom_right()[0],1);
1271  for(int i = box.front_upper_left()[1]; i < box.back_bottom_right()[1]; ++i)
1272  {
1273  for(int j = box.front_upper_left()[2]; j < box.back_bottom_right()[2]; ++j)
1274  {
1275  slip::derivative(this->slice_rbegin(component, i,j,range_slice),
1276  this->slice_rend(component, i,j, range_slice),
1277  der_order,
1278  sch_order,
1279  sch_shift,
1280  kernels_iterators,
1281  result.slice_rbegin(i,j, range_slice));
1282  }
1283  }
1284  }
1285  }
1286 
1305  template<typename Container3D>
1306  void divergence(const std::size_t sch_order,
1307  Container3D& result) const
1308  {
1309  assert(sch_order >= 1);
1310  assert(sch_order / 2 <= sch_order);
1311  const std::size_t der_order = 1;
1312 
1313  //x-derivative of the x component (first component)
1314  slip::Matrix3d<double> Mtmp(this->slices(),this->rows(),this->cols());
1315  std::size_t component = 0;
1316  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,Mtmp);
1317 
1318  //y-derivative of the y component (second component)
1319  component = 1;
1320  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,result);
1321 
1322  //pre-compute the divergence
1323  slip::plus(Mtmp.begin(),Mtmp.end(),result.begin(),result.begin());
1324  //z-derivative of the 2 component (third component)
1325  component = 2;
1326  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,Mtmp);
1327  //compute the divergence
1328  slip::plus(result.begin(),result.end(),Mtmp.begin(),result.begin());
1329 
1330 
1331  }
1332 
1333 
1352  template<typename Container3D>
1353  void vorticity(const std::size_t sch_order,
1354  Container3D& result) const
1355  {
1356  assert(sch_order >= 1);
1357  assert(sch_order / 2 <= sch_order);
1358  const std::size_t sch_shift = sch_order / 2;
1359  const size_type slices = this->slices();
1360  const size_type rows = this->rows();
1361  const size_type cols = this->cols();
1362  //computes all kernels
1363  const std::size_t der_order = 1;
1364  //x kernels
1365  slip::Matrix<double> kernelsx(sch_order + 1, sch_order + 1);
1366  std::vector<slip::Matrix<double>::iterator> kernelsx_iterators(sch_order + 1);
1367  for(std::size_t i = 0; i < (sch_order + 1); ++i)
1368  {
1369  kernelsx_iterators[i] = kernelsx.row_begin(i);
1370  }
1371  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1372  grid_step_[0],
1373  kernelsx_iterators);
1374  //y kernels
1375  slip::Matrix<double> kernelsy(sch_order + 1, sch_order + 1);
1376  std::vector<slip::Matrix<double>::iterator> kernelsy_iterators(sch_order + 1);
1377  for(std::size_t i = 0; i < (sch_order + 1); ++i)
1378  {
1379  kernelsy_iterators[i] = kernelsy.row_begin(i);
1380  }
1381  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1382  grid_step_[1],
1383  kernelsy_iterators);
1384  //z kernels
1385  slip::Matrix<double> kernelsz(sch_order + 1, sch_order + 1);
1386  std::vector<slip::Matrix<double>::iterator> kernelsz_iterators(sch_order + 1);
1387  for(std::size_t i = 0; i < (sch_order + 1); ++i)
1388  {
1389  kernelsz_iterators[i] = kernelsz.row_begin(i);
1390  }
1391  slip::finite_diff_kernels(der_order,sch_order,sch_shift,
1392  grid_step_[2],
1393  kernelsz_iterators);
1394  // compute z component
1395  std::size_t vort_component = 2;
1396  //x-derivative of the y component (second component)
1397  slip::Matrix3d<double> Mtmp(this->slices(),this->rows(),this->cols());
1398  std::size_t component = 1;
1399 
1400  for(size_type k = 0; k < slices; ++k)
1401  {
1402  for(size_type i = 0; i < rows; ++i)
1403  {
1404  slip::derivative(this->row_begin(component,k,i),
1405  this->row_end(component,k,i),
1406  der_order,
1407  sch_order,
1408  sch_shift,
1409  kernelsx_iterators,
1410  Mtmp.row_begin(k,i));
1411  }
1412  }
1413 
1414 
1415  //y-derivative of the x component (first component)
1416  component = 0;
1417  for(size_type k = 0; k < slices; ++k)
1418  {
1419  for(size_type j = 0; j < cols; ++j)
1420  {
1421  slip::derivative(this->col_rbegin(component,k,j),
1422  this->col_rend(component,k,j),
1423  der_order,
1424  sch_order,
1425  sch_shift,
1426  kernelsy_iterators,
1427  result.col_rbegin(vort_component,k,j));
1428  }
1429  }
1430  // z component = dVy/dx-dVx/dy
1431  slip::minus(Mtmp.begin(),Mtmp.end(),result.begin(vort_component),result.begin(vort_component));
1432 
1433  // compute y component
1434  vort_component = 1;
1435  //z-derivative of the x component (first component)
1436  component = 0;
1437  for(size_type i = 0; i < rows; ++i)
1438  {
1439  for(size_type j = 0; j < cols; ++j)
1440  {
1441  slip::derivative(this->slice_rbegin(component,i,j),
1442  this->slice_rend(component,i,j),
1443  der_order,
1444  sch_order,
1445  sch_shift,
1446  kernelsz_iterators,
1447  Mtmp.slice_rbegin(i,j));
1448  }
1449  }
1450  //x-derivative of the z component (third component)
1451  component = 2;
1452  for(size_type k = 0; k < slices; ++k)
1453  {
1454  for(size_type i = 0; i < rows; ++i)
1455  {
1456  slip::derivative(this->row_begin(component,k,i),
1457  this->row_end(component,k,i),
1458  der_order,
1459  sch_order,
1460  sch_shift,
1461  kernelsx_iterators,
1462  result.row_begin(vort_component,k,i));
1463  }
1464  }
1465  // y component = dVx/dz - dVz/dx
1466  slip::minus(Mtmp.begin(),Mtmp.end(),result.begin(vort_component),result.begin(vort_component));
1467 
1468  // compute x component
1469  vort_component = 0;
1470  //z-derivative of the y component (third component)
1471  component = 1;
1472  for(size_type i = 0; i < rows; ++i)
1473  {
1474  for(size_type j = 0; j < cols; ++j)
1475  {
1476  slip::derivative(this->slice_rbegin(component,i,j),
1477  this->slice_rend(component,i,j),
1478  der_order,
1479  sch_order,
1480  sch_shift,
1481  kernelsz_iterators,
1482  Mtmp.slice_rbegin(i,j));
1483  }
1484  }
1485  //y-derivative of the z component (third component)
1486  component = 2;
1487  for(size_type k = 0; k < slices; ++k)
1488  {
1489  for(size_type j = 0; j < cols; ++j)
1490  {
1491  slip::derivative(this->col_rbegin(component,k,j),
1492  this->col_rend(component,k,j),
1493  der_order,
1494  sch_order,
1495  sch_shift,
1496  kernelsy_iterators,
1497  result.col_rbegin(vort_component,k,j));
1498  }
1499  }
1500  // x component = dVz/dy - dVy/dz
1501  slip::minus(result.begin(vort_component),result.end(vort_component),Mtmp.begin(),result.begin(vort_component));
1502  }
1503 
1504 
1505 
1527  template<typename Container3D, typename Container3D1, typename Container3D2, typename Container3D3>
1528  void lambda(const std::size_t sch_order,
1529  Container3D& Lambda, Container3D1& LambdaV1, Container3D2& LambdaV2, Container3D3& LambdaV3) const
1530  {
1531  //D=d(this)/d(x,y,z)
1532  //O=(D-Dt)/2
1533  //S=(D+Dt)/2
1534  //lambda2=eig(S^2+O^2,2)
1535  assert(sch_order >= 1);
1536  const std::size_t der_order = 1;
1537  const size_type slices = this->slices();
1538  const size_type rows = this->rows();
1539  const size_type cols = this->cols();
1540 
1541  // gradient tensor
1542  //derivatives of x component
1543  std::size_t component = 0;
1544  //x-derivative
1545  slip::Matrix3d<double> D11(slices,rows,cols);
1546  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,D11);
1547  //y-derivative
1548  slip::Matrix3d<double> D21(slices,rows,cols);
1549  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,D21);
1550  //z-derivative
1551  slip::Matrix3d<double> D31(slices,rows,cols);
1552  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,D31);
1553  //derivatives of y component
1554  component = 1;
1555  //x-derivative
1556  slip::Matrix3d<double> D12(slices,rows,cols);
1557  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,D12);
1558  //y-derivative
1559  slip::Matrix3d<double> D22(slices,rows,cols);
1560  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,D22);
1561  //z-derivative
1562  slip::Matrix3d<double> D32(slices,rows,cols);
1563  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,D32);
1564  //derivatives of z component
1565  component = 2;
1566  //x-derivative
1567  slip::Matrix3d<double> D13(slices,rows,cols);
1568  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,D13);
1569  //y-derivative
1570  slip::Matrix3d<double> D23(slices,rows,cols);
1571  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,D23);
1572  //z-derivative
1573  slip::Matrix3d<double> D33(slices,rows,cols);
1574  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,D33);
1575 
1576  //symetric tensor
1577  slip::Matrix<double> S(3,3);
1578  //antisymetric tensor
1579  slip::Matrix<double> O(3,3);
1580  // tensor to diagonalize S2O2=S^2+O^2
1581  slip::Matrix<double> S2(3,3),O2(3,3),S2O2(3,3);
1582  // // eigenvalues
1583 // slip::Vector<double> lambda(6); // 2*3 components <=> 3 complex eigenvalues
1584 // // eigenvectors
1585 // slip::Matrix<double> eigenvectors(6,3);// 3 vectors * 2*3 components
1586 // // sort eigenvalues ? no <- sorting is based on absolute value, not suitable with real eigens
1587 // bool sort=false;
1588 // // normalize eigenvectors ? yes
1589 // bool normalize=true;
1590 // // error flag for slip::eigen
1591 // std::size_t ier;
1592 
1593  // eigenvalues
1595  // eigenvectors
1596  slip::Matrix<double> eigenvectors(3,3);
1597 
1598 
1599  Lambda.resize(slices,rows,cols);
1600  LambdaV1.resize(slices,rows,cols);
1601  LambdaV2.resize(slices,rows,cols);
1602  LambdaV3.resize(slices,rows,cols);
1603 
1604  //ça serait mieux avec un iterateur...
1605  for(size_type k = 0; k < slices; ++k)
1606  {
1607  for(size_type i = 0; i < rows; ++i)
1608  {
1609  for(size_type j = 0; j < cols; ++j)
1610  {
1611  S(0,0)=D11[k][i][j];
1612  S(1,1)=D22[k][i][j];
1613  S(2,2)=D33[k][i][j];
1614  S(0,1)=0.5*(D12[k][i][j]+D21[k][i][j]);
1615  S(0,2)=0.5*(D13[k][i][j]+D31[k][i][j]);
1616  S(1,0)=S(0,1);
1617  S(1,2)=0.5*(D23[k][i][j]+D32[k][i][j]);
1618  S(2,0)=S(0,2);
1619  S(2,1)=S(1,2);
1620  O(0,1)=0.5*(D12[k][i][j]-D21[k][i][j]);
1621  O(0,2)=0.5*(D13[k][i][j]-D31[k][i][j]);
1622  O(1,0)=-O(0,1);
1623  O(1,2)=0.5*(D23[k][i][j]-D32[k][i][j]);
1624  O(2,0)=-O(0,2);
1625  O(2,1)=-O(1,2);
1628  S2O2=0.0;
1629  S2O2+=S2;
1630  S2O2+=O2;
1631  // //slip::eigen(S2O2, lambda, ier,sort);
1632 // //slip::eigen(S2O2, lambda, eigenvectors, ier, sort,normalize);
1633 // //std::cout<<k<<" "<<i<<" "<<j<<std::endl;
1634 // eigen(S2O2, lambda, eigenvectors, ier, sort,normalize);
1635 // // lambda2 is the 2nd highest eigenvalue of symetric tensor S^2+O^2 (should be real)
1636 // // sorting is made upon absolute value of the a priori complex eigenvalues -> no sorting here
1637  slip::hermitian_eigen(S2O2,lambda,eigenvectors);
1638  // for(std::size_t kc=0; kc<2; ++kc)
1639 // {
1640 // Lambda[k][i][j][kc]=lambda[2*kc];
1641 
1642 // LambdaV1[k][i][j][kc]=eigenvectors[2*kc][0];
1643 // LambdaV2[k][i][j][kc]=eigenvectors[2*kc][1];
1644 // LambdaV3[k][i][j][kc]=eigenvectors[2*kc][2];
1645 
1646 // }
1647  for(std::size_t kc=0; kc<2; ++kc)
1648  {
1649  Lambda[k][i][j][kc]=lambda[kc];
1650 
1651  LambdaV1[k][i][j][kc]=eigenvectors[kc][0];
1652  LambdaV2[k][i][j][kc]=eigenvectors[kc][1];
1653  LambdaV3[k][i][j][kc]=eigenvectors[kc][2];
1654 
1655  }
1656  }
1657  }
1658  }
1659  }
1660 
1661 
1662 
1681  template<typename Container3D>
1682  void lambda(const std::size_t sch_order,
1683  Container3D& Lambda) const
1684  {
1685  //D=d(this)/d(x,y,z)
1686  //O=(D-Dt)/2
1687  //S=(D+Dt)/2
1688  //lambda2=eig(S^2+O^2,2)
1689  assert(sch_order >= 1);
1690  const std::size_t der_order = 1;
1691  const size_type slices = this->slices();
1692  const size_type rows = this->rows();
1693  const size_type cols = this->cols();
1694 
1695  // gradient tensor
1696  //derivatives of x component
1697  std::size_t component = 0;
1698  //x-derivative
1699  slip::Matrix3d<double> D11(slices,rows,cols);
1700  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,D11);
1701  //y-derivative
1702  slip::Matrix3d<double> D21(slices,rows,cols);
1703  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,D21);
1704  //z-derivative
1705  slip::Matrix3d<double> D31(slices,rows,cols);
1706  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,D31);
1707  //derivatives of y component
1708  component = 1;
1709  //x-derivative
1710  slip::Matrix3d<double> D12(slices,rows,cols);
1711  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,D12);
1712  //y-derivative
1713  slip::Matrix3d<double> D22(slices,rows,cols);
1714  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,D22);
1715  //z-derivative
1716  slip::Matrix3d<double> D32(slices,rows,cols);
1717  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,D32);
1718  //derivatives of z component
1719  component = 2;
1720  //x-derivative
1721  slip::Matrix3d<double> D13(slices,rows,cols);
1722  this->derivative(component,slip::X_DIRECTION,der_order,sch_order,D13);
1723  //y-derivative
1724  slip::Matrix3d<double> D23(slices,rows,cols);
1725  this->derivative(component,slip::Y_DIRECTION,der_order,sch_order,D23);
1726  //z-derivative
1727  slip::Matrix3d<double> D33(slices,rows,cols);
1728  this->derivative(component,slip::Z_DIRECTION,der_order,sch_order,D33);
1729 
1730  //symetric tensor
1731  slip::Matrix<double> S(3,3);
1732  //antisymetric tensor
1733  slip::Matrix<double> O(3,3);
1734  // tensor to diagonalize S2O2=S^2+O^2
1735  slip::Matrix<double> S2(3,3),O2(3,3),S2O2(3,3);
1736  // // eigenvalues
1737 // slip::Vector<double> lambda(6); // 2*3 components <=> 3 complex eigenvalues
1738 // // eigenvectors
1739 // slip::Matrix<double> eigenvectors(6,3);// 3 vectors * 2*3 components
1740 // // sort eigenvalues ? no
1741 // bool sort=false;
1742 // // error flag for slip::eigen
1743 // std::size_t ier;
1744 
1745  // eigenvalues
1747  // eigenvectors
1748  slip::Matrix<double> eigenvectors(3,3);
1749 
1750  Lambda.resize(slices,rows,cols);
1751 
1752  //ça serait mieux avec un iterateur...
1753  for(size_type k = 0; k < slices; ++k)
1754  {
1755  for(size_type i = 0; i < rows; ++i)
1756  {
1757  for(size_type j = 0; j < cols; ++j)
1758  {
1759  S(0,0)=D11[k][i][j];
1760  S(1,1)=D22[k][i][j];
1761  S(2,2)=D33[k][i][j];
1762  S(0,1)=0.5*(D12[k][i][j]+D21[k][i][j]);
1763  S(0,2)=0.5*(D13[k][i][j]+D31[k][i][j]);
1764  S(1,0)=S(0,1);
1765  S(1,2)=0.5*(D23[k][i][j]+D32[k][i][j]);
1766  S(2,0)=S(0,2);
1767  S(2,1)=S(1,2);
1768  O(0,1)=0.5*(D12[k][i][j]-D21[k][i][j]);
1769  O(0,2)=0.5*(D13[k][i][j]-D31[k][i][j]);
1770  O(1,0)=-O(0,1);
1771  O(1,2)=0.5*(D23[k][i][j]-D32[k][i][j]);
1772  O(2,0)=-O(0,2);
1773  O(2,1)=-O(1,2);
1776  S2O2=0.0;
1777  S2O2+=S2;
1778  S2O2+=O2;
1779 
1780  // slip::eigen(S2O2, lambda, ier,sort);
1781 // // lambda2 is the 2nd highest eigenvalue of symetric tensor S^2+O^2 (should be real)
1782 // // sorting is made upon absolute value of the a priori complex eigenvalues -> no sorting here
1783  slip::hermitian_eigen(S2O2,lambda,eigenvectors);
1784  // for(std::size_t kc=0; kc<2; ++kc)
1785 // {
1786 // Lambda[k][i][j][kc]=lambda[2*kc];
1787 // }
1788  for(std::size_t kc = 0; kc < 2; ++kc)
1789  {
1790  Lambda[k][i][j][kc]=lambda[kc];
1791  }
1792  }
1793  }
1794  }
1795 
1796 }
1797 
1806  template<typename Container3D>
1807  void norm(Container3D& result) const
1808  {
1809  //typedef slip::Vector3d<double> vector;
1810  //std::transform(this->begin(),this->end(),result.begin(),std::mem_fun_ref(&vector::Euclidean_norm));
1811  std::transform(this->begin(),this->end(),result.begin(),std::mem_fun_ref(&value_type::Euclidean_norm));
1812 
1813  }
1814 
1817 private:
1818  slip::Point3d<GridT> init_point_;
1819  slip::Point3d<GridT> grid_step_;
1820 
1821 
1822 
1823 private :
1825  template<class Archive>
1826  void save(Archive & ar, const unsigned int version) const
1827  {
1828  ar & init_point_ & grid_step_;
1829  ar & boost::serialization::base_object<slip::GenericMultiComponent3d<slip::Vector3d<T> > >(*this);
1830  }
1831  template<class Archive>
1832  void load(Archive & ar, const unsigned int version)
1833  {
1834  ar & init_point_ & grid_step_;
1835  ar & boost::serialization::base_object<slip::GenericMultiComponent3d<slip::Vector3d<T> > >(*this);
1836  }
1837  BOOST_SERIALIZATION_SPLIT_MEMBER()
1838 
1839 
1840  };
1841 
1850 
1871 
1872 
1873 }//slip::
1874 
1875 namespace slip{
1876 
1877 
1884 template<typename T, typename GridT>
1885 RegularVector3dField3d<T,GridT> operator+(const RegularVector3dField3d<T,GridT>& M1,
1886  const T& val);
1887 
1894  template<typename T, typename GridT>
1895  RegularVector3dField3d<T,GridT> operator+(const T& val,
1896  const RegularVector3dField3d<T,GridT>& M1);
1897 
1898 
1905 template<typename T, typename GridT>
1906 RegularVector3dField3d<T,GridT> operator-(const RegularVector3dField3d<T,GridT>& M1,
1907  const T& val);
1908 
1915  template<typename T, typename GridT>
1916  RegularVector3dField3d<T,GridT> operator-(const T& val,
1917  const RegularVector3dField3d<T,GridT>& M1);
1918 
1919 
1920 
1927  template<typename T, typename GridT>
1928  RegularVector3dField3d<T,GridT> operator*(const RegularVector3dField3d<T,GridT>& M1,
1929  const T& val);
1930 
1937  template<typename T, typename GridT>
1938  RegularVector3dField3d<T,GridT> operator*(const T& val,
1939  const RegularVector3dField3d<T,GridT>& M1);
1940 
1941 
1942 
1949  template<typename T, typename GridT>
1950  RegularVector3dField3d<T,GridT> operator/(const RegularVector3dField3d<T,GridT>& M1,
1951  const T& val);
1952 
1953 
1962 template<typename T, typename GridT>
1963 RegularVector3dField3d<T,GridT> operator+(const RegularVector3dField3d<T,GridT>& M1,
1964  const RegularVector3dField3d<T,GridT>& M2);
1965 
1972 template<typename T, typename GridT>
1973 RegularVector3dField3d<T,GridT> operator+(const RegularVector3dField3d<T,GridT>& M1,
1974  const slip::Vector3d<T>& val);
1975 
1982  template<typename T, typename GridT>
1983  RegularVector3dField3d<T,GridT> operator+(const slip::Vector3d<T>& val,
1984  const RegularVector3dField3d<T,GridT>& M1);
1985 
1986 
1987 
1996 template<typename T, typename GridT>
1997 RegularVector3dField3d<T,GridT> operator-(const RegularVector3dField3d<T,GridT>& M1,
1998  const RegularVector3dField3d<T,GridT>& M2);
1999 
2000 
2007 template<typename T, typename GridT>
2008 RegularVector3dField3d<T,GridT> operator-(const RegularVector3dField3d<T,GridT>& M1,
2009  const slip::Vector3d<T>& val);
2010 
2017  template<typename T, typename GridT>
2018  RegularVector3dField3d<T,GridT> operator-(const slip::Vector3d<T>& val,
2019  const RegularVector3dField3d<T,GridT>& M1);
2020 
2021 
2022 
2031  template<typename T, typename GridT>
2032  RegularVector3dField3d<T,GridT> operator*(const RegularVector3dField3d<T,GridT>& M1,
2033  const RegularVector3dField3d<T,GridT>& M2);
2034 
2035 
2042 template<typename T, typename GridT>
2043 RegularVector3dField3d<T,GridT> operator*(const RegularVector3dField3d<T,GridT>& M1,
2044  const slip::Vector3d<T>& val);
2045 
2052  template<typename T, typename GridT>
2053  RegularVector3dField3d<T,GridT> operator*(const slip::Vector3d<T>& val,
2054  const RegularVector3dField3d<T,GridT>& M1);
2055 
2056 
2057 
2066  template<typename T, typename GridT>
2067  RegularVector3dField3d<T,GridT> operator/(const RegularVector3dField3d<T,GridT>& M1,
2068  const RegularVector3dField3d<T,GridT>& M2);
2069 
2076 template<typename T, typename GridT>
2077 RegularVector3dField3d<T,GridT> operator/(const RegularVector3dField3d<T,GridT>& M1,
2078  const slip::Vector3d<T>& val);
2079 
2080 
2081 
2082 
2083 }//slip::
2084 
2085 namespace slip
2086 {
2087 
2088 
2089 // template<typename T, typename GridT>
2090 // inline
2091 // RegularVector3dField3d<T,GridT>& RegularVector3dField3d<T,GridT>::operator=(const RegularVector3dField3d<T,GridT> & rhs)
2092 // {
2093 // if(this != &rhs)
2094 // {
2095 // *matrix_ = *(rhs.matrix_);
2096 // }
2097 // return *this;
2098 // }
2099 
2100  template<typename T, typename GridT>
2101  inline
2103  {
2104  std::fill_n(this->begin(),this->size(),val);
2105  return *this;
2106  }
2107 
2108 
2109  template<typename T, typename GridT>
2110  inline
2112  {
2113  std::fill_n(this->begin(),this->size(),val);
2114  return *this;
2115  }
2116 
2117 
2118  template<typename T, typename GridT>
2119  inline
2121  const typename RegularVector3dField3d::size_type i,
2122  const typename RegularVector3dField3d::size_type j)
2123  {
2124  return (*this)[k][i][j][0];
2125  }
2126 
2127  template<typename T, typename GridT>
2128  inline
2130  const typename RegularVector3dField3d::size_type i,
2131  const typename RegularVector3dField3d::size_type j) const
2132  {
2133  return (*this)[k][i][j][0];
2134  }
2135 
2136  template<typename T, typename GridT>
2137  inline
2139  const typename RegularVector3dField3d::size_type i,
2140  const typename RegularVector3dField3d::size_type j)
2141  {
2142  return this->Vx1(k,i,j);
2143  }
2144 
2145  template<typename T, typename GridT>
2146  inline
2148  const typename RegularVector3dField3d::size_type i,
2149  const typename RegularVector3dField3d::size_type j) const
2150  {
2151  return this->Vx1(k,i,j);
2152  }
2153 
2154 
2155  template<typename T, typename GridT>
2156  inline
2158  const typename RegularVector3dField3d::size_type i,
2159  const typename RegularVector3dField3d::size_type j)
2160  {
2161  return (*this)[k][i][j][1];
2162  }
2163 
2164 
2165  template<typename T, typename GridT>
2166  inline
2168  const typename RegularVector3dField3d::size_type i,
2169  const typename RegularVector3dField3d::size_type j) const
2170  {
2171  return (*this)[k][i][j][1];
2172  }
2173  template<typename T, typename GridT>
2174  inline
2176  const typename RegularVector3dField3d::size_type i,
2177  const typename RegularVector3dField3d::size_type j)
2178  {
2179  return this->Vx2(k,i,j);
2180  }
2181 
2182 
2183  template<typename T, typename GridT>
2184  inline
2186  const typename RegularVector3dField3d::size_type i,
2187  const typename RegularVector3dField3d::size_type j) const
2188  {
2189  return this->Vx2(k,i,j);
2190  }
2191 
2192 
2193  template<typename T, typename GridT>
2194  inline
2196  const typename RegularVector3dField3d::size_type i,
2197  const typename RegularVector3dField3d::size_type j)
2198  {
2199  return (*this)[k][i][j][2];
2200  }
2201 
2202  template<typename T, typename GridT>
2203  inline
2205  const typename RegularVector3dField3d::size_type i,
2206  const typename RegularVector3dField3d::size_type j) const
2207  {
2208  return (*this)[k][i][j][2];
2209  }
2210 
2211  template<typename T, typename GridT>
2212  inline
2214  const typename RegularVector3dField3d::size_type i,
2215  const typename RegularVector3dField3d::size_type j)
2216  {
2217  return this->Vx3(k,i,j);
2218  }
2219 
2220  template<typename T, typename GridT>
2221  inline
2223  const typename RegularVector3dField3d::size_type i,
2224  const typename RegularVector3dField3d::size_type j) const
2225  {
2226  return this->Vx3(k,i,j);
2227  }
2228 
2229 
2230  template<typename T, typename GridT>
2231  inline
2234  const typename RegularVector3dField3d::size_type i,
2235  const typename RegularVector3dField3d::size_type j) const
2236  {
2237  return (*this)[k][i][j].Euclidean_norm();
2238  }
2239 
2240  template<typename T, typename GridT>
2241  inline
2243  const typename RegularVector3dField3d::size_type i,
2244  const typename RegularVector3dField3d::size_type j) const
2245  {
2246  return this->init_point_[0] + GridT(j) * this->grid_step_[0];
2247  }
2248 
2249  template<typename T, typename GridT>
2250  inline
2252  const typename RegularVector3dField3d::size_type i,
2253  const typename RegularVector3dField3d::size_type j) const
2254  {
2255  return this->init_point_[1] + GridT(this->rows() - 1 - i) * this->grid_step_[1];
2256  }
2257 
2258  template<typename T, typename GridT>
2259  inline
2261  const typename RegularVector3dField3d::size_type i,
2262  const typename RegularVector3dField3d::size_type j) const
2263  {
2264  return this->init_point_[2] + GridT(this->slices() - 1 - k) * this->grid_step_[2];
2265  }
2266 
2267  template<typename T, typename GridT>
2268  inline
2270  const typename RegularVector3dField3d::size_type i,
2271  const typename RegularVector3dField3d::size_type j) const
2272  {
2273  return this->x1(k,i,j);
2274  }
2275 
2276  template<typename T, typename GridT>
2277  inline
2279  const typename RegularVector3dField3d::size_type i,
2280  const typename RegularVector3dField3d::size_type j) const
2281  {
2282  return this->x2(k,i,j);
2283  }
2284 
2285  template<typename T, typename GridT>
2286  inline
2288  const typename RegularVector3dField3d::size_type i,
2289  const typename RegularVector3dField3d::size_type j) const
2290  {
2291  return this->x3(k,i,j);
2292  }
2293 
2294  template<typename T, typename GridT>
2295  inline
2297  {
2298  return this->init_point_;
2299  }
2300 
2301  template<typename T, typename GridT>
2302  inline
2304  {
2305  this->init_point_ = init_point;
2306  }
2307 
2308  template<typename T, typename GridT>
2309  inline
2311  {
2312  return this->grid_step_;
2313  }
2314 
2315  template<typename T, typename GridT>
2316  inline
2318  {
2319  this->grid_step_ = grid_step;
2320  }
2321 
2322  template<typename T, typename GridT>
2323  inline
2325  {
2326  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::plus<slip::Vector3d<T> >(),val));
2327  return *this;
2328  }
2329 
2330  template<typename T, typename GridT>
2331  inline
2333  {
2334  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::minus<slip::Vector3d<T> >(),val));
2335  return *this;
2336  }
2337 
2338  template<typename T, typename GridT>
2339  inline
2341  {
2342  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::multiplies<slip::Vector3d<T> >(),val));
2343  return *this;
2344  }
2345 
2346  template<typename T, typename GridT>
2347  inline
2349  {
2350  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::divides<slip::Vector3d<T> >(),val));
2351  return *this;
2352  }
2353 
2354 
2355 
2356  template<typename T, typename GridT>
2357  inline
2359  {
2360  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::plus<slip::Vector3d<T> >(),val));
2361  return *this;
2362  }
2363 
2364  template<typename T, typename GridT>
2365  inline
2367  {
2368  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::minus<slip::Vector3d<T> >(),val));
2369  return *this;
2370  }
2371 
2372  template<typename T, typename GridT>
2373  inline
2375  {
2376  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::multiplies<slip::Vector3d<T> >(),val));
2377  return *this;
2378  }
2379 
2380  template<typename T, typename GridT>
2381  inline
2383  {
2384  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::divides<slip::Vector3d<T> >(),val));
2385  return *this;
2386  }
2387 
2388 
2389 
2390  template<typename T, typename GridT>
2391  inline
2393  {
2395  std::transform(this->begin(),this->end(),tmp.begin(),std::negate<slip::Vector3d<T> >());
2396  return tmp;
2397  }
2398 
2399  template<typename T, typename GridT>
2400  inline
2402  {
2403  assert(this->dim1() == rhs.dim1());
2404  assert(this->dim2() == rhs.dim2());
2405  assert(this->dim3() == rhs.dim3());
2406  if(this->get_init_point() != rhs.get_init_point())
2407  {
2408  throw std::runtime_error(slip::GRID_INIT_POINT_ERROR);
2409  }
2410  if(this->get_grid_step() != rhs.get_grid_step())
2411  {
2412  throw std::runtime_error(slip::GRID_STEP_ERROR);
2413  }
2414  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::plus<typename RegularVector3dField3d::value_type>());
2415  return *this;
2416  }
2417 
2418  template<typename T, typename GridT>
2419  inline
2421  {
2422  assert(this->dim1() == rhs.dim1());
2423  assert(this->dim2() == rhs.dim2());
2424  assert(this->dim3() == rhs.dim3());
2425  if(this->get_init_point() != rhs.get_init_point())
2426  {
2427  throw std::runtime_error(slip::GRID_INIT_POINT_ERROR);
2428  }
2429  if(this->get_grid_step() != rhs.get_grid_step())
2430  {
2431  throw std::runtime_error(slip::GRID_STEP_ERROR);
2432  }
2433  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::minus<typename RegularVector3dField3d::value_type>());
2434  return *this;
2435  }
2436 
2437  template<typename T, typename GridT>
2438  inline
2440  {
2441  assert(this->dim1() == rhs.dim1());
2442  assert(this->dim2() == rhs.dim2());
2443  assert(this->dim3() == rhs.dim3());
2444  if(this->get_init_point() != rhs.get_init_point())
2445  {
2446  throw std::runtime_error(slip::GRID_INIT_POINT_ERROR);
2447  }
2448  if(this->get_grid_step() != rhs.get_grid_step())
2449  {
2450  throw std::runtime_error(slip::GRID_STEP_ERROR);
2451  }
2452  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::multiplies<typename RegularVector3dField3d::value_type>());
2453  return *this;
2454  }
2455 
2456  template<typename T, typename GridT>
2457  inline
2459  {
2460  assert(this->dim1() == rhs.dim1());
2461  assert(this->dim2() == rhs.dim2());
2462  assert(this->dim3() == rhs.dim3());
2463  if(this->get_init_point() != rhs.get_init_point())
2464  {
2465  throw std::runtime_error(slip::GRID_INIT_POINT_ERROR);
2466  }
2467  if(this->get_grid_step() != rhs.get_grid_step())
2468  {
2469  throw std::runtime_error(slip::GRID_STEP_ERROR);
2470  }
2471  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::divides<typename RegularVector3dField3d::value_type>());
2472  return *this;
2473  }
2474 
2475 
2476  template <typename T, typename GridT>
2477  inline
2478  std::ostream& operator<<(std::ostream & out,
2480  {
2481 
2482  out<<"init point: "<<a.init_point_<<std::endl;
2483  out<<"grid step: "<<a.grid_step_<<std::endl;
2484  out<<"data: "<<std::endl;
2485  typedef typename RegularVector3dField3d<T,GridT>::size_type size_type;
2486  const size_type slices = a.slices();
2487  const size_type rows = a.rows();
2488  const size_type cols = a.cols();
2489  for(size_type k = 0; k < slices; ++k)
2490  {
2491  for(size_type i = 0; i < rows; ++i)
2492  {
2493  for(size_type j = 0; j < cols; ++j)
2494  {
2495  out<<a[k][i][j]<<" ";
2496  }
2497  out<<std::endl;
2498  }
2499  out<<std::endl;
2500  }
2501  return out;
2502  }
2503 
2504  template<typename T, typename GridT>
2505  inline
2506  std::string
2507  RegularVector3dField3d<T,GridT>::name() const {return "RegularVector3dField3d";}
2508 
2509 
2510  // template<typename T, typename GridT>
2511 // inline
2512 // void RegularVector3dField3d<T,GridT>::write_gnuplot(const std::string& file_path_name)
2513 // {
2514 // slip::write_gnuplot_vect3d<RegularVector3dField3d<T,GridT> >(*this,file_path_name);
2515 // }
2516 
2517  template<typename T, typename GridT>
2518  inline
2519  void RegularVector3dField3d<T,GridT>::write_tecplot(const std::string& file_path_name,
2520  const std::string& title,
2521  const std::string& zone) const
2522  {
2523  slip::write_tecplot_vect3d<RegularVector3dField3d<T,GridT> >(*this,
2524  this->init_point_,
2525  this->grid_step_,
2526  file_path_name,
2527  title,zone);
2528 
2529  }
2530 
2531  template<typename T, typename GridT>
2532  inline
2533  void RegularVector3dField3d<T,GridT>::write_tecplot_bin(const std::string& file_path_name,
2534  const std::string& title,
2535  const std::string& zone) const
2536  {
2537  slip::RegularVector3dField3d_to_plt(file_path_name,
2538  *this,
2539  title,
2540  zone);
2541 
2542  }
2543 
2544  // template<typename T, typename GridT>
2545 // inline
2546 // void RegularVector3dField3d<T,GridT>::read_gnuplot(const std::string& file_path_name)
2547 // {
2548 // slip::read_gnuplot_vect3d<RegularVector3dField3d<T,GridT> >(file_path_name,*this);
2549 // }
2550 
2551  template<typename T, typename GridT>
2552  inline
2553  void RegularVector3dField3d<T,GridT>::read_tecplot(const std::string& file_path_name)
2554  {
2555  slip::read_tecplot_vect3d<RegularVector3dField3d<T,GridT> >(file_path_name,
2556  *this,
2557  this->init_point_,
2558  this->grid_step_);
2559  }
2560 
2561  template<typename T, typename GridT>
2562  inline
2563  void RegularVector3dField3d<T,GridT>::read_tecplot_bin(const std::string& file_path_name,
2564  const int zone_loaded)
2565  {
2566  std::string _useless_string;
2567  std::vector<std::string> _useless_varnames;
2568  slip::plt_to_RegularVector3dField3d(file_path_name,
2569  *this,
2570  _useless_string,
2571  _useless_string,
2572  _useless_varnames,
2573  zone_loaded);
2574  }
2575 
2576  template<typename T, typename GridT>
2577  inline
2579  const T& val)
2580  {
2582  tmp += val;
2583  return tmp;
2584  }
2585 
2586  template<typename T, typename GridT>
2587  inline
2590  {
2591  return M1 + val;
2592  }
2593 
2594  template<typename T, typename GridT>
2595  inline
2597  const T& val)
2598  {
2600  tmp -= val;
2601  return tmp;
2602  }
2603 
2604  template<typename T, typename GridT>
2605  inline
2608  {
2609  return -(M1 - val);
2610  }
2611 
2612 
2613  template<typename T, typename GridT>
2614  inline
2616  const T& val)
2617  {
2619  tmp *= val;
2620  return tmp;
2621  }
2622 
2623  template<typename T, typename GridT>
2624  inline
2627  {
2628  return M1 * val;
2629  }
2630 
2631 
2632  template<typename T, typename GridT>
2633  inline
2635  const T& val)
2636  {
2638  tmp /= val;
2639  return tmp;
2640  }
2641 
2642  template<typename T, typename GridT>
2643  inline
2646  {
2647 
2649  tmp+=M2;
2650  return tmp;
2651  }
2652 
2653 
2654  template<typename T, typename GridT>
2655  inline
2657  const slip::Vector3d<T>&val)
2658  {
2660  tmp += val;
2661  return tmp;
2662  }
2663 
2664  template<typename T, typename GridT>
2665  inline
2668  {
2669  return M1 + val;
2670  }
2671 
2672 
2673 
2674  template<typename T, typename GridT>
2675  inline
2678  {
2679 
2681  tmp-=M2;
2682  return tmp;
2683  }
2684 
2685 
2686  template<typename T, typename GridT>
2687  inline
2689  const slip::Vector3d<T>&val)
2690  {
2692  tmp -= val;
2693  return tmp;
2694  }
2695 
2696  template<typename T, typename GridT>
2697  inline
2700  {
2701  return -(M1 - val);
2702  }
2703 
2704 
2705  template<typename T, typename GridT>
2706  inline
2709  {
2710 
2712  tmp*=M2;
2713  return tmp;
2714  }
2715 
2716 
2717  template<typename T, typename GridT>
2718  inline
2720  const slip::Vector3d<T>&val)
2721  {
2723  tmp *= val;
2724  return tmp;
2725  }
2726 
2727  template<typename T, typename GridT>
2728  inline
2731  {
2732  return M1 * val;
2733  }
2734 
2735 
2736  template<typename T, typename GridT>
2737  inline
2740  {
2741 
2743  tmp/=M2;
2744  return tmp;
2745  }
2746 
2747 
2748  template<typename T, typename GridT>
2749  inline
2751  const slip::Vector3d<T>&val)
2752  {
2754  tmp /= val;
2755  return tmp;
2756  }
2757 
2758 
2759 
2760 
2761 }//slip::
2762 
2763 #endif //SLIP_REGULARVECTOR3DFIELD3D_HPP
void minus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the difference of two ranges.
slip::RegularVector3dField3d< double, double > RegularVector3dField3d_d
double alias
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
void write_tecplot(const std::string &file_path_name, const std::string &title, const std::string &zone) const
Writes a RegularVector3dField3d to a tecplot file path name.
RegularVector3dField3d< double, double > Regular3D3Cd
double alias
void read_tecplot(const std::string &file_path_name)
Reads a RegularVector3dField3d from a tecplot file path name.
CoordType width() const
compute the width of the Box3d.
Definition: Box3d.hpp:408
const GridT x(const size_type k, const size_type i, const size_type j) const
Subscript access to the real x1 value of the indexed (k,i,j) point of the RegularVector3dField3d.
slip::RegularVector3dField3d< float, float > RegularVector3dField3d_f
float alias
RegularVector3dField3d< float, double > Regular3D3C_f
float alias
self & operator+=(const T &val)
Add val to each element of the RegularVector3dField3d.
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 RegularVector3dField3d.
size_type dim3() const
Returns the number of columns (third dimension size) in the GenericMultiComponent3d.
const GridT y(const size_type k, const size_type i, const size_type j) const
Subscript access to the real x2 value of the indexed (k,i,j) point of the RegularVector3dField3d.
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
slip::kstride_iterator< const_vector3d_pointer, 3 > const_vector3d_iterator
iterator begin()
Returns a read/write iterator that points to the first element in the GenericMultiComponent3d. Iteration is done in ordinary element order.
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:602
row_iterator row_begin(const size_type slice, const size_type row)
Returns a read/write iterator that points to the first element of the row row of the slice slice in t...
std::reverse_iterator< const_iterator > const_reverse_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.
slip::RegularVector3dField3d< unsigned short, double > RegularVector3dField3d_us
unsigned long alias
slip::RegularVector3dField3d< unsigned long, double > RegularVector3dField3d_ul
unsigned long alias
vector3d_value_type & vector3d_reference
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Matrix3d. Iteration is done in ordinary element order.
Definition: Matrix3d.hpp:3953
slip::RegularVector3dField3d< unsigned char, double > RegularVector3dField3d_uc
unsigned char alias
Provides some derivative algorithms and derivative functors.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Point3d< GridT > &init_point, const slip::Point3d< GridT > &grid_step, InputIterator first1, InputIterator last1, InputIterator first2, InputIterator first3)
Contructs a RegularVector3dField3d from a 3 ranges.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Point3d< GridT > &init_point, const slip::Point3d< GridT > &grid_step, InputIterator first, InputIterator last)
Contructs a RegularVector3dField3d from a range.
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.
const GridT x2(const size_type k, const size_type i, const size_type j) const
Subscript access to the real x2 value of the indexed (k,i,j) point of the RegularVector3dField3d.
reverse_slice_iterator slice_rbegin(const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (row,col) threw the slices ...
std::reverse_iterator< col_iterator > reverse_col_iterator
void set_grid_step(const slip::Point3d< GridT > &grid_step)
Write access to the grid step of the grid.
Provides a class to manipulate iterator3d within a slip::Range. It is used to iterate throw 3d contai...
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols)
Constructs a RegularVector3dField3d.
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
reverse_col_iterator col_rbegin(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the last element of the column column of the sli...
void front_upper_left(Point< CoordType, 3 >)
Accessor/Mutator of the front_upper_left point (p1) of Box3d.
Definition: Box3d.hpp:355
row_iterator row_begin(const size_type slice, const size_type row)
Returns a read/write iterator that points to the first element of the row row of the slice slice in t...
void hermitian_eigen(const Matrix1 &A, Vector1 &EigenValues, Matrix2 &EigenVectors)
Eigen Values Computation of an hermitian semi-definite positive matrix.
const RegularVector3dField3d< T, GridT > const_self
const slip::Point3d< GridT > & get_grid_step() const
Read access to the init point of the grid.
row_iterator row_end(const size_type slice, const size_type row)
Returns a read/write iterator that points to the past-the-end element of the row row of the slice sli...
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
void norm(Container3D &result) const
Computes Eucliean norm of each element in the field and write it to a Container3D.
Provides some tecplot binary input/ouput algorithms.
void lambda(const std::size_t sch_order, Container3D &Lambda, Container3D1 &LambdaV1, Container3D2 &LambdaV2, Container3D3 &LambdaV3) const
Computes finite differences lambda of a RegularVector3dField3d.
const slip::Point3d< GridT > & get_init_point() const
Read access to the init point of the grid.
void write_tecplot_bin(const std::string &file_path_name, const std::string &title, const std::string &zone) const
Writes a RegularVector3dField3d to a tecplot binary file.
void read_tecplot_bin(const std::string &file_path_name, const int zone_loaded=1)
Reads a RegularVector3dField3d from a binary tecplot file.
slip::GenericMultiComponent3d< slip::Vector3d< T > >::const_iterator2d const_iterator3d
This is a GenericMultiComponent3d class. This container statisfies the BidirectionnalContainer concep...
Numerical matrix3d class. This container statisfies the RandomAccessContainer concepts of the STL exc...
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.
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 RegularVector3dField3d.
Provides some algorithms to computes eigenvalues and eigenvectors.
slip::RegularVector3dField3d< short, double > RegularVector3dField3d_s
short alias
Provides a class to manipulate 3d Vector.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Point3d< GridT > &init_point, const slip::Point3d< GridT > &grid_step, const T *val)
Constructs a RegularVector3dField3d initialized by an array val.
reverse_col_iterator col_rend(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the first element of the column column of the sl...
RegularVector3dField3d< double, double > Regular3D3C_d
double alias
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, InputIterator first1, InputIterator last1, InputIterator first2, InputIterator first3)
Contructs a RegularVector3dField3d from a 3 ranges.
Provides a class to manipulate iterator2d within a slip::Box3d. It is used to iterate throw 3d contai...
RegularVector3dField3d< float, double > Regular3D3Cf
float alias
Numerical Vector class. This container statisfies the RandomAccessContainer concepts of the Standard ...
Definition: Vector.hpp:104
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 RegularVector3dField3d.
const GridT z(const size_type k, const size_type i, const size_type j) const
Subscript access to the real x3 value of the indexed (k,i,j) point of the RegularVector3dField3d.
slip::RegularVector3dField3d< int, double > RegularVector3dField3d_i
int alias
void divergence(const std::size_t sch_order, Container3D &result) const
Computes finite differences divergence of a RegularVector3dField3d.
const std::string GRID_STEP_ERROR
Definition: error.hpp:88
void plt_to_RegularVector3dField3d(const std::string &file_path_name, RegularVector3dField3d &reg, std::string &title, std::string &zonename, std::vector< std::string > &varnames, const int zone_loaded=1)
Read a slip::RegularVector3dField3d from a binary tecplot file.
const GridT x1(const size_type k, const size_type i, const size_type j) const
Subscript access to the real x1 value of the indexed (k,i,j) point of the RegularVector3dField3d.
const std::string GRID_INIT_POINT_ERROR
Definition: error.hpp:87
void RegularVector3dField3d_to_plt(const std::string &file_path_name, RegularVector3dField3d &reg, std::string title, std::string zone, const double SolTime, std::vector< std::string > varnames=std::vector< std::string >(), const int FileType=0)
Write a slip::RegularVector3dField3d to a binary tecplot file.
CoordType depth() const
compute the depth of the Box3d.
Definition: Box3d.hpp:416
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 RegularVector3dField3d.
void matrix_matrix_multiplies(MatrixIterator1 M1_up, MatrixIterator1 M1_bot, MatrixIterator2 M2_up, MatrixIterator2 M2_bot, MatrixIterator3 R_up, MatrixIterator3 R_bot)
Computes the matrix matrix multiplication of 2 2d ranges.
slip::stride_iterator< pointer > col_iterator
Provides some input/ouput algorithms.
Numerical matrix class. This container statisfies the BidirectionnalContainer concepts of the STL...
GenericMultiComponent3d< slip::Vector3d< T > > base
Provides some algorithms to computes arithmetical operations on ranges.
slip::RegularVector3dField3d< unsigned int, double > RegularVector3dField3d_ui
unsigned int alias
void derivative(const std::size_t component, const slip::SPATIAL_DIRECTION der_dir, const std::size_t der_order, const std::size_t sch_order, Container3D &result) const
Computes finite differences derivatives of a RegularVector3dField3d.
Provides a class to manipulate Matrix3d.
std::ostream & operator<<(std::ostream &out, const Array< T > &a)
Definition: Array.hpp:1282
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const T *val)
Constructs a RegularVector3dField3d initialized by an array val.
void fill(const slip::Vector3d< T > &value)
Fills the container range [begin(),begin()+size()) with copies of value.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, InputIterator first, InputIterator last)
Contructs a RegularVector3dField3d from a range.
self & operator=(const slip::Vector3d< T > &val)
Affects all the element of the RegularVector3dField3d by val.
void back_bottom_right(Point< CoordType, 3 >)
Accessor/Mutator of the back_bottom_right point (p2) of Box3d.
Definition: Box3d.hpp:368
reverse_slice_iterator slice_rend(const size_type row, const size_type col)
Returns a read/write iterator that points to the one before the first element of the line (row...
slip::stride_iterator< const_pointer > const_col_iterator
const vector3d_value_type const_vector3d_reference
void set_init_point(const slip::Point3d< GridT > &init_point)
Write access to the init point of the grid.
iterator end()
Returns a read/write iterator that points one past the last element in the GenericMultiComponent3d. Iteration is done in ordinary element order.
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 RegularVector3dField3d.
SPATIAL_DIRECTION
Choose between different spatial directions.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Vector3d< T > *val)
Constructs a RegularVector3dField3d initialized by an array val.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Vector3d< T > &val)
Constructs a RegularVector3dField3d initialized by the scalar value val.
This is a Regular Vector3d Field. This container statisfies the BidirectionnalContainer concepts of t...
Provides some algorithms to apply C like functions to ranges.
void lambda(const std::size_t sch_order, Container3D &Lambda) const
Computes finite differences lambda of a RegularVector3dField3d.
const GridT x3(const size_type k, const size_type i, const size_type j) const
Subscript access to the real x3 value of the indexed (k,i,j) point of the RegularVector3dField3d.
std::reverse_iterator< const_iterator > const_reverse_row_iterator
void vorticity(const std::size_t sch_order, Container3D &result) const
Computes finite differences vorticity of a RegularVector3dField3d.
Provides a class to iterate a 1d range according to a step.
std::string name() const
Returns the name of the class.
slip::GenericMultiComponent3d< slip::Vector3d< T > >::iterator3d iterator3d
const vector3d_value_type * const_vector3d_pointer
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 RegularVector3dField3d.
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 RegularVector3dField3d.
void derivative(SrcIter first, SrcIter last, const std::size_t der_ord, const std::size_t sch_ord, const std::size_t sch_shift, const Container2D &M, ResIter result)
Computes 1d finite differences derivatives of an iterator range.
~RegularVector3dField3d()
Destructor of the RegularVector3dField3d.
reverse_slice_iterator slice_rbegin(const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (row,col) threw the slices ...
void finite_diff_kernels(const std::size_t der_ord, const std::size_t sch_ord, const std::size_t sch_shift, std::vector< KernelsIterator > &kernels_first)
Computes finite differences kernels for derivation based on Taylor series (sch_ord-sch_shift steps up...
slip::kstride_iterator< vector3d_pointer, 3 > vector3d_iterator
slip::RegularVector3dField3d< long, double > RegularVector3dField3d_l
long alias
std::reverse_iterator< iterator > reverse_row_iterator
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Point3d< GridT > &init_point, const slip::Point3d< GridT > &grid_step, const slip::Vector3d< T > &val)
Constructs a RegularVector3dField3d initialized by the scalar value val.
row_iterator row_begin(const size_type row)
Returns a read/write iterator that points to the first element of the row row in the Matrix...
friend class boost::serialization::access
RegularVector3dField3d()
Constructs a RegularVector3dField3d.
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:658
iterator end()
Returns a read/write iterator that points one past the last element in the Matrix3d. Iteration is done in ordinary element order.
Definition: Matrix3d.hpp:3946
CoordType height() const
compute the height of the Box3d.
Definition: Box3d.hpp:412
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Point3d< GridT > &init_point, const slip::Point3d< GridT > &grid_step)
Constructs a RegularVector3dField3d.
std::reverse_iterator< iterator > reverse_iterator
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.
RegularVector3dField3d(const self &rhs)
Constructs a copy of the RegularVector3dField3d rhs.
This is a point3d class, a specialized version of Point<CoordType,DIM> with DIM = 3...
void derivative(const std::size_t component, const slip::SPATIAL_DIRECTION der_dir, const std::size_t der_order, const std::size_t sch_order, const slip::Box3d< int > box, Container3D &result) const
Computes finite differences derivatives of a RegularVector3dField3d in a box.
slip::RegularVector3dField3d< char, double > RegularVector3dField3d_c
char alias
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.
RegularVector3dField3d(const size_type slices, const size_type rows, const size_type cols, const slip::Point3d< GridT > &init_point, const slip::Point3d< GridT > &grid_step, const slip::Vector3d< T > *val)
Constructs a RegularVector3dField3d initialized by an array val.
Provides a class to manipulate multicomponent 3d containers.
slip::lin_alg_traits< value_type >::value_type norm_type
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...