This method is highly discouraged!  It will only work for Lagrange
shape functions.  You should really use the built in projection
methods by attaching an init function (like John mentioned).

Whenever possible you should endeavor to write shape function agnostic
code... You never know when it might come in handy!  (and libMesh
makes it so dang easy).

Derek

Sent from my iPad

On Jul 7, 2011, at 5:25 PM, Vasilis Vavourakis <[email protected]> wrote:

> how about the following code, would that do for you?
>
> // access one node of the mesh through this pointer
> Node* node;
> // set the solution vector (ie. displacement) to this node
> Real soln[3] ={ u, v, w };
> // loop for all system variables :
> for (unsigned int ivar=0; ivar<node->n_vars(system.number()); ivar++) {
>    // loop for all components (typically one) :
>    for (unsigned int icomp=0; icomp<node->n_comp(system.number(), ivar);
> icomp++) {
>        const unsigned int idof  =node->dof_number(system.number(), ivar,
> 0);
>
>    system.current_solution->set(idof, soln[ivar]);
>    }
> }
>
> you can implement it in your "init_function" ...as in example 9 of libmesh.
>
> cheers,
> Vas
>
>
>
> 2011/7/7 Ataollah Mesgarnejad <[email protected]>
>
>> Dear all,
>>
>> I have a TransientLinearImplicitSystem with 3 variables (u,v,w). I want to
>> initialize it using attach_init_function. How can distinguish between
>> variables in my init function which I pass to attach_init_function(), so to
>> set the initial condition for each variable?
>>
>> Best
>> Ata
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> All of the data generated in your IT infrastructure is seriously valuable.
>> Why? It contains a definitive record of application performance, security
>> threats, fraudulent activity, and more. Splunk takes this data and makes
>> sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-d2d-c2
>> _______________________________________________
>> Libmesh-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Libmesh-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to