Commit 57411068 authored by Tobias Leibner's avatar Tobias Leibner

element.geometry().type() -> element.type()

parent d29e2888
Pipeline #46699 passed with stage
in 180 minutes and 35 seconds
......@@ -68,7 +68,7 @@ boundary_interpolation(const XT::Functions::GridFunctionInterface<XT::Grid::extr
// interpolate
fe.interpolation().interpolate(
[&](const auto& xx) { return local_source->evaluate(xx); }, local_source->order(), local_dofs);
const auto& reference_element = ReferenceElements<D, d>::general(element.geometry().type());
const auto& reference_element = ReferenceElements<D, d>::general(element.type());
// but keep only those DoFs associated with the intersection, therefore determine these DoFs
std::set<size_t> local_target_boundary_DoFs;
const auto local_key_indices = fe.coefficients().local_key_indices();
......
......@@ -59,7 +59,7 @@ raviart_thomas_interpolation(
const auto& local_keys_assosiated_with_intersection = intersection_to_local_key_map[intersection_index];
if (local_keys_assosiated_with_intersection.size() > 0) {
const auto intersection_fe =
make_local_orthonormal_finite_element<D, d - 1, R>(intersection.geometry().type(), rt_fe.order());
make_local_orthonormal_finite_element<D, d - 1, R>(intersection.type(), rt_fe.order());
const auto& intersection_Pk_basis = intersection_fe->basis();
DUNE_THROW_IF(intersection_Pk_basis.size() != local_keys_assosiated_with_intersection.size(),
Exceptions::interpolation_error,
......@@ -78,7 +78,7 @@ raviart_thomas_interpolation(
local_source_neighbor->bind(neighbor);
// do a face quadrature, average source
for (auto&& quadrature_point : QuadratureRules<D, d - 1>::rule(
intersection.geometry().type(),
intersection.type(),
std::max(rt_basis->order() + intersection_Pk_basis.order(),
std::max(local_source_element->order(), local_source_neighbor->order())
+ intersection_Pk_basis.order()))) {
......@@ -122,7 +122,7 @@ raviart_thomas_interpolation(
there_are_intersection_dofs_to_determine = true;
// do a face quadrature
for (auto&& quadrature_point : QuadratureRules<D, d - 1>::rule(
intersection.geometry().type(),
intersection.type(),
std::max(rt_basis->order() + intersection_Pk_basis.order(),
local_source_element->order() + intersection_Pk_basis.order()))) {
const auto point_on_reference_intersection = quadrature_point.position();
......@@ -172,8 +172,7 @@ raviart_thomas_interpolation(
DUNE_THROW_IF(rt_basis->order() < 1,
Exceptions::interpolation_error,
"DoFs associated with the element only make sense for orders >= 1!");
const auto element_fe =
make_local_orthonormal_finite_element<D, d, R, d>(element.geometry().type(), rt_fe.order() - 1);
const auto element_fe = make_local_orthonormal_finite_element<D, d, R, d>(element.type(), rt_fe.order() - 1);
const auto& element_Pkminus1_basis = element_fe->basis();
DUNE_THROW_IF(element_Pkminus1_basis.size() != local_keys_assosiated_with_element.size(),
Exceptions::interpolation_error,
......@@ -184,7 +183,7 @@ raviart_thomas_interpolation(
XT::LA::CommonDenseVector<R> rhs(element_Pkminus1_basis.size(), 0);
// do a volume quadrature
for (auto&& quadrature_point :
QuadratureRules<D, d>::rule(element.geometry().type(),
QuadratureRules<D, d>::rule(element.type(),
std::max(rt_basis->order() + element_Pkminus1_basis.order(),
local_source_element->order() + element_Pkminus1_basis.order()))) {
const auto point_in_reference_element = quadrature_point.position();
......
......@@ -95,7 +95,7 @@ public:
result *= 0;
// loop over all quadrature points
const auto integrand_order = integrand_->order(test_basis, ansatz_basis) + over_integrate_;
for (const auto& quadrature_point : QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto point_in_reference_element = quadrature_point.position();
// integration factors
const auto integration_factor = element.geometry().integrationElement(point_in_reference_element);
......@@ -196,8 +196,8 @@ public:
const size_t integrand_order =
integrand_->order(test_basis_inside, ansatz_basis_inside, test_basis_outside, ansatz_basis_outside)
+ over_integrate_;
for (const auto& quadrature_point : QuadratureRules<D, d - 1>::rule(
intersection.geometry().type(), XT::Common::numeric_cast<int>(integrand_order))) {
for (const auto& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection.type(), XT::Common::numeric_cast<int>(integrand_order))) {
const auto point_in_reference_intersection = quadrature_point.position();
// integration factors
const auto integration_factor = intersection.geometry().integrationElement(point_in_reference_intersection);
......
......@@ -82,7 +82,7 @@ public:
result *= 0;
// loop over all quadrature points
const auto integrand_order = integrand_->order(basis, param) + over_integrate_;
for (auto&& quadrature_point : QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (auto&& quadrature_point : QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto point_in_reference_element = quadrature_point.position();
// integration factors
const auto integration_factor = element.geometry().integrationElement(point_in_reference_element);
......@@ -165,8 +165,7 @@ public:
result *= 0;
// loop over all quadrature points
const auto integrand_order = integrand_->order(inside_basis, outside_basis, param) + over_integrate_;
for (const auto& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : QuadratureRules<D, d - 1>::rule(intersection.type(), integrand_order)) {
const auto point_in_reference_intersection = quadrature_point.position();
// integration factors
const auto integration_factor = intersection.geometry().integrationElement(point_in_reference_intersection);
......
......@@ -128,7 +128,7 @@ public:
const auto u_order = u_->order(param);
const auto local_basis_order = basis.order(param);
const auto integrand_order = local_flux_->order(param) * u_order + std::max(local_basis_order - 1, 0);
for (const auto& quadrature_point : QuadratureRules<D, d>::rule(element().geometry().type(), integrand_order)) {
for (const auto& quadrature_point : QuadratureRules<D, d>::rule(element().type(), integrand_order)) {
// prepare
const auto point_in_reference_element = quadrature_point.position();
const auto integration_factor = element().geometry().integrationElement(point_in_reference_element);
......@@ -300,8 +300,7 @@ public:
const auto v_order = v_->order(param);
const auto integrand_order = std::max(inside_basis.order(param), outside_basis.order(param))
+ std::max(inside_flux_order * u_order, outside_flux_order * v_order);
for (const auto& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection().geometry().type(), integrand_order)) {
for (const auto& quadrature_point : QuadratureRules<D, d - 1>::rule(intersection().type(), integrand_order)) {
// prepare
const auto point_in_reference_intersection = quadrature_point.position();
const auto integration_factor = intersection().geometry().integrationElement(point_in_reference_intersection);
......@@ -458,8 +457,7 @@ public:
inside_local_dofs_.resize(inside_basis.size(param));
inside_local_dofs_ *= 0.;
const auto integrand_order = inside_basis.order(param) + numerical_flux_order_ * u_->order(param);
for (const auto& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection().geometry().type(), integrand_order)) {
for (const auto& quadrature_point : QuadratureRules<D, d - 1>::rule(intersection().type(), integrand_order)) {
// prepare
const auto point_in_reference_intersection = quadrature_point.position();
const auto integration_factor = intersection().geometry().integrationElement(point_in_reference_intersection);
......@@ -594,8 +592,7 @@ public:
inside_local_dofs_.resize(inside_basis.size(param));
inside_local_dofs_ *= 0.;
const auto integrand_order = inside_basis.order(param) + local_flux_->order(param) * u_->order(param);
for (const auto& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection().geometry().type(), integrand_order)) {
for (const auto& quadrature_point : QuadratureRules<D, d - 1>::rule(intersection().type(), integrand_order)) {
// prepare
const auto point_in_reference_intersection = quadrature_point.position();
const auto integration_factor = intersection().geometry().integrationElement(point_in_reference_intersection);
......@@ -762,8 +759,7 @@ public:
const auto neighbor = intersection.outside();
v_->bind(neighbor);
const auto integration_order = std::pow(std::max(u_->order(param), v_->order(param)), 2);
for (auto&& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection.geometry().type(), integration_order)) {
for (auto&& quadrature_point : QuadratureRules<D, d - 1>::rule(intersection.type(), integration_order)) {
const auto point_in_reference_intersection = quadrature_point.position();
const auto point_in_reference_element =
intersection.geometryInInside().global(point_in_reference_intersection);
......
......@@ -129,7 +129,7 @@ public:
const auto& local_keys_assosiated_with_intersection = intersection_to_local_key_map[intersection_index];
if (local_keys_assosiated_with_intersection.size() > 0) {
const auto intersection_fe =
make_local_orthonormal_finite_element<D, d - 1, F>(intersection.geometry().type(), rt_fe.order());
make_local_orthonormal_finite_element<D, d - 1, F>(intersection.type(), rt_fe.order());
const auto& intersection_Pk_basis = intersection_fe->basis();
DUNE_THROW_IF(intersection_Pk_basis.size() != local_keys_assosiated_with_intersection.size(),
Exceptions::interpolation_error,
......@@ -154,7 +154,7 @@ public:
std::max(local_source_element->order(param),
std::max(intersection_Pk_basis.order(), local_source_neighbor->order(param))));
for (auto&& quadrature_point : QuadratureRules<D, d - 1>::rule(
intersection.geometry().type(), 2 * std::max(max_polorder, rt_basis->order()))) {
intersection.type(), 2 * std::max(max_polorder, rt_basis->order()))) {
const auto point_on_reference_intersection = quadrature_point.position();
const auto point_in_reference_element =
intersection.geometryInInside().global(point_on_reference_intersection);
......@@ -235,8 +235,8 @@ public:
there_are_intersection_dofs_to_determine = true;
// do a face quadrature
const int max_polorder = std::max(intersection_Pk_basis.order(), local_source_element->order(param));
for (auto&& quadrature_point : QuadratureRules<D, d - 1>::rule(
intersection.geometry().type(), 2 * std::max(max_polorder, rt_basis->order()))) {
for (auto&& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection.type(), 2 * std::max(max_polorder, rt_basis->order()))) {
const auto point_on_reference_intersection = quadrature_point.position();
const auto point_in_reference_element =
intersection.geometryInInside().global(point_on_reference_intersection);
......
......@@ -130,13 +130,13 @@ public:
DynamicVector<size_t> global_DoF_indices(range_space_.mapper().max_local_size());
// walk the grid
for (auto&& element : elements(assembly_grid_view_)) {
const auto& lagrange_points = cg_space.finite_elements().get(element.geometry().type(), order).lagrange_points();
DUNE_THROW_IF(range_space_.finite_elements().get(element.geometry().type(), order).lagrange_points().size()
const auto& lagrange_points = cg_space.finite_elements().get(element.type(), order).lagrange_points();
DUNE_THROW_IF(range_space_.finite_elements().get(element.type(), order).lagrange_points().size()
!= lagrange_points.size(),
Exceptions::operator_error,
"This should not happen, the Lagrange points should coincide for Lagrange spaces of same order!\n"
<< "range_space_.finite_element(element.geometry().type(), order).lagrange_points().size() = "
<< range_space_.finite_elements().get(element.geometry().type(), order).lagrange_points().size()
<< "range_space_.finite_element(element.type(), order).lagrange_points().size() = "
<< range_space_.finite_elements().get(element.type(), order).lagrange_points().size()
<< "\nlagrange_points.size() = " << lagrange_points.size());
cg_space.mapper().global_indices(element, global_lagrange_point_indices);
range_space_.mapper().global_indices(element, global_DoF_indices);
......
......@@ -115,7 +115,7 @@ private:
void post_bind(const ElementType& elemnt) override final
{
current_local_fe_ = XT::Common::ConstStorageProvider<LocalFiniteElementInterface<D, d, R, r, rC>>(
self_.local_finite_elements_.get(elemnt.geometry().type(), self_.fe_order_));
self_.local_finite_elements_.get(elemnt.type(), self_.fe_order_));
}
public:
......
......@@ -113,7 +113,7 @@ private:
void post_bind(const ElementType& elemnt) override final
{
current_local_fe_ = XT::Common::ConstStorageProvider<LocalFiniteElementInterface<D, d, R, r, 1>>(
self_.local_finite_elements_.get(elemnt.geometry().type(), 0));
self_.local_finite_elements_.get(elemnt.type(), 0));
}
public:
......
......@@ -126,7 +126,7 @@ private:
void post_bind(const ElementType& elemnt) override final
{
current_local_fe_ = XT::Common::ConstStorageProvider<LocalFiniteElementInterface<D, d, R, d>>(
self_.local_finite_elements_.get(elemnt.geometry().type(), self_.order_));
self_.local_finite_elements_.get(elemnt.type(), self_.order_));
if (set_data_in_post_bind_)
current_fe_data_ = self_.fe_data_.at(self_.element_indices_.global_index(elemnt, 0));
}
......@@ -244,8 +244,8 @@ private:
const auto intersection_index = intersection.indexInInside();
const auto& local_keys_assosiated_with_intersection = intersection_to_local_key_map[intersection_index];
if (local_keys_assosiated_with_intersection.size() > 0) {
const auto intersection_fe = make_local_orthonormal_finite_element<D, d - 1, R>(
intersection.geometry().type(), finite_element().order());
const auto intersection_fe =
make_local_orthonormal_finite_element<D, d - 1, R>(intersection.type(), finite_element().order());
const auto& intersection_Pk_basis = intersection_fe->basis();
DUNE_THROW_IF(intersection_Pk_basis.size() != local_keys_assosiated_with_intersection.size(),
Exceptions::interpolation_error,
......@@ -257,7 +257,7 @@ private:
XT::LA::CommonDenseVector<R> rhs(intersection_Pk_basis.size(), 0);
// do a face quadrature
for (auto&& quadrature_point :
QuadratureRules<D, d - 1>::rule(intersection.geometry().type(),
QuadratureRules<D, d - 1>::rule(intersection.type(),
std::max(this->order() + intersection_Pk_basis.order(),
element_function_order + intersection_Pk_basis.order()))) {
const auto point_on_reference_intersection = quadrature_point.position();
......@@ -304,8 +304,8 @@ private:
DUNE_THROW_IF(this->order() < 1,
Exceptions::interpolation_error,
"DoFs associated with the element only make sense for orders >= 1!");
const auto element_fe = make_local_orthonormal_finite_element<D, d, R, d>(this->element().geometry().type(),
finite_element().order() - 1);
const auto element_fe =
make_local_orthonormal_finite_element<D, d, R, d>(this->element().type(), finite_element().order() - 1);
const auto& element_Pkminus1_basis = element_fe->basis();
DUNE_THROW_IF(element_Pkminus1_basis.size() != local_keys_assosiated_with_element.size(),
Exceptions::interpolation_error,
......@@ -316,7 +316,7 @@ private:
XT::LA::CommonDenseVector<R> rhs(element_Pkminus1_basis.size(), 0);
// do a volume quadrature
for (auto&& quadrature_point :
QuadratureRules<D, d>::rule(this->element().geometry().type(),
QuadratureRules<D, d>::rule(this->element().type(),
std::max(this->order() + element_Pkminus1_basis.order(),
element_function_order + element_Pkminus1_basis.order()))) {
const auto point_in_reference_element = quadrature_point.position();
......
......@@ -184,7 +184,7 @@ protected:
// unique indices for codim 0 entities, which cannot be achieved by the grid layers index set for mixed grids)
fe_data_.resize(element_indices_.size());
for (auto&& entity : elements(grid_view_)) {
const auto geometry_type = entity.geometry().type();
const auto geometry_type = entity.type();
const auto& finite_element = local_finite_elements_->get(geometry_type, order_);
const auto& coeffs = finite_element.coefficients();
const auto element_index = element_indices_.global_index(entity, 0);
......
......@@ -141,7 +141,7 @@ public:
// make sense as a global basis. This does not matter, however, since we only need to be able to restore that
// same basis later on to make sense of the DoF information.
auto element_basis = this->basis().localize();
element_restriction_FE_data = element_basis->default_data(element.geometry().type());
element_restriction_FE_data = element_basis->default_data(element.type());
element_basis->restore(element, element_restriction_FE_data);
auto lhs = LocalElementIntegralBilinearForm<E, r, rC, R, R>(LocalElementProductIntegrand<E, r, R, R>())
.apply2(*element_basis, *element_basis);
......
......@@ -111,12 +111,12 @@ public:
size_t local_size(const ElementType& element) const override final
{
return local_coefficients(element.geometry().type()).size();
return local_coefficients(element.type()).size();
}
size_t global_index(const ElementType& element, const size_t local_index) const override final
{
const auto& coeffs = local_coefficients(element.geometry().type());
const auto& coeffs = local_coefficients(element.type());
if (local_index >= coeffs.size())
DUNE_THROW(Exceptions::mapper_error,
"local_size(element) = " << coeffs.size() << "\n local_index = " << local_index);
......@@ -130,8 +130,7 @@ public:
// not the same in all elements sharing the subentity.
#ifndef NDEBUG
if (d >= 2 && fe_order_ >= 3)
assert(element.geometry().type() == Dune::GeometryTypes::cube(d)
&& "Not implemented for this element, see comment above!");
assert(element.type() == Dune::GeometryTypes::cube(d) && "Not implemented for this element, see comment above!");
#endif
return mapper_.subIndex(element, local_key.subEntity(), local_key.codim()) + local_key.index();
} // ... mapToGlobal(...)
......@@ -140,7 +139,7 @@ public:
void global_indices(const ElementType& element, DynamicVector<size_t>& indices) const override final
{
const auto& coeffs = local_coefficients(element.geometry().type());
const auto& coeffs = local_coefficients(element.type());
const auto local_sz = coeffs.size();
assert(local_sz <= max_local_size_);
if (indices.size() < local_sz)
......
......@@ -86,7 +86,7 @@ public:
size_t local_size(const ElementType& element) const override final
{
return local_coefficients(element.geometry().type()).size();
return local_coefficients(element.type()).size();
}
size_t global_index(const ElementType& element, const size_t local_index) const override final
......
......@@ -70,7 +70,7 @@ struct DivIntegrandTest : public IntegrandTest<G>
DynamicMatrix<D> test_div_result(2, 2, 0.);
DynamicMatrix<D> ansatz_div_result(2, 2, 0.);
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(
element.geometry().type(), std::max(test_div_integrand_order, ansatz_div_integrand_order))) {
element.type(), std::max(test_div_integrand_order, ansatz_div_integrand_order))) {
const auto& x = quadrature_point.position();
test_div_integrand.evaluate(*vector_test_, *scalar_ansatz_, x, test_div_result);
ansatz_div_integrand.evaluate(*scalar_test_, *vector_ansatz_, x, ansatz_div_result);
......
......@@ -79,7 +79,7 @@ struct GradientValueIntegrandTest : public IntegrandTest<G>
DynamicMatrix<D> result(2, 2, 0.);
DynamicMatrix<D> result2(2, 2, 0.);
for (const auto& quadrature_point :
Dune::QuadratureRules<D, d>::rule(element.geometry().type(), std::max(integrand_order, integrand_order2))) {
Dune::QuadratureRules<D, d>::rule(element.type(), std::max(integrand_order, integrand_order2))) {
const auto& x = quadrature_point.position();
scalar_integrand.evaluate(*scalar_test_, *scalar_ansatz_, x, result);
scalar_integrand2.evaluate(*scalar_test_, *scalar_ansatz_, x, result2);
......@@ -116,7 +116,7 @@ struct GradientValueIntegrandTest : public IntegrandTest<G>
DynamicMatrix<D> result(2, 2, 0.);
DynamicMatrix<D> result2(2, 2, 0.);
for (const auto& quadrature_point :
Dune::QuadratureRules<D, d>::rule(element.geometry().type(), std::max(integrand_order, integrand_order2))) {
Dune::QuadratureRules<D, d>::rule(element.type(), std::max(integrand_order, integrand_order2))) {
const auto& x = quadrature_point.position();
integrand.evaluate(*vector_test_, *vector_ansatz_, x, result);
integrand2.evaluate(*vector_test_, *vector_ansatz_, x, result2);
......
......@@ -83,7 +83,7 @@ struct LaplaceIntegrandTest : public IntegrandTest<G>
scalar_integrand.bind(element);
const auto integrand_order = scalar_integrand.order(*scalar_test_, *scalar_ansatz_);
DynamicMatrix<D> result(2, 2, 0.);
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto& x = quadrature_point.position();
scalar_integrand.evaluate(*scalar_test_, *scalar_ansatz_, x, result);
DynamicMatrix<D> expected_result{
......@@ -105,7 +105,7 @@ struct LaplaceIntegrandTest : public IntegrandTest<G>
integrand.bind(element);
const auto integrand_order = integrand.order(*vector_test_, *vector_ansatz_);
DynamicMatrix<D> result(2, 2, 0.);
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto& x = quadrature_point.position();
integrand.evaluate(*vector_test_, *vector_ansatz_, x, result);
DynamicMatrix<D> expected_result{
......
......@@ -73,7 +73,7 @@ struct ProductIntegrandTest : public IntegrandTest<G>
scalar_integrand.bind(element);
const auto integrand_order = scalar_integrand.order(*scalar_test_, *scalar_ansatz_);
DynamicMatrix<D> result(2, 2, 0.);
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto& x = quadrature_point.position();
scalar_integrand.evaluate(*scalar_test_, *scalar_ansatz_, x, result);
DynamicMatrix<D> expected_result{{std::pow(x[0] * x[1], 2), std::pow(x[0] * x[1], 3)},
......@@ -97,7 +97,7 @@ struct ProductIntegrandTest : public IntegrandTest<G>
integrand.bind(element);
const auto integrand_order = integrand.order(*vector_test_, *vector_ansatz_);
DynamicMatrix<D> result(2, 2, 0.);
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto& x = quadrature_point.position();
integrand.evaluate(*vector_test_, *vector_ansatz_, x, result);
DynamicMatrix<D> expected_result{{std::pow(x[0], 2) + 2 * x[0] * x[1] + 5 * x[1],
......
......@@ -78,7 +78,7 @@ struct SymmetrizedLaplaceIntegrandTest : public IntegrandTest<G>
integrand.bind(element);
const auto integrand_order = integrand.order(*vector_test_, *vector_ansatz_);
DynamicMatrix<D> result(2, 2, 0.);
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.geometry().type(), integrand_order)) {
for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.type(), integrand_order)) {
const auto& x = quadrature_point.position();
integrand.evaluate(*vector_test_, *vector_ansatz_, x, result);
DynamicMatrix<D> expected_result{
......
......@@ -81,7 +81,7 @@ struct OswaldInterpolationOperatorOnLeafViewTest : public ::testing::Test
for (auto&& element : elements(space->grid_view())) {
local_source->bind(element);
local_source->dofs().assign_from(space->finite_elements()
.get(element.geometry().type(), 1)
.get(element.type(), 1)
.interpolation()
.interpolate(
[&](const auto& x_local) {
......@@ -162,13 +162,13 @@ struct OswaldInterpolationOperatorOnLeafViewTest : public ::testing::Test
.apply(intersection, *difference_inside, *difference_outside)[0][0];
// associate intersection corners with global vertex IDs
auto local_vertex_indicators_inside = vertex_indicators.local_discrete_function(inside_element);
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.geometry().type());
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.type());
for (auto&& ii : XT::Common::value_range(inside_reference_element.size(intersection.indexInInside(), 1, d))) {
const auto vertex_index_inside = inside_reference_element.subEntity(intersection.indexInInside(), 1, ii, d);
local_vertex_indicators_inside->dofs()[vertex_index_inside] += intersection_diameter * l2_jump_norm2;
}
auto local_vertex_indicators_outside = vertex_indicators.local_discrete_function(outside_element);
const auto& outside_reference_element = ReferenceElements<D, d>::general(outside_element.geometry().type());
const auto& outside_reference_element = ReferenceElements<D, d>::general(outside_element.type());
for (auto&& ii :
XT::Common::value_range(outside_reference_element.size(intersection.indexInOutside(), 1, d))) {
const auto vertex_index_outside =
......@@ -207,7 +207,7 @@ struct OswaldInterpolationOperatorOnLeafViewTest : public ::testing::Test
.apply(intersection, *difference_inside, *difference_inside)[0][0];
// associate intersection corners with global vertex IDs
auto local_vertex_indicators_inside = vertex_indicators.local_discrete_function(inside_element);
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.geometry().type());
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.type());
for (auto&& ii : XT::Common::value_range(inside_reference_element.size(intersection.indexInInside(), 1, d))) {
const auto vertex_index_inside = inside_reference_element.subEntity(intersection.indexInInside(), 1, ii, d);
local_vertex_indicators_inside->dofs()[vertex_index_inside] += intersection_diameter * l2_jump_norm2;
......@@ -297,13 +297,13 @@ struct OswaldInterpolationOperatorOnLeafViewTest : public ::testing::Test
.apply(intersection, *difference_inside, *difference_outside)[0][0];
// associate intersection corners with global vertex IDs
auto local_vertex_indicators_inside = vertex_indicators.local_discrete_function(inside_element);
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.geometry().type());
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.type());
for (auto&& ii : XT::Common::value_range(inside_reference_element.size(intersection.indexInInside(), 1, d))) {
const auto vertex_index_inside = inside_reference_element.subEntity(intersection.indexInInside(), 1, ii, d);
local_vertex_indicators_inside->dofs()[vertex_index_inside] += l2_jump_norm2 / intersection_diameter;
}
auto local_vertex_indicators_outside = vertex_indicators.local_discrete_function(outside_element);
const auto& outside_reference_element = ReferenceElements<D, d>::general(outside_element.geometry().type());
const auto& outside_reference_element = ReferenceElements<D, d>::general(outside_element.type());
for (auto&& ii :
XT::Common::value_range(outside_reference_element.size(intersection.indexInOutside(), 1, d))) {
const auto vertex_index_outside =
......@@ -342,7 +342,7 @@ struct OswaldInterpolationOperatorOnLeafViewTest : public ::testing::Test
.apply(intersection, *difference_inside, *difference_inside)[0][0];
// associate intersection corners with global vertex IDs
auto local_vertex_indicators_inside = vertex_indicators.local_discrete_function(inside_element);
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.geometry().type());
const auto& inside_reference_element = ReferenceElements<D, d>::general(inside_element.type());
for (auto&& ii : XT::Common::value_range(inside_reference_element.size(intersection.indexInInside(), 1, d))) {
const auto vertex_index_inside = inside_reference_element.subEntity(intersection.indexInInside(), 1, ii, d);
local_vertex_indicators_inside->dofs()[vertex_index_inside] += l2_jump_norm2 / intersection_diameter;
......@@ -406,7 +406,7 @@ struct OswaldInterpolationOperatorOnCubicLeafViewTest : public OswaldInterpolati
local_expected_range_for_cubic_grids->bind(element);
local_expected_range_for_cubic_grids->dofs().assign_from(
self.space->finite_elements()
.get(element.geometry().type(), 1)
.get(element.type(), 1)
.interpolation()
.interpolate(
[&](const auto& x_local) {
......
......@@ -77,7 +77,7 @@ struct SpaceTestBase : public ::testing::Test
ASSERT_NE(space, nullptr);
ASSERT_TRUE(space->is_lagrangian()) << "Do not call this test otherwise!";
for (auto&& element : elements(*grid_view))
EXPECT_EQ(r * numLagrangePoints(element.geometry().type().id(), d, p), space->basis().localize(element)->size());
EXPECT_EQ(r * numLagrangePoints(element.type().id(), d, p), space->basis().localize(element)->size());
}
void basis_of_lagrange_space_exists_on_each_element_with_correct_order()
......@@ -106,7 +106,7 @@ struct SpaceTestBase : public ::testing::Test
ASSERT_TRUE(space->is_lagrangian()) << "Do not call this test otherwise!";
for (auto&& element : elements(*grid_view)) {
const auto basis = space->basis().localize(element);
const auto lagrange_points = space->finite_elements().get(element.geometry().type(), p).lagrange_points();
const auto lagrange_points = space->finite_elements().get(element.type(), p).lagrange_points();
EXPECT_EQ(lagrange_points.size(), basis->size() / r);
for (size_t ii = 0; ii < lagrange_points.size(); ++ii) {
const auto values = basis->evaluate_set(lagrange_points[ii]);
......@@ -131,10 +131,10 @@ struct SpaceTestBase : public ::testing::Test
ASSERT_NE(space, nullptr);
ASSERT_TRUE(space->is_lagrangian()) << "Do not call this test otherwise!";
for (auto&& element : elements(*grid_view)) {
const auto& reference_element = ReferenceElements<D, d>::general(element.geometry().type());
const auto& reference_element = ReferenceElements<D, d>::general(element.type());
const auto basis = space->basis().localize(element);
const double h = 1e-6;
for (const auto& quadrature_point : QuadratureRules<D, d>::rule(element.geometry().type(), basis->order())) {
for (const auto& quadrature_point : QuadratureRules<D, d>::rule(element.type(), basis->order())) {
const auto& xx = quadrature_point.position();
const auto& J_inv_T = element.geometry().jacobianInverseTransposed(xx);
const auto jacobians = basis->jacobians_of_set(xx);
......@@ -185,7 +185,7 @@ struct SpaceTestBase : public ::testing::Test
ASSERT_NE(space, nullptr);
ASSERT_TRUE(space->is_lagrangian()) << "Do not call this test otherwise!";
for (auto&& element : elements(*grid_view))
EXPECT_EQ(r * numLagrangePoints(element.geometry().type().id(), d, p), space->mapper().local_size(element));
EXPECT_EQ(r * numLagrangePoints(element.type().id(), d, p), space->mapper().local_size(element));
}
void mapper_reports_correct_max_num_DoFs()
......
......@@ -57,7 +57,7 @@ struct ContinuousLagrangeSpaceTest
for (auto&& element : elements(*this->grid_view)) {
const auto global_indices = this->space->mapper().global_indices(element);
EXPECT_LE(this->space->mapper().local_size(element), global_indices.size());
const auto lagrange_points = this->space->finite_elements().get(element.geometry().type(), p).lagrange_points();
const auto lagrange_points = this->space->finite_elements().get(element.type(), p).lagrange_points();
EXPECT_EQ(lagrange_points.size(), this->space->mapper().local_size(element));
for (size_t ii = 0; ii < lagrange_points.size(); ++ii) {
const auto global_lagrange_point = element.geometry().global(lagrange_points[ii]);
......
......@@ -71,7 +71,7 @@ struct RtSpace : public ::testing::Test
ASSERT_NE(grid_view(), nullptr);
ASSERT_NE(space, nullptr);
for (auto&& element : elements(*grid_view())) {
const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.geometry().type());
const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.type());
EXPECT_EQ(reference_element.size(1), space->basis().localize(element)->size());
}
}
......@@ -89,7 +89,7 @@ struct RtSpace : public ::testing::Test
ASSERT_NE(grid_view(), nullptr);
ASSERT_NE(space, nullptr);
for (auto&& element : elements(*grid_view())) {
const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.geometry().type());
const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.type());
EXPECT_EQ(reference_element.size(1), space->mapper().local_size(element));
}
}
......@@ -143,7 +143,7 @@ struct RtSpace : public ::testing::Test
const auto global_DoF_indices = space->mapper().global_indices(element);
EXPECT_LE(space->mapper().local_size(element), global_DoF_indices.size());
const auto intersection_to_local_DoF_indices_map =
space->finite_elements().get(element.geometry().type(), p).coefficients().local_key_indices(1);
space->finite_elements().get(element.type(), p).coefficients().local_key_indices(1);
EXPECT_EQ(intersection_to_local_DoF_indices_map.size(), space->mapper().local_size(element));
for (auto&& intersection : intersections(*grid_view(), element)) {
const auto local_intersection_index = intersection.indexInInside();
......@@ -180,9 +180,9 @@ struct RtSpace : public ::testing::Test
ASSERT_NE(grid_view(), nullptr);
ASSERT_NE(space, nullptr);
for (auto&& element : elements(*grid_view())) {
const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.geometry().type());
const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.type());
const auto intersection_to_local_DoF_indices_map =
space->finite_elements().get(element.geometry().type(), p).coefficients().local_key_indices(1);
space->finite_elements().get(element.type(), p).coefficients().local_key_indices(1);
EXPECT_EQ(reference_element.size(1), intersection_to_local_DoF_indices_map.size());
for (const auto& DoF_indices_per_intersection : intersection_to_local_DoF_indices_map)
EXPECT_EQ(1, DoF_indices_per_intersection.size());
......@@ -197,7 +197,7 @@ struct RtSpace : public ::testing::Test
for (auto&& element : elements(*grid_view())) {
const auto basis = space->basis().localize(element);
const auto intersection_to_local_DoF_indices_map =
space->finite_elements().get(element.geometry().type(), p).coefficients().local_key_indices(1);
space->finite_elements().get(element.type(), p).coefficients().local_key_indices(1);
for (auto&& intersection : intersections(*grid_view(), element)) {
const auto xx_in_element_coordinates = intersection.geometry().center();
const auto xx_in_reference_element_coordinates = element.geometry().local(xx_in_element_coordinates);
......@@ -228,10 +228,10 @@ struct RtSpace : public ::testing::Test
ASSERT_NE(space, nullptr);
ASSERT_TRUE(false) << "continue here";
// for (auto&& element : elements(*grid_view())) {
// const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.geometry().type());
// const auto& reference_element = Dune::ReferenceElements<D, d>::general(element.type());
// const auto basis = space->base_function_set(element);
// const double h = 1e-6;
// for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.geometry().type(),
// for (const auto& quadrature_point : Dune::QuadratureRules<D, d>::rule(element.type(),
// basis->order())) {
// const auto& xx = quadrature_point.position();
// const auto& J_inv_T = element.geometry().jacobianInverseTransposed(xx);
......
......@@ -158,42 +158,41 @@ protected:
double eta_R_2 = 0.;
std::mutex eta_R_2_mutex;
auto walker = XT::Grid::make_walker(current_space.grid_view());
walker.append([]() {},
[&](const auto& element) {
auto local_df = this->diffusion().local_function();
local_df->bind(element);
auto local_force = this->force().local_function();
local_force->bind(element);
auto local_flux = flux_reconstruction.local_function();
local_flux->bind(element);
auto flux_divergence = XT::Functions::divergence(*local_flux);
flux_divergence.bind(element);
// approximate minimum eigenvalue of the diffusion over the element ...
double min_EV = std::numeric_limits<double>::max();
// ... which we do by evaluating at some quadrature points
for (auto&& quadrature_point :
QuadratureRules<double, d>::rule(element.geometry().type(), local_df->order() + 3)) {
auto diff = local_df->evaluate(quadrature_point.position());
auto eigen_solver = XT::LA::make_eigen_solver(
diff,
{{"type", XT::LA::EigenSolverOptions<decltype(diff)>::types().at(0)},
{"assert_positive_eigenvalues", "1e-15"}});
min_EV = std::min(min_EV, eigen_solver.min_eigenvalues(1).at(0));
}
DUNE_THROW_IF(!(min_EV > 0.),
Exceptions::integrand_error,
"The minimum eigenvalue of a positiv definite matrix must not be negative!"
<< "\n\nmin_EV = " << min_EV);
auto L2_norm_2 =
LocalElementIntegralBilinearForm<E>(LocalElementProductIntegrand<E>(),
/*over_integrate=*/3)
.apply2(*local_force - flux_divergence, *local_force - flux_divergence)[0][0];
const auto h = XT::Grid::diameter(element);
const auto C_P = 1. / (M_PIl * M_PIl); // Poincare constant (known for simplices/cubes)
std::lock_guard<std::mutex> lock(eta_R_2_mutex);
eta_R_2 += (C_P * h * h * L2_norm_2) / min_EV;
},
[]() {});
walker.append(
[]() {},
[&](const auto& element) {
auto local_df = this->diffusion().local_function();
local_df->bind(element);
auto local_force = this->force().local_function();
local_force->bind(element);
auto local_flux = flux_reconstruction.local_function();
local_flux->bind(element);
auto flux_divergence = XT::Functions::divergence(*local_flux);
flux_divergence.bind(element);
// approximate minimum eigenvalue of the diffusion over the element ...
double min_EV = std::numeric_limits<double>::max();
// ... which we do by evaluating at some quadrature points
for (auto&& quadrature_point : QuadratureRules<double, d>::rule(element.type(), local_df->order() + 3)) {