Re: [Libmesh-users] setting initial conditions in a system with multiple variables

2011-07-08 Thread Vasilis Vavourakis
2011/7/8 Derek Gaston > 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). > oh, didn't know that...in fact, yes, i use only Lagrange basis in my probl

Re: [Libmesh-users] setting initial conditions in a system with multiple variables

2011-07-07 Thread Derek Gaston
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 migh

Re: [Libmesh-users] setting initial conditions in a system with multiple variables

2011-07-07 Thread Vasilis Vavourakis
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; ivarn_vars(system.number()); ivar+

Re: [Libmesh-users] setting initial conditions in a system with multiple variables

2011-07-07 Thread John Peterson
On Thu, Jul 7, 2011 at 10:26 AM, Ataollah Mesgarnejad wrote: > 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(),

[Libmesh-users] setting initial conditions in a system with multiple variables

2011-07-07 Thread Ataollah Mesgarnejad
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 -