-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation errors due to fixed typs in deal.II #252
Comments
A minimal test: #include <deal.II/matrix_free/fe_point_evaluation.h>
using namespace dealii;
template <int n_components, int dim, int spacedim, typename Number>
void
test()
{
std::unique_ptr<Mapping<dim, spacedim>> mapping;
std::unique_ptr<FiniteElement<dim, spacedim>> fe;
FEPointEvaluation<n_components, dim, spacedim, Number> fpe(
*mapping, *fe, UpdateFlags::update_default);
Triangulation<dim, spacedim> tria;
fpe.reinit(tria.begin(), ArrayView<const Point<dim>>());
fpe.evaluate(ArrayView<const Number>(), EvaluationFlags::values);
fpe.integrate(ArrayView<Number>(), EvaluationFlags::values);
}
int
main()
{
test<1, 1, 1, double>();
test<2, 1, 1, double>();
test<1, 2, 2, double>();
test<2, 2, 2, double>();
test<3, 2, 2, double>();
test<1, 3, 3, double>();
test<2, 3, 3, double>();
test<3, 3, 3, double>();
test<4, 3, 3, double>();
test<1, 1, 1, float>();
test<2, 1, 1, float>();
test<1, 2, 2, float>();
//test<2, 2, 2, float>(); // not working
test<3, 2, 2, float>();
test<1, 3, 3, float>();
test<2, 3, 3, float>();
//test<3, 3, 3, float>(); // not working
test<4, 3, 3, float>();
} |
This should fix it: diff --git a/include/deal.II/base/derivative_form.h b/include/deal.II/base/derivative_form.h
index 10d6545..ba4985b 100644
--- a/include/deal.II/base/derivative_form.h
+++ b/include/deal.II/base/derivative_form.h
@@ -108,12 +108,14 @@ public:
* Number>. In particular, if order == 1 and the derivative is the Jacobian of
* $\mathbf F(\mathbf x)$, then Tensor[i] = $\nabla F_i(\mathbf x)$.
*/
- operator Tensor<order + 1, dim, Number>() const;
+ template<typename Number2>
+ operator Tensor<order + 1, dim, Number2>() const;
/**
* Converts a DerivativeForm<1, dim, 1, Number> to Tensor<1, dim, Number>.
*/
- operator Tensor<1, dim, Number>() const;
+ template<typename Number2>
+ operator Tensor<1, dim, Number2>() const;
/**
* Return the transpose of a rectangular DerivativeForm,
@@ -273,8 +275,9 @@ DerivativeForm<order, dim, spacedim, Number>::operator[](
template <int order, int dim, int spacedim, typename Number>
+template<typename Number2>
inline DerivativeForm<order, dim, spacedim, Number>::
-operator Tensor<1, dim, Number>() const
+operator Tensor<1, dim, Number2>() const
{
Assert((1 == spacedim) && (order == 1),
ExcMessage("Only allowed for spacedim==1."));
@@ -285,8 +288,9 @@ operator Tensor<1, dim, Number>() const
template <int order, int dim, int spacedim, typename Number>
+template<typename Number2>
inline DerivativeForm<order, dim, spacedim, Number>::
-operator Tensor<order + 1, dim, Number>() const
+operator Tensor<order + 1, dim, Number2>() const
{
Assert((dim == spacedim), ExcMessage("Only allowed when dim==spacedim.")); I'll open a PR in deal.II later today. |
Thank you :) |
Merging this: #257 (comment), the pipeline is successful, and the Issue can be closed. |
should be resolved by dealii/dealii#14159 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Explicitly using
double
for interface coupling results in compilation errors after the fixture of types in deal.II dealii/dealii#14142.The decision to use
double
instead ofNumber
is related due to the design choice to keepNumber
out ofBoundaryDescriptor
s.I might find some time to work on this towards the end of the week.
The text was updated successfully, but these errors were encountered: