24 #ifndef CSHAPEFUNCTION_GLOBAL_BLADE
25 #define CSHAPEFUNCTION_GLOBAL_BLADE
43 template<
typename T,
typename Timg>
49 std::vector<int> m_modFlex, m_modComp;
50 std::vector<float> m_lambda;
57 this->class_name =
"CshapeFunction_global_blade";
61 virtual void init(CParameterNetCDF &fp)
68 for (
int i=0; i<this->m_mods.size(); i++){
if (this->m_mods[i].compare(0,1,
"F") == 0){m_modFlex.push_back(i);}}
69 if (this->m_verbose){std::cout<<
"\tmodes Flex : [ ";
for (
int i=0; i<m_modFlex.size(); i++){std::cout<<m_modFlex[i]<<
" ";}std::cout<<
"]\n";}
73 for (
int i=0; i<this->m_mods.size(); i++){
if (this->m_mods[i].compare(0,1,
"C") == 0){m_modComp.push_back(i);}}
74 if (this->m_verbose){std::cout<<
"\tmodes Comp : [ ";
for (
int i=0; i<m_modComp.size(); i++){std::cout<<m_modComp[i]<<
" ";}std::cout<<
"]\n";}
76 std::string att_name(
"length");
77 int error = fp.loadAttribute(att_name,m_length);
78 if (this->m_verbose){std::cout<<
"\tblade length : "<<m_length<<
"\n";}
86 virtual void exec(
const CImg<Timg> &box,
const std::vector<T> &x, CImgList<T> &N)
103 for (
int mod=0; mod<m_modFlex.size(); mod++)
105 N(0, m_modFlex[mod]) = -yy*dflex( xx, mod, m_lambda, m_length, m_p);
106 N(1, m_modFlex[mod]) = flex(xx, mod, m_lambda, m_length, m_p);
110 for (
int mod=0; mod<m_modComp.size(); mod++)
112 N(0, m_modComp[mod]) = compress( xx, mod, m_length, m_p);
113 N(1, m_modComp[mod]) = 0;
118 void lambda(
const std::vector<int> &modFlex)
128 for (
int i=0; i<modFlex.size(); i++)
132 case 0: m_lambda.push_back(1.8751);
break;
133 case 1: m_lambda.push_back(4.6940);
break;
134 default: m_lambda.push_back( (2*(i+1)-1)*this->m_pi/2 );
break;
140 T flex(
const double &x,
const int &mod,
const std::vector<float> &
lambda,
const float &L,
const int &pow = 1)
const
143 double a(lambda[mod]/L);
145 return std::pow( std::sin(a*x) - std::sinh(a*x) - (std::sin(lambda[mod]) + std::sinh(lambda[mod]))/(std::cos(lambda[mod]) + std::cosh(lambda[mod]))*(std::cos(a*x) - std::cosh(a*x)) ,pow);
149 T dflex(
const double &x,
const int &mod,
const std::vector<float> &lambda,
const float &L,
const int &pow = 1)
const
152 double a(lambda[mod]/L);
154 return std::pow( a*(std::cos(a*x) - std::cosh(a*x) - (std::sin(lambda[mod]) + std::sinh(lambda[mod]))/(std::cos(lambda[mod]) + std::cosh(lambda[mod]))*(-std::sin(a*x)-std::sinh(a*x)) ), pow);
158 T d2flex(
const double &x,
const int &mod,
const std::vector<float> &lambda,
const float &L,
const int &pow = 1)
const
163 return std::pow( std::pow(a,2) * ( -std::sin(a*x) - std::sinh(a*x) - (std::sin(lambda[mod])+std::sinh(lambda[mod]))/(std::cos(lambda[mod])+std::cosh(lambda[mod])) *(-std::cos(a*x)-std::cosh(a*x)) ), pow);
167 T compress(
const double &x,
const int &mod,
const float &L,
const int &pow = 1)
const
170 return std::pow(std::sin((2*(mod+1)-1)*this->m_pi/2*x/L) ,pow);
void lambda(const std::vector< int > &modFlex)
Definition: CshapeFunction_global_blade.h:118
virtual void init(CParameterNetCDF &fp)
Definition: CshapeFunction_global_blade.h:61
virtual void exec(const CImg< Timg > &box, const std::vector< T > &x, CImgList< T > &N)
Definition: CshapeFunction_global_blade.h:86
This class implements Rigid Body shape functions available for 2D and 3D cases. It implements 3 rigid...
Definition: CshapeFunction_global_rigidBody.h:41
This class implements Blade flexion and compression shape functions available for 2D case (CL encastr...
Definition: CshapeFunction_global_blade.h:44
virtual void init(CParameterNetCDF &fp)
Definition: CshapeFunction_global_rigidBody.h:56