My PointHistory class does include old_stress but running this code leads 
to a segmentation fault:

  template <int dim,typename NumberType>
  class PointHistory
  {
  public:
    PointHistory()
    : old_stress(SymmetricTensor<2, dim,NumberType>())
    {}

    virtual ~PointHistory()
    {}

    // The first function is used to create a material object and to
    // initialize all tensors correctly: The second one updates the stored
    // values and stresses based on the current deformation measure
    // $\textrm{Grad}\mathbf{u}_{\textrm{n}}$.
    void setup_lqp (const Parameters::AllParameters &parameters)
    {
      material =
        std::make_shared<Material_Compressible_Neo_Hook_One_Field_Pert<dim,
NumberType>>(
          parameters.mu, parameters.nu);
      update_values(Tensor<2, dim,NumberType>());
    }

    void update_values(const Tensor<2, dim,NumberType> &Grad_u_n)
    {
      const Tensor<2, dim> F = Physics::Elasticity::Kinematics::F(Grad_u_n);
      const NumberType               det_F = determinant(F);
      const SymmetricTensor<2,dim,NumberType> C = Physics::Elasticity::
Kinematics::C(F);
      old_stress = material->get_s_piola(det_F,C);
}
}
}
...
BBah schrieb am Mittwoch, 18. Mai 2022 um 14:52:56 UTC+2:

> Hello everybody,
>
> i am trying to output my stresses by using a similar approach like in Step 
> 18:
>
> *Vector<double> 
> <https://www.dealii.org/developer/doxygen/deal.II/classVector.html> 
> norm_of_stress(triangulation 
> <https://www.dealii.org/developer/doxygen/deal.II/p4est__wrappers_8cc.html#ace00f2f80d9780ef9aa1007e1c22c6a4>.n_active_cells());*
> * {*
> *for (auto &cell : triangulation 
> <https://www.dealii.org/developer/doxygen/deal.II/p4est__wrappers_8cc.html#ace00f2f80d9780ef9aa1007e1c22c6a4>.active_cell_iterators())*
> *if (cell->is_locally_owned())*
> * {*
> *SymmetricTensor<2, dim> 
> <https://www.dealii.org/developer/doxygen/deal.II/classSymmetricTensor.html> 
> accumulated_stress;*
> *for (unsigned int q = 0; q < quadrature_formula.size(); ++q)*
> * accumulated_stress +=*
> *reinterpret_cast<PointHistory<dim> *>(cell->user_pointer())[q]*
> * .old_stress;*
> * norm_of_stress(cell->active_cell_index()) =*
> * (accumulated_stress / quadrature_formula.size()).norm 
> <https://www.dealii.org/developer/doxygen/deal.II/namespaceLocalIntegrators_1_1Divergence.html#a8bcfc37d2a2be8faa18628a601ecf112>();*
> * }*
> *else*
> * norm_of_stress(cell->active_cell_index()) = -1e 
> <https://www.dealii.org/developer/doxygen/deal.II/namespacePhysics_1_1Elasticity_1_1Kinematics.html#a9587d5229555daa5b1fa1ba2f8a40adb>+20;*
> * }*
> * data_out.add_data_vector 
> <https://www.dealii.org/developer/doxygen/deal.II/classDataOut__DoFData.html#ac43d3b1f6e67424f36e474627fe8e401>(norm_of_stress,
>  
> "norm_of_stress");*
>
> I have implemented my problem like in Step 44 by using the Workstream 
> object. How can i implement this part of code in my case ? How can i call 
> my "old_stress" from the PointHistory for each cell ?  
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/24beb6bb-e350-4c8a-a75d-691a48e6f9a2n%40googlegroups.com.

Reply via email to