Dear all,

I use getfem to solve a 3D isotropic elastic problem, using a displacement based FEM

To compute the stress, I have wrote this method:

void getfem_compute_stress(
        getfem::model &md,
        const std::string &varname,
        const std::string &data_lambda,
        const std::string &data_mu,
        const getfem::mesh_fem &mf_stress,
        getfem::model_real_plain_vector &stress )
    {
        const getfem::mesh_fem *mfu = md.pmesh_fem_of_variable( varname );
        GMM_ASSERT1( mfu, "The variable should be a fem variable" );
        getfem::size_type N = mfu->linked_mesh().dim();
        std::string sigma = data_lambda + "*Div_" + varname + "*Id(meshdim)+"
            + data_mu + "*(Grad_" + varname + "+Grad_" + varname + "')";
        getfem::ga_interpolation_Lagrange_fem( md, sigma, mf_stress, stress );
    }

 * md is the model I use to solve the FEM problem
 * varname is "u" for the displacement
 * data_lambda is "lambda"
 * data_mu is "mu"
 * mf_stress is a getfem::mesh_fem built with "classical discontinuous
   element"
 * stress is a vector where the stress will be store


It works like a charm, when I try to visualize the results on paraview, the stress results are good... but there are continuous !

I am expecting discontinuous result... because I have computed the displacement field using linear elements, so the stress has to be constant on each cell.

How can I manage to obtain this kind of result ? I don't want the stress field to be interpolated ...

Best regards,

Antoine Mazuyer


Reply via email to