On Dec 6, 2012, at 2:18 PM, Derek Gaston <fried...@gmail.com> wrote:

> On Thu, Dec 6, 2012 at 1:08 PM, Kirk, Benjamin (JSC-EG311) 
> <benjamin.kir...@nasa.gov> wrote:
> Looks like in the System we always assume any SCALAR values were added last, 
> and that we can have only one.  As such, a VariableGroup with multiple SCALAR 
> types makes no sense (under current assumptions) right?  If you need more 
> SCALARs you up the oder, not append more - seems to be my reading of what is 
> there presently.
> 
> Mostly trying to grok the Variable::first_scalar_number() business.
> 
> I don't think that's right - we have multiple SCALAR variables here... each 
> of arbitrary order (things like Lagrange multipliers for contact and "joints" 
> in 1D flow and fully-coupled ODE systems).
> 
> Derek 


Gotcha.  I was misinterpreting this

inline
unsigned int System::n_components() const
{
  if (_variables.empty())
    return 0;

  const Variable& last = _variables.back();
  return last.first_scalar_number() + last.n_components();
}

as meaning you only have one SCALAR and it is the last in the list.

...but rather through the magic of recursion when building up 
first_scalar_number() it is only necessary to interrogate the last variable in 
the list.

-Ben



------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to