On Thu, Jun 5, 2014 at 3:33 PM, Miguel Angel Salazar de Troya <
[email protected]> wrote:

> Thanks for your response. I am trying to modify the
> ProjectVector::operator() function to be able to handle the LAGRANGE_VEC.
> One of the first things this function does is this (line 782 at
> system_projection.C )
>
> AutoPtr<FEBase> fe (FEBase::build(dim, base_fe_type))
>
> This function does not handle the fe_type.family LAGRANGE_VEC, I would have
> to call:
>
> AutoPtr<FEVectorBase> fe (FEVectorBase::build(dim, base_fe_type));
>
> as John pointed out. How could I handle both cases without a conditional?
> That's the first thing I tried,


There's a couple of different paths I see here. Because this code actually
does different things based on whether the element is LAGRANGE or not and
I've thrown you into the deep end of the pool and are uncomfortable with
templates, I'll make the following suggestion and the other developers can
trump/suggest alternatives:

- Introduce an FEAbstract AutoPtr instead of FEBase
- make phi_values, etc. (AutoPtr?) pointers instead of references
- if the FEType is not LAGRANGE_VEC, downcast to the FEType and then
allocate (new) and populate the phi_values, etc. structures (they aren't
used in the LAGRANGE case)
- update the conditional to check for LAGRANGE and LAGRANGE_VEC
- update the LAGRANGE part to handle LAGRANGE_VEC (only very few, if any
changes).
- Clean up the memory for phi_values, etc.

This will take care of the LAGRANGE_VEC case and doesn't obfuscate future
enhancements that'll be need for NEDELEC_ONE, etc, I think.

Make sense?

Thanks for taking a crack at this.

Best,

Paul
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to