You can use VecStrideNorm() if you wish only  a particular one or 
VecStrideNormAll() if you wish all the norms.

   Barry

On Mar 20, 2014, at 10:38 AM, Mark Lohry <[email protected]> wrote:

> I'm using a struct for a multi-component PDE as suggested in the manual, like 
> so:
> 
> typedef struct {
> PetscScalar u,v,omega,temperature;
> } Node;
> Node **f,**u;
> DMDAVecGetArray(DM da,Vec local,&u);
> DMDAVecGetArray(DM da,Vec global,&f);
> 
> 
> Calling VecNorm(...) on these vectors gives a norm for the entire vector. If 
> one wants separate norms for each component of the struct, i.e. Norm(u) or 
> Norm(v), what's the right approach? Would I need to manually compute norms 
> locally and then call an MPI reduce function, or is this ability built-in to 
> PETSc somewhere?
> 
> 
> -Mark Lohry

Reply via email to