[petsc-users] Error when trying to write solution to a file

Miguel Angel Salazar de Troya salazardetroya at gmail.com
Tue Oct 7 11:52:49 CDT 2014


It was that, I totally forgot it. Thanks a lot!

On Tue, Oct 7, 2014 at 11:50 AM, Jed Brown <jed at jedbrown.org> wrote:

> Miguel Angel Salazar de Troya <salazardetroya at gmail.com> writes:
>
> > Hi all
> >
> > I'm solving a discretized PDE with TS. Inside my MonitorFunction(),
> hooked
> > up with TSMonitorSet(), I process the solution at each time step to write
> > another PETSc Vec. Then, I write this Vec to a matlab binary file. The
> name
> > of the binary file is the time step. I save it inside of the folder
> > "ForceHistory"
> >
> > // File name
> > PetscViewer    viewer;
> > std::string filehistory("ForceHistory/");
> > std::ostringstream temp;
> > temp << step;
> > filehistory.append(temp.str());
> > filehistory.append(".mat");
> >
> > // Open and set Binary file
> >
> PetscViewerBinaryOpen(PETSC_COMM_WORLD,filehistory.c_str(),FILE_MODE_WRITE,&viewer);
> > PetscViewerSetFormat(viewer, PETSC_VIEWER_BINARY_MATLAB);
> >
> > // Print
> > VecView(Context->Felement,viewer);
>
> Are you destroying the viewer (to close the file)?  It looks like either
> a max number of file descriptors or a disk quota problem.
>



-- 
*Miguel Angel Salazar de Troya*
Graduate Research Assistant
Department of Mechanical Science and Engineering
University of Illinois at Urbana-Champaign
(217) 550-2360
salaza11 at illinois.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141007/2052a60c/attachment.html>


More information about the petsc-users mailing list