示例#1
0
void beam_PK1_stress_function(TensorValue<double>& PP,
                              const TensorValue<double>& FF,
                              const libMesh::Point& /*X*/,
                              const libMesh::Point& s,
                              Elem* const /*elem*/,
                              const vector<NumericVector<double>*>& /*system_data*/,
                              double /*time*/,
                              void* /*ctx*/)
{      const double dist2root = sqrt((s(0) - 0) * (s(0) - 0));
    if (dist2root <= fixed_L) // we use penalty method to fix the root
    {
        PP = 0.0 * FF; // so we no longer compute stress here
	return ;
    }

 
    // 1)  compute the radius r(x) : r_x
    double arc_s = get_arc_length(s(0));
    const double r_x = slope * arc_s + r0;
    // 2) compute ratio_moduli;
    const double ratio_radius = r_x /r0; 
    const double ratio_moduli = ratio_radius *  ratio_radius*  ratio_radius*  ratio_radius;

   
        
        const TensorValue<double> CC = FF.transpose() * FF;
        const TensorValue<double> EE = 0.5 * (CC - II);
        const TensorValue<double> SS = lambda_s * EE.tr() * II + 2.0 * mu_s * EE;
        PP = ratio_moduli * FF * SS;
 
    return;
} // beam_PK1_stress_function
示例#2
0
void
beam_PK1_stress_function(TensorValue<double>& PP,
                         const TensorValue<double>& FF,
                         const libMesh::Point& /*X*/,
                         const libMesh::Point& s,
                         Elem* const /*elem*/,
                         const vector<NumericVector<double>*>& /*system_data*/,
                         double /*time*/,
                         void* /*ctx*/)
{
    const double r = sqrt((s(0) - 0.2) * (s(0) - 0.2) + (s(1) - 0.2) * (s(1) - 0.2));
    if (r > 0.05)
    {
        static const TensorValue<double> II(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
        const TensorValue<double> CC = FF.transpose() * FF;
        const TensorValue<double> EE = 0.5 * (CC - II);
        const TensorValue<double> SS = lambda_s * EE.tr() * II + 2.0 * mu_s * EE;
        PP = FF * SS;
    }
    else
    {
        PP.zero();
    }
    return;
} // beam_PK1_stress_function
示例#3
0
文件: main.cpp 项目: BijanZarif/IBAMR
void
upper_PK1_stress_function(
    TensorValue<double>& PP,
    const TensorValue<double>& FF,
    const libMesh::Point& /*X*/,
    const libMesh::Point& s,
    Elem* const /*elem*/,
    const vector<NumericVector<double>*>& /*system_data*/,
    double /*time*/,
    void* /*ctx*/)
{
    if (s(0) > 5.0 && s(0) < 10.0)
    {
        static const TensorValue<double> II(1.0,0.0,0.0,
                                            0.0,1.0,0.0,
                                            0.0,0.0,1.0);
        const TensorValue<double> CC = FF.transpose()*FF;
        const TensorValue<double> EE = 0.5*(CC - II);
        const TensorValue<double> SS = lambda_s*EE.tr()*II + 2.0*mu_s*EE;
        PP = FF*SS;
    }
    else
    {
        PP.zero();
    }
    return;
}// upper_PK1_stress_function
示例#4
0
文件: main.cpp 项目: mesnardo/IBAMR
void PK1_stress_function(TensorValue<double>& PP,
                         const TensorValue<double>& FF,
                         const libMesh::Point& /*x*/,
                         const libMesh::Point& /*X*/,
                         subdomain_id_type /*subdomain_id*/,
                         std::vector<double>& /*internal_vars*/,
                         double /*time*/,
                         void* /*ctx*/)
{
    const TensorValue<double> FF_inv_trans = tensor_inverse_transpose(FF, NDIM);
    const TensorValue<double> CC = FF.transpose() * FF;
    PP = 2.0 * c1_s * FF;
    if (!MathUtilities<double>::equalEps(p0_s, 0.0))
    {
        PP -= 2.0 * p0_s * FF_inv_trans;
    }
    if (!MathUtilities<double>::equalEps(beta_s, 0.0))
    {
        PP += beta_s * log(CC.det()) * FF_inv_trans;
    }
    return;
} // PK1_stress_function