24 #ifndef CSHAPEFUNCTION_GLOBAL_BRASILIAN
25 #define CSHAPEFUNCTION_GLOBAL_BRASILIAN
45 template<
typename T,
typename Timg>
51 std::vector<int> m_modB;
53 std::vector<double> m_f;
59 this->class_name =
"CshapeFunction_global_brasilian";
63 virtual void init(CParameterNetCDF &fp)
72 for (
int i=0; i<this->m_mods.size(); i++){
if (this->m_mods[i].compare(0,1,
"B") == 0){m_modB.push_back(i);}}
73 if (this->m_verbose){std::cout<<
"\tmodes B : [ ";
for (
int i=0; i<m_modB.size(); i++){std::cout<<m_modB[i]<<
" ";}std::cout<<
"]\n";}
75 std::string att_name(
"Poisson");
76 fp.loadAttribute(att_name,m_nu);
77 if (this->m_verbose){std::cout<<
"\tPoisson factor : "<<m_nu<<
"\n";}
80 fp.loadAttribute(att_name,m_r);
81 if (this->m_verbose){std::cout<<
"\tCircle radius : "<<m_r<<
"\n";}
84 fp.loadAttribute(att_name,m_f);
85 if (this->m_verbose){std::cout<<
"\tforce : "<<m_f[frame_number]<<
"\n";}
88 m_k0 = (m_f[frame_number]*m_r*(1+m_nu))/(2*this->m_pi);
89 m_k1 = (3-m_nu)/(1+m_nu);
93 virtual void exec(
const CImg<Timg> &box,
const std::vector<T> &x, CImgList<T> &N)
112 if ((a==0 or b==0) and yy==0)
114 if (this->m_verbose){printf(
"\nwarning singular points\n");}
119 for (
int mode=0; mode<m_modB.size(); mode++)
121 N[1][m_modB[mode]] = m_k0*( m_k1*(a/m_r - std::log(std::sqrt(std::pow(a,2)+std::pow(yy,2))/std::sqrt(std::pow(b,2)+std::pow(yy,2)))) + std::log(std::sqrt(std::pow(a,2)+std::pow(yy,2))/std::sqrt(std::pow(b,2)+std::pow(yy,2))) + (std::pow(a,2)-std::pow(yy,2))/(std::pow(a,2)+std::pow(yy,2)) + (std::pow(b,2)-std::pow(yy,2))/(std::pow(b,2)+std::pow(yy,2)) - xx/m_r);
123 N[0][m_modB[mode]] = m_k0*( m_k1*(yy/m_r - std::atan2(yy,b) - std::atan2(yy,a)) - std::atan2(yy,b) + (2*yy*a)/(std::pow(a,2)+std::pow(yy,2)) - (2*yy*b)/(std::pow(b,2)+std::pow(yy,2)) - yy/m_r - std::atan2(yy,a));
This class implements Homogeneous deformation shape functions available for 2D and 3D cases...
Definition: CshapeFunction_global_homogeneous.h:41
virtual void init(CParameterNetCDF &fp)
Definition: CshapeFunction_global_homogeneous.h:56
This class implements Brasilian shape functions available for 2D case (isotropic elasticity). The implemented mode is called "B" and a link toward Homogeneous modes is provided. Brasilian mode within the entire set of required modes by user is noted "m_modB" and the identified parameter is 1/E with E the Young modulus:
Definition: CshapeFunction_global_brasilian.h:46
virtual void exec(const CImg< Timg > &box, const std::vector< T > &x, CImgList< T > &N)
Definition: CshapeFunction_global_brasilian.h:93
virtual void init(CParameterNetCDF &fp)
Definition: CshapeFunction_global_brasilian.h:63