20 #if defined(LIBMESH_HAVE_TRIANGLE) && defined(LIBMESH_HAVE_TETGEN) 36 template <
class QSubCell>
44 template <
class QSubCell>
66 template <
class QSubCell>
68 const std::vector<Real> & vertex_distance_func,
71 libmesh_assert_equal_to (vertex_distance_func.size(), elem.
n_vertices());
72 libmesh_assert_equal_to (_dim, elem.
dim());
75 if (!_elem_cutter.is_cut (elem, vertex_distance_func))
77 _q_subcell.init (elem.
type(), p_level);
78 _points = _q_subcell.get_points();
79 _weights = _q_subcell.get_weights();
92 libmesh_assert (reference_elem !=
nullptr);
94 _elem_cutter(*reference_elem, vertex_distance_func);
103 const std::vector<Elem const *> & inside_elem (_elem_cutter.inside_elements());
104 std::cout << inside_elem.size() <<
" elements inside\n";
106 this->add_subelem_values(inside_elem);
111 const std::vector<Elem const *> & outside_elem (_elem_cutter.outside_elements());
112 std::cout << outside_elem.size() <<
" elements outside\n";
114 this->add_subelem_values(outside_elem);
122 template <
class QSubCell>
126 const std::vector<Real> & subelem_weights = _lagrange_fe->get_JxW();
127 const std::vector<Point> & subelem_points = _lagrange_fe->get_xyz();
129 for (
const auto & elem : subelem)
136 _lagrange_fe->reinit(elem);
137 _weights.insert(_weights.end(),
138 subelem_weights.begin(), subelem_weights.end());
140 _points.insert(_points.end(),
141 subelem_points.begin(), subelem_points.end());
147 for (
unsigned int n=0; n<elem->n_nodes(); n++)
150 libmesh_error_msg(
"Tetgen may have created a 0-volume cell during Cutcell integration.");
165 #endif // LIBMESH_HAVE_TRIANGLE && LIBMESH_HAVE_TETGEN Manages the family, order, etc. parameters for a given FE.
The base class for all geometric element types.
QComposite(unsigned int dim, Order order=INVALID_ORDER)
virtual void init(const Elem &elem, const std::vector< Real > &vertex_distance_func, unsigned int p_level=0) override
void init(triangulateio &t)
const Elem * reference_elem() const
OStreamProxy err(std::cerr)
A quadrature rule for subdivided elements.
std::unique_ptr< FEBase > _lagrange_fe
virtual unsigned int n_vertices() const =0
virtual unsigned short dim() const =0
virtual QuadratureType type() const override
virtual ElemType type() const =0
void add_subelem_values(const std::vector< Elem const *> &subelem)