On 4/15/11 4:49 PM, Roy Stogner wrote:
>
> On Fri, 15 Apr 2011, Boyce Griffith wrote:
>
>> On 4/15/11 4:37 PM, Roy Stogner wrote:
>>>
>>> On Fri, 15 Apr 2011, Boyce Griffith wrote:
>>>
>>>> The only complication is that the coordinate system being used for the
>>>> mesh is a Lagrangian (material) coordinate system, and the line is in
>>>> the current (physical) coordinate system, but I suppose that I can
>>>> call Elem::build_side() and then reset the nodal positions of the
>>>> generated side element to correspond to the current positions.
>>>
>>> Hmm... one catch with that is that you'll ideally want to make sure
>>> you're moving around *copied* nodes; otherwise you'll have the same
>>> multithreading race conditions that the library ALE code has.
>>
>> OK; and I guess these will need to be manually allocated and deleted?
>
> Make them local stack variables so you can avoid new and delete, but
> you're essentially right, I don't think we've got any facility in
> libMesh right now for doing a "deep copy" of an Elem.

  I tried something like:

     AutoPtr<Elem> side_elem = elem->build_side(side);
     for (int k = 0; k < n_node; ++k)
     {
         side_elem->set_node(k) = ...;
     }

     // do stuff

     for (int k = 0; k < n_node; ++k)
     {
         side_elem->set_node(k) = NULL;
     }

where the last part was to make sure that I didn't accidentally try to 
use the "cloned" nodes.  However, it seems like this also sets the node 
pointers to NULL in elem.  Does side_elem->set_node(k) also have the 
effect of calling elem->set_node(k) ?

Thanks,

-- Boyce

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to