From: Amneet B. <mai...@gm...> - 2018-09-24 17:12:44
|
Hi John, Is there a way to obtain phi values at the centroid of the element (or in general any other point inside the element)? We can potentially interpolate nodal normals to centroid normal. For do not need exact values of the normal. It is just need to know if the point is on one side of the element or the other for our application. If obtaining phi at centroid is not easy, then we can simply average nodal normals to get the centroid normal. PPS: Just checking QTRAP is exact for FIRST order elements, and QSIMPSON is exact for SECOND order elements in libMesh. Thanks, —Amneet On Mon, Sep 24, 2018 at 7:38 AM John Peterson <jwp...@gm...> wrote: > 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 > > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > |