Now I need to get the gradient on mesh nodes.
I find that the following can be used:
             fe->reinit(elem,&ref_qp);
             for (unsigned int l=0; l<phi.size(); ++l)
                {
                    grad_c.add_scaled(dphi[l][0], 
system.old_solution(dof_indices_c[l]));
                }

How about this? any other suggestion?
Thank you!

-----原始邮件-----
发件人: "John Peterson" <jwpeter...@gmail.com>
发送时间: 2016年8月18日 星期四
收件人: "li.luo" <li....@siat.ac.cn>
抄送: libmesh-users <libmesh-users@lists.sourceforge.net>
主题: Re: [Libmesh-users] Get the hessian on a mesh point






On Thu, Aug 18, 2016 at 2:58 AM, <li....@siat.ac.cn> wrote:

Dear developers,

I want to get the hessian on a mesh point.
I find that there is a function point_hessian in fem_context.C.
How can I get a FEMContext object? I don't have "context" in my code.
FEMContext &c = libmesh_cast_ref<FEMContext&>(context);



You have to be using the FEMSystem stuff for FEMContexts to be available.  See 
examples/fem_system.


In a "traditional" libmesh code, second derivatives of shape functions are 
available by calling FE::get_d2phi().  From that you can reconstruct the 
Hessian of your finite element solution at every quadrature point.




Another question:

Is the output file (for example, tecplot) for solutions obtained using 2nd 
order type elements more accurate than that using 1st order type elements?
Are those values of mid-points on sides used to display the solution in 
tecplot? Otherwise, it would be too course to show the result.



There appears to be one type of geometric element per spatial dimension 
(lineseg, quadrilateral, brick) written to Tecplot files.  For higher-order 
elements, e.g. Hex27's, we write the quadratic nodal solution on 8 child 
elements (see Hex27::connectivity(), TECPLOT case).  See tecplot_io.C for more 
details.


--

John


--
Li Luo
https://sites.google.com/site/rolyliluo/
Shenzhen Institutes of Advanced Technology
Address: 1068 Xueyuan Avenue, Shenzhen University Town, Shenzhen, P.R.China
Tel: +86-15899753087
li....@siat.ac.cn




------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to