24template <
int size,
typename LV>
28 "This function is only supported for Lagrange basis");
29 assert(localView.bound() &&
"The local view must be bound to an element");
30 const auto& localFE = localView.tree().child(0).finiteElement();
31 lagrangeNodeCoords.resize(localFE.size());
32 std::vector<double> out;
33 for (
int i = 0; i < size; i++) {
35 localFE.localInterpolation().interpolate(ithCoord, out);
36 for (std::size_t j = 0; j < out.size(); j++)
37 lagrangeNodeCoords[j][i] = out[j];
39 for (
auto& nCoord : lagrangeNodeCoords)
40 nCoord = localView.element().geometry().global(nCoord);
54 const auto& referenceElement = Dune::referenceElement<double, dim>(element.type());
55 const int numberOfVertices = referenceElement.size(codim);
57 auto getPosition = [=](
const int i) {
return referenceElement.position(i, codim); };
58 return std::views::transform(std::views::iota(0, numberOfVertices), getPosition);
auto referenceElementSubEntityPositions(FE &fe, int codim)
A function to obtain the local coordinates of subentities of an FiniteElement.
Definition: functionhelper.hh:51
auto referenceElementVertexPositions(FE &fe)
A function to obtain the local coordinates the vertices of an FiniteElement.
Definition: functionhelper.hh:69
void obtainLagrangeNodePositions(const LV &localView, std::vector< Dune::FieldVector< double, size > > &lagrangeNodeCoords)
A function to obtain the global positions of the nodes of an element with Lagrangian basis,...
Definition: functionhelper.hh:25
Definition: algorithms.hh:17
FE class is a base class for all finite elements.
Definition: febase.hh:81
const GridElement & gridElement() const
Get the grid element associated with the local view.
Definition: febase.hh:130
static constexpr int mydim
Dimension of the geometry.
Definition: fetraits.hh:67
Definition: utils/dirichletvalues.hh:30
Concept to check if a node in a basis tree is a Lagrangian node.
Definition: concepts.hh:77