[petsc-users] several DAs with different dofs

Barry Smith bsmith at mcs.anl.gov
Thu Nov 7 15:59:17 CST 2013


  Just create another DA with a different dof argument and then use the DMGetGlobalVector() to get an empty vector and fill it up as needed with the data[][][] style

   Barry

On Nov 7, 2013, at 3:35 PM, Juha Jäykkä <juhaj at iki.fi> wrote:

> Hi list!
> 
> I am thinking of pre-computing and storing some values that are used often 
> during a single TS iteration. I thought I'd create another vector from my DA 
> stick those values there: that would be the cleanest solution. However, the 
> dof of the DA is not big enough to hold all my pre-computed values!
> 
> Any suggestions how to do this?
> 
> Unless I miss something obvious, here are my "requirements". I do not need the 
> data across iterations. but I'd rather not realloc it every time either. The 
> data need no ghosts (the data are just local values of some functions of my 
> variables, so any ghosts needed are the ghosts of the variables). I would 
> value a data[][][]-style indexing for simplicity (of code). And finally, I 
> would value the possibility of saving these for inspection under some 
> circumstances in the same format as the main data (i.e. VecView).
> 
> Cheers,
> Juha
> 
> -- 
> 		 -----------------------------------------------
> 		| Juha Jäykkä, juhaj at iki.fi			|
> 		| http://koti.kapsi.fi/~juhaj/			|
> 		 -----------------------------------------------
> 



More information about the petsc-users mailing list