75 #ifndef SLIP_DENSEVECTOR3DFIELD2D_HPP
76 #define SLIP_DENSEVECTOR3DFIELD2D_HPP
94 #include <boost/serialization/access.hpp>
95 #include <boost/serialization/split_member.hpp>
96 #include <boost/serialization/version.hpp>
97 #include <boost/serialization/base_object.hpp>
103 class stride_iterator;
106 class iterator2d_box;
117 template <
typename T>
139 template <
typename T>
184 static const std::size_t
DIM = 2;
217 base(height,width,val)
229 base(height,width,val)
241 base(height,width,val)
255 template<
typename InputIterator>
260 base(height,width,first,last)
281 template<
typename InputIterator>
284 InputIterator first1,
286 InputIterator first2,
287 InputIterator first3):
291 std::vector<InputIterator> first_iterators_list(3);
292 first_iterators_list[0] = first1;
293 first_iterators_list[1] = first2;
294 first_iterators_list[2] = first3;
295 this->
fill(first_iterators_list,last1);
322 std::string
name()
const;
353 const std::string& title,
354 const std::string& zone);
543 template<
class Archive>
544 void save(Archive & ar,
const unsigned int version)
const
546 ar & boost::serialization::base_object<slip::GenericMultiComponent2d<slip::Vector3d<T> > >(*this);
548 template<
class Archive>
549 void load(Archive & ar,
const unsigned int version)
551 ar & boost::serialization::base_object<slip::GenericMultiComponent2d<slip::Vector3d<T> > >(*this);
553 BOOST_SERIALIZATION_SPLIT_MEMBER()
590 DenseVector3dField2d<T>
operator+(
const DenseVector3dField2d<T>& M1,
600 DenseVector3dField2d<T>
operator+(
const T& val,
601 const DenseVector3dField2d<T>& M1);
611 DenseVector3dField2d<T>
operator-(
const DenseVector3dField2d<T>& M1,
621 DenseVector3dField2d<T>
operator-(
const T& val,
622 const DenseVector3dField2d<T>& M1);
633 DenseVector3dField2d<T>
operator*(
const DenseVector3dField2d<T>& M1,
643 DenseVector3dField2d<T>
operator*(
const T& val,
644 const DenseVector3dField2d<T>& M1);
655 DenseVector3dField2d<T>
operator/(
const DenseVector3dField2d<T>& M1,
668 DenseVector3dField2d<T>
operator+(
const DenseVector3dField2d<T>& M1,
669 const DenseVector3dField2d<T>& M2);
678 DenseVector3dField2d<T>
operator+(
const DenseVector3dField2d<T>& M1,
689 const DenseVector3dField2d<T>& M1);
702 DenseVector3dField2d<T>
operator-(
const DenseVector3dField2d<T>& M1,
703 const DenseVector3dField2d<T>& M2);
713 DenseVector3dField2d<T>
operator-(
const DenseVector3dField2d<T>& M1,
724 const DenseVector3dField2d<T>& M1);
737 DenseVector3dField2d<T>
operator*(
const DenseVector3dField2d<T>& M1,
738 const DenseVector3dField2d<T>& M2);
748 DenseVector3dField2d<T>
operator*(
const DenseVector3dField2d<T>& M1,
759 const DenseVector3dField2d<T>& M1);
772 DenseVector3dField2d<T>
operator/(
const DenseVector3dField2d<T>& M1,
773 const DenseVector3dField2d<T>& M2);
782 DenseVector3dField2d<T>
operator/(
const DenseVector3dField2d<T>& M1,
809 std::fill_n(this->begin(),this->size(),val);
818 std::fill_n(this->begin(),this->size(),val);
828 return (*
this)[i][j][0];
836 return (*
this)[i][j][0];
844 return (*
this)[i][j][1];
853 return (*
this)[i][j][1];
862 return (*
this)[i][j][2];
870 return (*
this)[i][j][2];
946 std::transform(this->begin(),this->end(),tmp.
begin(),std::negate<slip::Vector3d<T> >());
954 assert(this->dim1() == rhs.
dim1());
955 assert(this->dim2() == rhs.
dim2());
956 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::plus<typename DenseVector3dField2d::value_type>());
964 assert(this->dim1() == rhs.
dim1());
965 assert(this->dim2() == rhs.
dim2());
966 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::minus<typename DenseVector3dField2d::value_type>());
974 assert(this->dim1() == rhs.
dim1());
975 assert(this->dim2() == rhs.
dim2());
976 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::multiplies<typename DenseVector3dField2d::value_type>());
984 assert(this->dim1() == rhs.
dim1());
985 assert(this->dim2() == rhs.
dim2());
986 std::transform(this->begin(),this->end(),rhs.
begin(),this->begin(),std::divides<typename DenseVector3dField2d::value_type>());
1000 std::ofstream sortie(file_path_name.c_str(),std::ios::out);
1004 std::cerr<<
"Fail to open the file "<<file_path_name<<std::endl;
1012 sortie<<
"#zone f=point, i="<<dim1<<
", j="<<dim2<<
"\n";
1017 sortie<<i<<
" "<<j<<
" "<<(*this)[i][j][0]<<
" "<<(*this)[i][j][1]<<(*this)[i][j][2]<<
"\n";
1022 template<
typename T>
1025 const std::string& title,
1026 const std::string& zone)
1028 std::ofstream output(file_path_name.c_str(),std::ios::out);
1032 std::cerr<<
"Fail to open the file "<<file_path_name<<std::endl;
1041 output<<
"TITLE=\"" <<title<<
"\""<<std::endl;
1042 output<<
"VARIABLES=\"X\",\"Y\",\"U\",\"V\"" <<std::endl;
1043 output<<
"ZONE T=\""<<zone<<
"\", I="<<dim1<<
", J="<<dim2<<std::endl;
1049 output<<i<<
" "<<j<<
" "<<(*this)[i][j][0]<<
" "<<(*this)[i][j][1]<<(*this)[i][j][2]<<
"\n";
1056 template<
typename T>
1066 template<
typename T>
1074 template<
typename T>
1084 template<
typename T>
1093 template<
typename T>
1103 template<
typename T>
1112 template<
typename T>
1122 template<
typename T>
1130 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::plus<slip::Vector3d<T> >());
1135 template<
typename T>
1145 template<
typename T>
1155 template<
typename T>
1163 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::minus<slip::Vector3d<T> >());
1168 template<
typename T>
1178 template<
typename T>
1187 template<
typename T>
1195 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::multiplies<slip::Vector3d<T> >());
1200 template<
typename T>
1210 template<
typename T>
1219 template<
typename T>
1227 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.
begin(),std::divides<slip::Vector3d<T> >());
1232 template<
typename T>
1249 #endif //SLIP_DENSEVECTOR3DFIELD2D_HPP
void minus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the difference of two ranges.
vector3d_value_type & vector3d_reference
DenseVector3dField2d(const size_type height, const size_type width)
Constructs a DenseVector3dField2d.
iterator begin()
Returns a read/write iterator that points to the first element in the GenericMultiComponent2d. Iteration is done in ordinary element order.
DenseVector3dField2d(const size_type height, const size_type width, InputIterator first1, InputIterator last1, InputIterator first2, InputIterator first3)
Contructs a DenseVector3dField2d from a 3 ranges.
This is a GenericMultiComponent2d class. This container statisfies the BidirectionnalContainer concep...
slip::DenseVector3dField2d< double > DenseVector3dField2d_d
double alias
friend class boost::serialization::access
T & Vx1(const size_type i, const size_type j)
Subscript access to first element of the data contained in the DenseVector3dField2d.
DenseVector3dField2d(const size_type height, const size_type width, const T *val)
Constructs a DenseVector3dField2d initialized by an array val.
const_pointer const_iterator
void write_tecplot(const std::string &file_path_name, const std::string &title, const std::string &zone)
Writes a DenseVector3dField2d to a tecplot file path name.
DenseVector3dField2d(const size_type height, const size_type width, InputIterator first, InputIterator last)
Contructs a DenseVector3dField2d from a range.
slip::DenseVector3dField2d< short > DenseVector3dField2d_s
short alias
This is a Vector3d struct. It is a specialization of kvector. It implements some specific 3d operatio...
This is a dense 2d Field containing Vector3d. This container statisfies the BidirectionnalContainer c...
T & Vx3(const size_type i, const size_type j)
Subscript access to third element of the data contained in the DenseVector3dField2d.
std::reverse_iterator< iterator > reverse_row_iterator
Provides a class to manipulate multicomponent 2d containers.
const value_type * const_pointer
std::reverse_iterator< col_iterator > reverse_col_iterator
slip::DenseVector3dField2d< int > DenseVector3dField2d_i
int alias
self & operator/=(const T &val)
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
Provides a class to manipulate iterator2d within a slip::Box2d. It is used to iterate throw 2d contai...
void divides(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise division of two ranges.
slip::stride_iterator< pointer > col_iterator
size_type dim2() const
Returns the number of columns (second dimension size) in the GenericMultiComponent2d.
static const std::size_t DIM
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
vector3d_value_type * vector3d_pointer
slip::DenseVector3dField2d< unsigned long > DenseVector3dField2d_ul
unsigned long alias
Provides a class to iterate a 1d range according to a constant step.
std::reverse_iterator< const_iterator > const_reverse_row_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
slip::DenseVector3dField2d< float > DenseVector3dField2d_f
float alias
size_type height() const
Returns the height (first dimension size) in the GenericMultiComponent2d.
size_type dim1() const
Returns the number of rows (first dimension size) in the GenericMultiComponent2d. ...
slip::Vector3d< T > value_type
slip::stride_iterator< const_pointer > const_col_iterator
void write_gnuplot(const std::string &file_path_name)
Writes a DenseVector3dField2d to a gnuplot file path name.
DenseVector3dField2d(const size_type height, const size_type width, const slip::Vector3d< T > *val)
Constructs a DenseVector3dField2d initialized by an array val.
iterator begin()
Returns a read/write iterator that points to the first element in the kvector. Iteration is done in o...
slip::DenseVector3dField2d< char > DenseVector3dField2d_c
char alias
slip::DenseVector3dField2d< unsigned short > DenseVector3dField2d_us
unsigned long alias
self & operator+=(const T &val)
Add val to each element of the DenseVector3dField2d.
const value_type & const_reference
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.
slip::kstride_iterator< const_vector3d_pointer, 2 > const_vector3d_iterator
DenseVector3dField2d()
Constructs a DenseVector3dField2d.
Provides a class to manipulate 3d Vector.
const vector3d_value_type * const_vector3d_pointer
std::reverse_iterator< iterator > reverse_iterator
slip::DenseVector3dField2d< unsigned char > DenseVector3dField2d_uc
unsigned char alias
DenseVector3dField2d(const size_type height, const size_type width, const slip::Vector3d< T > &val)
Constructs a DenseVector3dField2d initialized by the scalar value val.
GenericMultiComponent2d< slip::Vector3d< T > > base
std::string name() const
Returns the name of the class.
const vector3d_value_type const_vector3d_reference
This is some iterator to iterate a 2d container into a slip::Box2d area defined by the indices of the...
DenseVector3dField2d(const self &rhs)
Constructs a copy of the DenseVector3dField2d rhs.
void fill(const slip::Vector3d< T > &value)
Fills the container range [begin(),begin()+size()) with copies of value.
iterator end()
Returns a read/write iterator that points one past the last element in the GenericMultiComponent2d. Iteration is done in ordinary element order.
self & operator*=(const T &val)
size_type width() const
Returns the number of columns (second dimension size) in the GenericMultiComponent2d.
slip::GenericMultiComponent2d< Vector3d< T > >::iterator2d iterator2d
Provides a class to manipulate Numerical Matrix.
Provides some algorithms to apply C like functions to ranges.
ptrdiff_t difference_type
Provides a class to iterate a 1d range according to a step.
slip::DenseVector3dField2d< unsigned int > DenseVector3dField2d_ui
unsigned int alias
slip::kstride_iterator< vector3d_pointer, 2 > vector3d_iterator
T & Vx2(const size_type i, const size_type j)
Subscript access to second element of the data contained in the DenseVector3dField2d.
const_pointer const_row_iterator
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
slip::DenseVector3dField2d< long > DenseVector3dField2d_l
long alias
self & operator=(const slip::Vector3d< T > &val)
Affects all the element of the DenseVector3dField2d by val.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
~DenseVector3dField2d()
Destructor of the DenseVector3dField2d.
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
self & operator-=(const T &val)