Question on DA's and VecScatters

Randall Mackie rlmackie862 at
Sat Feb 16 13:28:21 CST 2008

In my 3D distributed array, I created global vectors, local vectors,
and one natural vector (because I want to access and output to a file
some of these values).

If you create a scatter context, using VecScatterCreateToZero, does
it matter whether or not I specify a global vector or the natural vector
to create the context?

In other words, does it matter in this vecscattercreate call whether or not
I use vnat (natural vector) or vsol (global vector)

	call VecScatterCreateToZero(vnat,vToZero,vseq,ierr)

if later I make these calls:

	call DaGlobalToNaturalBegin(da,vsol,INSERT_VALUES,vnat,ierr)
	call DaGlobalToNaturalEnd(da,vsol,INSERT_VALUES,vnat,ierr)

	call VecScatterBegin(vToZero,vnat,vseq....)
	call VecScatterEnd(vToZero,vnat,vseq....)

	call VecGetArray(vseq....)

Or does it keep track because it knows what type of vectors are being dealt with?

Thanks, Randy

More information about the petsc-users mailing list