From: Derek Gaston <friedmud@gm...>  20081105 22:57:07

Hmmm... I didn't even know that SystemNorm existed. After poking around to where it was used... it looks like a method already exists for what I want: System::calculate_norm(NumericVector<Number>& v, unsigned int var = 0, FEMNormType norm_type = L2) But like you say, that function assumes that if you want a discrete norm of the vector... that you want it of the entire vector. In fact... ultimately... NumericVector::norm_type() gets called. So... it looks like the function that should get modified is: System::calculate_norm(NumericVector<Number>& v, const SystemNorm &norm) Which is what the above one calls (which calls NumericVector::norm_type() ). So... now my question is... is there a way to get a list of all of the DofIndices for a variable on a processor? Or am I going to have to loop over each element calling dof_map>dof_indices() and passing in the variable to build up this list? Derek On Nov 5, 2008, at 3:17 PM, Roy Stogner wrote: > > > On Wed, 5 Nov 2008, Derek Gaston wrote: > >> Anyone have a good piece of code for computing a norm of just the >> piece of a NumericVector that corresponds to a specific variable >> number? My problem is that I have multiple >> variables in my system... but I need to get the norm of the residual >> for each one individually. >> >> Should we maybe extend the l2_norm(), l1_norm(), linfty_norm() >> functions to take an option variable number? > > Does the NumericVector class even have enough information to know > which variable a coefficient belongs to? I'd hope it doesn't; I like > modular code. > > I think what you want to modify is the SystemNorm class. Currently it > assumes that you either want a weighted combination of Sobolev norms > of different variables or a discrete norm of the entire vector. > Extending it (and the classes that use it) to provide weighted > discrete norms of particular combinations of variables within a vector > should be straightforward. >  > Roy 