Re: [Libmesh-users] save gradientmatrix From: li pan - 2007-04-24 10:26:06 ```Hallo Roy, Maybe, I didn't explain my question clearly. I need the grad_displacemet at each node point but not at quadrature point. In this case, I think the only thing to do is like in MeshFunction::gradient(), go over each element and node_fe_value.reinit(elem,node); Node is each node of the element. thanx pan --- Roy Stogner wrote: > On Mon, 23 Apr 2007, li pan wrote: > > > I have found it. MeshFunction::gradient(). Is it > > right? > > Not if you want to perform these calculations > efficiently. If your > displacement and velocity spaces are expressed in > the same basis (and > probably even if they aren't) the most efficient > thing to do is to > manually sum the local degrees of freedom times > basis gradients at > each quadrature point. See the construction of > grad_u, grad_v, etc. > in example 13. > > You're *already* going to "go over all elements, > nodes again" when > you're assembling the displacement equation matrix > and right hand > side. You might as well calculate the grad(u) > contributions at the > same time. > --- > Roy > > > --- li pan wrote: > > > >> Hallo, > >> I'm calculating a kind of Navier-Stokes equation. > >> After one "solve", I get the velocity vector. > Then > >> I'll evaluate displacement. Here, I have to > >> transform > >> the velocity vector from Euler coordinates to > >> Lagrange > >> coordinates, because of convective derivative: > >> vel: velocity at time t > >> u: displacement at time t > >> I : identity matrix > >> vel(t) = d_u/d_t + grad(u,t)*vel(t). > >> I need to do something like: > >> d_u/d_t = (I+grad(u,t))vel(t) > >> > >> My question is, how to do it effectively? I don't > >> want > >> to go over all elements, nodes again, to > calculate > >> the > >> deformation gradient. > >> Do you have good idea ? > >> > >> pan > >> > >> > >> > __________________________________________________ > >> Do You Yahoo!? > >> Tired of spam? Yahoo! Mail has the best spam > >> protection around > >> http://mail.yahoo.com > >> > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 > express and take > > control of your XML. No limits. Just data. Click > to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Libmesh-users mailing list > > Libmesh-users@... > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ```

 Re: [Libmesh-users] save gradientmatrix From: li pan - 2007-04-23 14:55:26 ```I have found it. MeshFunction::gradient(). Is it right? --- li pan wrote: > Hallo, > I'm calculating a kind of Navier-Stokes equation. > After one "solve", I get the velocity vector. Then > I'll evaluate displacement. Here, I have to > transform > the velocity vector from Euler coordinates to > Lagrange > coordinates, because of convective derivative: > vel: velocity at time t > u: displacement at time t > I : identity matrix > vel(t) = d_u/d_t + grad(u,t)*vel(t). > I need to do something like: > d_u/d_t = (I+grad(u,t))vel(t) > > My question is, how to do it effectively? I don't > want > to go over all elements, nodes again, to calculate > the > deformation gradient. > Do you have good idea ? > > pan > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ```
 Re: [Libmesh-users] save gradientmatrix From: Roy Stogner - 2007-04-23 15:04:34 ```On Mon, 23 Apr 2007, li pan wrote: > I have found it. MeshFunction::gradient(). Is it > right? Not if you want to perform these calculations efficiently. If your displacement and velocity spaces are expressed in the same basis (and probably even if they aren't) the most efficient thing to do is to manually sum the local degrees of freedom times basis gradients at each quadrature point. See the construction of grad_u, grad_v, etc. in example 13. You're *already* going to "go over all elements, nodes again" when you're assembling the displacement equation matrix and right hand side. You might as well calculate the grad(u) contributions at the same time. --- Roy > --- li pan wrote: > >> Hallo, >> I'm calculating a kind of Navier-Stokes equation. >> After one "solve", I get the velocity vector. Then >> I'll evaluate displacement. Here, I have to >> transform >> the velocity vector from Euler coordinates to >> Lagrange >> coordinates, because of convective derivative: >> vel: velocity at time t >> u: displacement at time t >> I : identity matrix >> vel(t) = d_u/d_t + grad(u,t)*vel(t). >> I need to do something like: >> d_u/d_t = (I+grad(u,t))vel(t) >> >> My question is, how to do it effectively? I don't >> want >> to go over all elements, nodes again, to calculate >> the >> deformation gradient. >> Do you have good idea ? >> >> pan >> >> >> __________________________________________________ >> Do You Yahoo!? >> Tired of spam? Yahoo! Mail has the best spam >> protection around >> http://mail.yahoo.com >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > ```
 Re: [Libmesh-users] save gradientmatrix From: li pan - 2007-04-24 10:26:06 ```Hallo Roy, Maybe, I didn't explain my question clearly. I need the grad_displacemet at each node point but not at quadrature point. In this case, I think the only thing to do is like in MeshFunction::gradient(), go over each element and node_fe_value.reinit(elem,node); Node is each node of the element. thanx pan --- Roy Stogner wrote: > On Mon, 23 Apr 2007, li pan wrote: > > > I have found it. MeshFunction::gradient(). Is it > > right? > > Not if you want to perform these calculations > efficiently. If your > displacement and velocity spaces are expressed in > the same basis (and > probably even if they aren't) the most efficient > thing to do is to > manually sum the local degrees of freedom times > basis gradients at > each quadrature point. See the construction of > grad_u, grad_v, etc. > in example 13. > > You're *already* going to "go over all elements, > nodes again" when > you're assembling the displacement equation matrix > and right hand > side. You might as well calculate the grad(u) > contributions at the > same time. > --- > Roy > > > --- li pan wrote: > > > >> Hallo, > >> I'm calculating a kind of Navier-Stokes equation. > >> After one "solve", I get the velocity vector. > Then > >> I'll evaluate displacement. Here, I have to > >> transform > >> the velocity vector from Euler coordinates to > >> Lagrange > >> coordinates, because of convective derivative: > >> vel: velocity at time t > >> u: displacement at time t > >> I : identity matrix > >> vel(t) = d_u/d_t + grad(u,t)*vel(t). > >> I need to do something like: > >> d_u/d_t = (I+grad(u,t))vel(t) > >> > >> My question is, how to do it effectively? I don't > >> want > >> to go over all elements, nodes again, to > calculate > >> the > >> deformation gradient. > >> Do you have good idea ? > >> > >> pan > >> > >> > >> > __________________________________________________ > >> Do You Yahoo!? > >> Tired of spam? Yahoo! Mail has the best spam > >> protection around > >> http://mail.yahoo.com > >> > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 > express and take > > control of your XML. No limits. Just data. Click > to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Libmesh-users mailing list > > Libmesh-users@... > > > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ```
 Re: [Libmesh-users] save gradientmatrix From: Roy Stogner - 2007-04-24 12:35:23 ```On Tue, 24 Apr 2007, li pan wrote: > Maybe, I didn't explain my question clearly. I need > the grad_displacemet at each node point but not at > quadrature point. In this case, I think the only thing > to do is like in MeshFunction::gradient(), > go over each element and > node_fe_value.reinit(elem,node); > Node is each node of the element. Oh, you meant to use the code inside MeshFunction::gradient(), not to actually create a MeshFunction object yourself? In that case, yes, that's probably the best way to go about things. The only problem with MeshFunction is that its PointLocator tricks are often expensive and unnecessary. Keep in mind that you can build quadrature rules that include only the nodes of an element; it may be slightly cheaper to do so and let reinit() calculate all local nodal values of an element at once. --- Roy ```