Hello,

Please look at the solution by Timo. 

In your case, you can do something like.

 if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)
{

std::ofstream myfile;
myfile.open ("resultant_strass.txt");
myfile<< resultant_stress<<std::endl;

myfile.close();


}




On Thursday, February 23, 2017 at 11:08:35 AM UTC-5, Hamed Babaei wrote:
>
> Dear Rajat,
>  
>
>> ... which I then write in a file on a master process.
>>
>
> I was wondering how to write in a file on a master process so that there 
> would be just one output file not as many as processor exist. I use the 
> following commands to write in my file in serial code :
>
> std::ofstream myfile;
> myfile.open ("resultant_strass.txt");
> myfile<< resultant_stress<<std::endl;
> myfile.close();
>
> Do I need to make any change in it?
>
> Thanks
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to