Like u mentioned i should be able to use the same loop without the 
workstream::run function but i do not know why this is not working. I guess 
it is a really small issue but i cannot find it.

BBah schrieb am Freitag, 20. Mai 2022 um 09:03:00 UTC+2:

> Hello Mr.Bangerth. I already implemented the old stress in my PointHistory 
> class to get the stresses form material->get_tau() (like in step 44). This 
> is my loop right now which actually the same as in step 18:
>     Vector<double> norm_of_stress(triangulation.n_active_cells());
>         for (auto &cell : triangulation.active_cell_iterators()){
>           if (cell->is_locally_owned())
>           {
>             SymmetricTensor<2, dim> accumulated_stress;
>             printf("\n cell owned\n");
>             for (unsigned int q = 0; q < qf_cell.size(); ++q){
>               std::cout<<q<<" ";
>                   accumulated_stress +=
>                     reinterpret_cast<PointHistory<dim,NumberType> *>(cell
> ->user_pointer())[q].old_stress;
>             }
>           }
>       } 
>
> I am able to compile this but running leads to a segmentation fault. 
>
>
> Wolfgang Bangerth schrieb am Freitag, 20. Mai 2022 um 02:02:33 UTC+2:
>
>> On 5/19/22 00:47, BBah wrote: 
>> > 
>> > i am just trying to put out the norm of the stresses like in step 18. 
>> Is there 
>> > a way to save my stress tensor for each cell and put it out ? In step 
>> 18 there 
>> > is a loop through each cell and the locally owned are used to put out 
>> the 
>> > stresses. Is there a way to do the same with the workstream object ? 
>> Been 
>> > searching for a while for a solution but could not find one. Putting 
>> out the 
>> > strains is easy since the gradient of the displacements are saved but 
>> how to 
>> > do the same with the stresses ? 
>>
>> BBah: What have you tried already? When you loop over all cells with 
>> WorkStream, the WorkStream::run() function calls your 'worker' function 
>> for 
>> every cell. This is the place where you would create output. 
>>
>> Alternatively, if all you want is to generate some output, just do it 
>> with the 
>> same loop as done in step-18. WorkStream is meant for cases where 
>> something is 
>> expensive and you want to do it in parallel, but outputting a couple of 
>> numbers for each cell is not expensive. 
>>
>> Best 
>> WB 
>>
>> -- 
>> ------------------------------------------------------------------------ 
>> Wolfgang Bangerth email: bang...@colostate.edu 
>> www: http://www.math.colostate.edu/~bangerth/ 
>>
>>

-- 
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/f4f6c28f-412f-4288-9567-0b81ae631bden%40googlegroups.com.

Reply via email to