24 #ifndef CFIELD_INTERCOR
25 #define CFIELD_INTERCOR
29 #define cimg_plugin "plugins/add_fileformat.h"
30 #define cimg_use_netcdf
32 #ifdef cimg_use_netcdf
33 #include "../NetCDF.Tool/struct_parameter_NetCDF.h"
36 #define cimg_plugin2 "plugins/netcdf_file_format4CImg2.h"
37 #define cimglist_plugin2 "plugins/netcdf_file_format4CImgList2.h"
38 #include "../CImg.Tool/CImg_NetCDF.h"
42 #include "Cfield_opticalFlow_fem.h"
45 template<
typename T,
typename Timg>
55 this->class_name =
"Field : Inter-correlation";
60 virtual void init(CParameterNetCDF &fp)
63 std::string attribute_name =
"store_correlogram";
64 int error = fp.loadAttribute(attribute_name,this->m_storeCorrelo);
65 if (this->m_verbose and this->m_storeCorrelo){printf(
"\t\t Correlograms are stored\n");}
73 if (this->m_storeCorrelo){this->
m_correlogram.assign(oImage.cur_dim(0), oImage.cur_dim(1), oImage.cur_dim(2), oImage.cur_dim(3), 0);}
76 this->m_mode.assign(oMesh.num_var()+2, oMesh.grid_dims(0),oMesh.grid_dims(1),oMesh.grid_dims(2),1, 0);
88 if ((oShape_prev.m_name).compare(0,5,
"OFFEM") == 0)
92 CImgList<T> U(oMesh.num_var(), modes_prev[0].width(), modes_prev[0].height(), modes_prev[0].depth(), 1, 0);
94 this->Field2Field(modes_prev, U);
97 {modes_cur[mode+2] = U[mode];}
101 else if((oShape_prev.m_name).compare(0,2,
"IC") == 0)
104 this->Field2Field(modes_prev, modes_cur);
107 else if((oShape_prev.m_name).compare(0,4,
"OFIB") == 0)
111 CImgList<T> U0(oMesh.num_var(), modes_prev[0].width(), modes_prev[0].height(), modes_prev[0].depth(), 1, 0);
112 CImgList<T> U1(oMesh.num_var(), modes_cur[0].width(), modes_cur[0].height(), modes_cur[0].depth(), 1, 0);
114 this->OFIBU(oMesh, oImage, oShape_prev, ref_prev, nodes_prev, modes_prev, U0);
116 this->Field2Field(U0, U1);
118 cimglist_for(U1, mode)
119 {modes_cur[mode+2] = U1[mode];}
123 else if((oShape_prev.m_name).compare(0,3,
"OFI") == 0)
126 CImgList<T> U(oMesh.num_var(), modes_cur[0].width(), modes_cur[0].height(), modes_cur[0].depth(), 1, 0);
128 this->OFIU(oMesh, oImage, oShape_prev, ref_prev, nodes_prev, modes_prev, U);
130 cimglist_for(U, mode)
131 {modes_cur[mode+2] = U[mode];}
134 else{printf(
"unknown name for previous correlation method");}
In this class, specific projection field method is implemented. In the case of F.E.M. the node value is equal to the field at node position, so "fromField2Mod" simply implements a parallelized loop over elements and extracts from previous fields the node value at node location.
Definition: Cfield_opticalFlow_fem.h:49
virtual void project(const Cmesh< T, Timg > &oMesh, const Cimage< Timg > &oImage, CImgList< T > &modes_prev, CshapeFunction< T, Timg > &oShape_prev, const std::vector< T > &ref_prev, const CImgList< T > &nodes_prev, CImgList< T > &modes_cur)
Definition: Cfield_intercor.h:84
virtual void exec(const Cimage< Timg > &oImage, const Cmesh< T, Timg > &oMesh, CImgList< T > &modes_prev, CshapeFunction< T, Timg > &oShape_prev, const std::vector< T > &ref_prev, const CImgList< T > &nodes_prev)
Definition: Cfield.h:100
This is the mother class of shape function objets (virtual pure).
Definition: CshapeFunction.h:48
virtual void exec(const Cimage< Timg > &oImage, const Cmesh< T, Timg > &oMesh, CImgList< T > &modes_prev, CshapeFunction< T, Timg > &oShape_prev, const std::vector< T > &ref_prev, const CImgList< T > &nodes_prev)
Definition: Cfield_intercor.h:70
CImg< T > m_correlogram
to improve, they shouldn't be here//
Definition: Cfield.h:74
Definition: Cfield_intercor.h:46