Re: [Libmesh-users] how to give variables non-zero initial values?

 Re: [Libmesh-users] how to give variables non-zero initial values? From: Roy Stogner - 2008-09-03 20:53:03 ```On Wed, 3 Sep 2008, yunfei zhu wrote: > I am following example 13 and trying to solve a set of nonlinear PDEs using > the solver of libmesh. > I have noted that: >> From previous Newton iterate, the variable values of "u" and "v" can be > assigned by > u += phi[l][qp]*navier_stokes_system.current_solution (dof_indices_u[l]); > v += phi[l][qp]*navier_stokes_system.current_solution (dof_indices_v[l]); > For the first nonlinear loop, > "current_solution (dof_indices_u[l])" is zero, so all the initial values of > "u" and "v" are assigned 0. But I would like to give the variables non-zero > initial values, could you guys please tell me how should I do that? what > function should be used? Thanks in advance. It depends how your initial values are defined. If they're a known function of (x,y,z), then try System::project_solution. --- Roy ```

 [Libmesh-users] how to give variables non-zero initial values? From: yunfei zhu - 2008-09-03 20:48:21 ```Hi all, I am following example 13 and trying to solve a set of nonlinear PDEs using the solver of libmesh. I have noted that: >From previous Newton iterate, the variable values of "u" and "v" can be assigned by u += phi[l][qp]*navier_stokes_system.current_solution (dof_indices_u[l]); v += phi[l][qp]*navier_stokes_system.current_solution (dof_indices_v[l]); For the first nonlinear loop, "current_solution (dof_indices_u[l])" is zero, so all the initial values of "u" and "v" are assigned 0. But I would like to give the variables non-zero initial values, could you guys please tell me how should I do that? what function should be used? Thanks in advance. Best wishes, yunfei ```
 Re: [Libmesh-users] how to give variables non-zero initial values? From: Roy Stogner - 2008-09-03 20:53:03 ```On Wed, 3 Sep 2008, yunfei zhu wrote: > I am following example 13 and trying to solve a set of nonlinear PDEs using > the solver of libmesh. > I have noted that: >> From previous Newton iterate, the variable values of "u" and "v" can be > assigned by > u += phi[l][qp]*navier_stokes_system.current_solution (dof_indices_u[l]); > v += phi[l][qp]*navier_stokes_system.current_solution (dof_indices_v[l]); > For the first nonlinear loop, > "current_solution (dof_indices_u[l])" is zero, so all the initial values of > "u" and "v" are assigned 0. But I would like to give the variables non-zero > initial values, could you guys please tell me how should I do that? what > function should be used? Thanks in advance. It depends how your initial values are defined. If they're a known function of (x,y,z), then try System::project_solution. --- Roy ```