From: John P. <jwp...@gm...> - 2018-09-24 14:38:13
|
On Sat, Sep 22, 2018 at 8:42 AM Nishant Nangia <nis...@gm...> wrote: > Hi Folks, > > I am working on an application where I need the unit normals on all the > nodes, the centroid, and (in 3D) on the edges halfway between the nodes of > a surface mesh. The boilerplate code I am using to get the normals is > something like: > > libMesh::UniquePtr<FEBase> fe_bdry(FEBase::build(dim, fe_type)); > libMesh::UniquePtr<QBase> qrule_bdry(fe_type.default_quadrature_rule(dim - > 1)); > fe_bdry->attach_quadrature_rule(qrule_bdry.get()); > > ... > > const std::vector<libMesh::Point>& bdry_normals = fe_bdry->get_normals(); > > When constructing the QBase, is there a quadrature rule and order I can > pass to get the normals at those specific locations? My surface meshes will > always consist of EDGE2 elements in 2D and TRI3 elements in 3D. > The nodal quadrature rules in libmesh are QTrap (trapezoidal rule) QSimpson (Simpson's rule) but you should be aware that the normals you get at the nodes will depend on which element you are evaluating the normal from, that is, the element normal direction changes discontinuously at the nodes. -- John |