Dear PETSc--<br><br>This is an actual user request. I am working on a typical PETSc task involving two nonlinear PDEs coupled together. I notice that there are several tools for Vecs which don't help much when I have a dof>1 Vec from my DA, for which the components have different scaling. Thus VecNorm and VecScale are not really what I want. Is there a plan for component-wise versions of those?<br>
<br>For example, is there a better/quicker way to scale one component of a dof>1 DA-derived Vec than writing my own, something like this:<br><br> typedef struct {<br> PetscReal H, u;<br> } Node;<br> ierr = DACreate1d(PETSC_COMM_WORLD,DA_NONPERIODIC,-M,2,1,PETSC_NULL,&da);CHKERRQ(ierr);<br>
ierr = DACreateGlobalVector(da,&v);CHKERRQ(ierr);<br> ...<br> Node *n;<br> ierr = DAVecGetArray(da,v,&n);CHKERRQ(ierr);<br> for (i = xs; i < xs + xm; i++) {<br> n[i].u *= alpha;<br> }<br> ierr = DAVecRestoreArray(da,v,&n);CHKERRQ(ierr);<br>
<br>I guess I would want the loop to be replaced by "DAVecScaleDOF(da,v,k,alpha)" for k=0,...,dof-1.<br><br>Same question for VecNorm: norm just an identified component?<br><br>Ed<br><br clear="all"><br>-- <br>**********************************<br>
Ed Bueler<br>474-7693 (fax 474-5394)<br>Dept of Mathematics and Statistics<br>301C Chapman Hall, Univ of Alaska<br>Fairbanks, AK 99775-6660<br><a href="http://www.dms.uaf.edu/~bueler">www.dms.uaf.edu/~bueler</a><br>**********************************<br>