Skip to content

Commit 8300f2e

Browse files
committed
Override NodeElem::volume() to return 1
This does not change the existing behavior, since the base class Elem::volume() implementation already returned 1 for NodeElems, but it does document the behavior while also avoiding any overhead that might have come from calling Elem::volume().
1 parent 1e3b671 commit 8300f2e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

include/geom/node_elem.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ class NodeElem : public Elem
271271
*/
272272
virtual Order supported_nodal_order() const override;
273273

274+
/**
275+
* Elem::volume() returns the N-dimensional measure of an
276+
* N-dimensional element. For N=2 "volume" is area; for N=1 "volume"
277+
* is length, and for N=0 "volume" is cardinality. A set with 1
278+
* point has 0-"volume" of 1.
279+
*/
280+
virtual Real volume () const override { return Real(1); }
281+
274282
virtual void connectivity(const unsigned int sc,
275283
const IOPackage iop,
276284
std::vector<dof_id_type> & conn) const override;

0 commit comments

Comments
 (0)