VecSetValue

Matthew Knepley knepley at gmail.com
Sat Feb 28 17:18:45 CST 2009


I cannot understand your question.

  Matt

On Fri, Feb 27, 2009 at 6:45 PM, Yixun Liu <enjoywm at cs.wm.edu> wrote:

> Hi,
>
>
>  VecCreate(PETSC_COMM_WORLD,&solutionDisplacementVector);
>
>  VecSetSizes(solutionDisplacementVector, 3*numOfVerticesOfOneProcessor,
> systemSize); //in this case 3*numOfVerticesOfOneProcessor==systemSize
>  VecSetFromOptions(solutionDisplacementVector);
>
>
>  VecDuplicate(solutionDisplacementVector, &weightedDisplacementVector);
>
>
> for(i = 0; i < systemSize; i++)
> {
> output weightedRealDisplacement[i] to file//with this code the values in
> weightedDisplacementVector are correct.
>
> ...
> VecSetValue(weightedDisplacementVector, i, weightedRealDisplacement[i],
> ADD_VALUES);
> ...
>
> }
>
> VecAssemblyBegin(weightedDisplacementVector);
>  VecAssemblyEnd(weightedDisplacementVector);
>
> output weightedDisplacementVector to file to see its values
>
>
>
> For simplicity I only use one processor. As I examine the values in
> weightedDisplacementVector and I found if  I add the output code in the
> for loop the values in weightedDisplacementVector are correct. Without
> it there is error.
>
>
> Thanks.
>
> Yixun
>



-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090228/22fb39da/attachment.htm>


More information about the petsc-users mailing list