MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / FiniteElement

Method FiniteElement

cpp/dolfinx/fem/FiniteElement.cpp:111–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109//-----------------------------------------------------------------------------
110template <std::floating_point T>
111FiniteElement<T>::FiniteElement(
112 const basix::FiniteElement<T>& element,
113 const std::optional<std::vector<std::size_t>>& value_shape, bool symmetric)
114 : _value_shape(value_shape.value_or(element.value_shape())),
115 _bs(_compute_block_size(value_shape, symmetric)),
116 _cell_type(mesh::cell_type_from_basix_type(element.cell_type())),
117 _space_dim(_bs * element.dim()),
118 _reference_value_shape(element.value_shape()),
119 _element(std::make_unique<basix::FiniteElement<T>>(element)),
120 _symmetric(symmetric),
121 _needs_dof_permutations(
122 !element.dof_transformations_are_identity()
123 and element.dof_transformations_are_permutations()),
124 _needs_dof_transformations(
125 !element.dof_transformations_are_identity()
126 and !element.dof_transformations_are_permutations()),
127 _entity_dofs(element.entity_dofs()),
128 _entity_closure_dofs(element.entity_closure_dofs())
129{
130 if (value_shape and !element.value_shape().empty())
131 {
132 throw std::runtime_error("Blocked finite elements can be constructed only "
133 "from scalar base elements.");
134 }
135
136 if (value_shape)
137 {
138 _sub_elements
139 = std::vector<std::shared_ptr<const FiniteElement<geometry_type>>>(
140 _bs, std::make_shared<FiniteElement<T>>(element));
141 }
142 else
143 _sub_elements = {};
144
145 std::string family;
146 switch (_element->family())
147 {
148 case basix::element::family::P:
149 family = "Lagrange";
150 break;
151 case basix::element::family::DPC:
152 family = "Discontinuous Lagrange";
153 break;
154 default:
155 family = "unknown";
156 break;
157 }
158
159 _signature = "Basix element " + family + " " + std::to_string(_bs);
160}
161//-----------------------------------------------------------------------------
162template <std::floating_point T>
163FiniteElement<T>::FiniteElement(std::vector<BasixElementData<T>> elements)

Callers

nothing calls this directly

Calls 12

_compute_block_sizeFunction · 0.85
_build_element_listFunction · 0.85
cell_dimFunction · 0.85
value_shapeMethod · 0.45
cell_typeMethod · 0.45
dimMethod · 0.45
sizeMethod · 0.45
signatureMethod · 0.45
block_sizeMethod · 0.45
space_dimensionMethod · 0.45

Tested by

no test coverage detected