From: John P. <jwp...@gm...> - 2019-06-12 21:58:39
|
On Wed, Jun 12, 2019 at 4:38 PM Nathan Andrew Miller < Nat...@co...> wrote: > I'm trying to compute the xyz, JxW, and other values at arbitrary points > for a FEBase object during the evaluation of a MOOSE UserObject. I > implemented the following in code: > > ``` > //Create a vector of points > std::vector< Point > cell_points; > > ...things to fill cell_points... > > //Create a vector of ones (the weights) > ones = std::vector< double > (cell_points.size(), 1); > > std::unique_ptr< libMesh::FEBase > fe( > libMesh::FEBase::build(_mesh.dimension(), > libMesh::FEType(_current_elem->default_order()))); > > fe->reinit(_current_elem, &cell_points, &ones); > > You have to pre-request that the xyz values be computed before you call fe->reinit. So put the following line: > std::vector< Point > xyz = fe->get_xyz(); > before the reinit() call and it should work. -- John |