On Thu, Mar 8, 2012 at 16:49, Max Rudolph <maxwellr at gmail.com> wrote:
> Is there a way to do this on a vector, independently of the DA? I was > hoping to save some calculated fields like strain rate and viscous > dissipation, and the way that I have done this previously is to create a DA > with 1 dof per node, then create a global vector for each quantity of > interest, give it a name using, then populate these arrays and write it to > disk. Is this a bad design decision? If you ever communicate those values, I suggest making it one Vec. It should cost a similar amount to communicate all the values as to communicate just one. Similarly, if you usually use several of the values at once, I would put them all in the same Vec because the memory access is better on most hardware. Can you pull petsc-dev, what you want should work now. > One kludgey workaround might be to set the DA field name for component 0 > using the name returned by PetscObjectGetName prior to writing each > vector. The alternative that I see, which would allow me to use the method > you suggested, is to create a DA with as many DOFs per node as there are > quantities of interest, then create one global vector with multiple DOFs > per node, set the field names, and write it to disk. This would involve > some significant re-coding but might ultimately be a better solution. > > Max > > > On Thu, Mar 8, 2012 at 2:38 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote: > >> On Thu, Mar 8, 2012 at 16:36, Max Rudolph <maxwellr at gmail.com> wrote: >> >>> No. I created vectors with DMDACreateGlobalVector and then set vector >>> names using PetscObjectSetName. >>> >> >> Set the field name, not the PetscObject name. VTK does not provide a >> useful mechanism to write multiple "steps" into the same file, so you would >> write separate files per step. >> >> >>> I will look into how hard it would be to change this. I am viewing the >>> vectors using VecView currently. Thanks again for your help. >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120308/777c754f/attachment.htm>
