Matthew Kury <[email protected]> writes: > Hello, > > I have done some reading and I have not been able to find out what the > proper way to create and use vectors within a function. > > If I have a function that passes in dm and V then: > +++ > DMPlexGetLocalVec(dm, &VLocal) ;
This function doesn't exist, and neither does DMPlexCreateLocalVec (from the subject of your email), but when I gaze into my crystal ball, it says you're probably spelling it DMGetLocalVector. Please send the full error message. > DMGlobalToLocalBegin(dm,V,INSERT_VALUES,VLocal); > DMGlobalToLocalEnd(dm,V,INSERT_VALUES,VLocal) ; > > VecGetArray(VLoc,VLocalArray); > > “Stuff with VLocalArray” > > VecRestoreArray(VLoc,VLocalArray); > > DMLocalToGlobalBegin(dm,VLocal,ADD_VALUES,V); > DMLocalToGlobalEnd(dm,VLocal,ADD_VALUES,V); > > DMRestoreLocalVector(dm,&VLocal); > +++ > > The second time I call the function I get errors with the VecGetArray() > function. I would appreciate any advice as to what is going wrong. > > Thank you, > > Matthew
signature.asc
Description: PGP signature
