On Mon, May 2, 2011 at 2:04 PM, Kirk, Benjamin (JSC-EG311)
<[email protected]> wrote:
>> class BoundaryElem : public Elem
>> {
>>   Elem* _interior_parent;
>>   Elem* self;
>> }
>>
>> All the Elem functionality could be implemented by forwarding to the
>> underlying "self" pointer, which represents some actual element.
>>
>> But... that might be way too much work for something that could be
>> fixed with either of your suggestions above!
>
> Along these lines though, couldn't you avoid the duplication by *not*
> deriving from Elem and instead providing a conversion operator from a
> BoundaryElem to an Elem that simply returns *self?
>
> I don't remember the syntax of the top of my head...

operator Elem*() { return self; }

That's an interesting idea... but assuming we still want BoundaryMesh
to be derived from Mesh, it will contain a std::vector<Elem*>
_elements... hence the inheritance.

-- 
John

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to