24 #ifndef CMESH_GENERATE_CENTROID
25 #define CMESH_GENERATE_CENTROID
57 template<
typename T,
typename Timg>
68 this->class_name =
"Cmesh_generate_centroid";
72 virtual int get_attributes(CParameterNetCDF &fp)
83 error = fp.loadAttribute(att,this->m_win);
84 for (
int i=this->m_win.size(); i<3; i++){this->m_win.push_back(1);}
85 if (this->m_verbose){printf(
"\tMesh ZOI : [%i %i %i]\n",this->m_win[0], this->m_win[1], this->m_win[2]);}
89 error = fp.loadAttribute(att,m_peaks);
90 if (this->m_verbose){printf(
"\tNumber of peak : %i\n",m_peaks);}
101 this->m_grid.assign(3,1);
102 for (
int i=0; i<this->num_var(); i++)
104 this->m_grid[i] = (int)ceil((
float)oImage.cur_dim(i)/(float)this->m_pitch[i])+1;
105 this->m_dof *= this->m_grid[i];
107 this->m_dof *= this->num_var();
108 if (this->m_verbose){printf(
"\tDegree Of Freedom : %i\n",this->m_dof);}
110 this->m_node.assign(this->num_var(), this->m_grid[0],this->m_grid[1],this->m_grid[2],1, 0);
111 if (this->m_verbose){printf(
"\tNode table : [%i](%i,%i,%i)\n",this->m_node.size(), this->m_node[0].width(), this->m_node[0].height(), this->m_node[0].depth());}
115 this->m_connect.assign((this->m_grid[0]-1)*(this->m_grid[1]-1)*(this->m_grid[2]-1), 1,1,1,1, 0);
119 this->m_connect.assign((this->m_grid[0]-1)*(this->m_grid[1]-1), 1,1,1,1, 0);
121 if (this->m_verbose){printf(
"\tElement table [%i](%i)\n",this->m_connect.size(), this->m_connect[0].width());}
123 this->m_numPix = this->m_win[0]*this->m_win[1]*this->m_win[2]*this->m_connect.size();
136 #pragma omp for schedule(runtime)
137 cimglist_for(elements, elem)
140 elements[elem][0] = elem;
146 virtual int grid_dims(
const int &i)
const
151 case 0:
return this->m_grid[0];
break;
152 case 1:
return this->m_grid[1];
break;
153 case 2:
return this->m_grid[2];
break;
154 case 3:
return m_peaks;
break;
157 std::cerr<<this->class_name<<
"::"<<__func__<<
": error: id="<<i<<
" which is over [0-3]\n"<<std::flush;
As Cmesh_Q4 this class is based on regular and rectangular elements. This class works on 7 main attri...
Definition: Cmesh_generate_centroid.h:58
virtual int assign(const Cimage< Timg > &oImage)
Definition: Cmesh_generate_centroid.h:94
Class is based on Q4 elements, i.e. 4 nodes elements. This class works on 7 main attributes declared ...
Definition: Cmesh_generate_regularFem.h:52
virtual void set_connectivity(const Cimage< Timg > &oImage, const CImgList< T > &nodes, CImgList< int > &elements)
Definition: Cmesh_generate_centroid.h:129