On 08/30/2011 03:00 PM, John Peterson wrote:
On Tue, Aug 30, 2011 at 1:57 PM, Truman Ellis <truman@ices.utexas.edu> wrote:
I have a question about FEMSystem::init_context and inherited instances like
NavierSystem::init_context from example 18. Why is it necessary to call
get_JxW(), get_phi(), etc? In FEMSystem::assembly() this is only called once
before we have actually started looping over any elements. Furthermore, all
of the get_* functions are actually called again in the appropriate
*_time_derivative, and *_constraint functions. I believe they are
appropriate in this latter case because a specific element has been
specified at this point. I tried commenting out this block of code in ex18,
and it doesn't appear to break anything. Can anyone explain if and what the
purpose of this code is?
This tells the FE object that we will need the JxW, phi, etc values
eventually, and that it should compute them.

Here's the get_phi() implementation.  Note that it sets the calculate_phi flag.

  const std::vector<std::vector<Real> >& get_phi() const
  { libmesh_assert(!calculations_started || calculate_phi);
    calculate_phi = true; return phi; }

So it is a performance issue? How does this handle p-adaptivity?

-- 
Truman Ellis