// Test HDF5. Copy-paste from
// https://support.hdfgroup.org/HDF5/Tutor/crtfile.html
+#include <deal.II/base/exceptions.h>
+
#include <hdf5.h>
#include <cstdio>
-
int
main()
{
/* Terminate access to the file. */
status = H5Fclose(file_id);
+ AssertThrow(status >= 0, dealii::ExcInternalError());
std::remove("file.h5");
}
FE_Q<2> fe;
DoFHandler<2> dof_handler;
- PETScWrappers::SparseMatrix A;
- PETScWrappers::MPI::Vector b, x;
- AffineConstraints<double> constraints;
+ PETScWrappers::SparseMatrix A;
+ PETScWrappers::MPI::Vector b, x;
+ AffineConstraints<PetscScalar> constraints;
TableHandler output_table;
};
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_A(dofs_per_cell, dofs_per_cell);
- Vector<double> cell_b(dofs_per_cell);
+ FullMatrix<PetscScalar> cell_A(dofs_per_cell, dofs_per_cell);
+ Vector<PetscScalar> cell_b(dofs_per_cell);
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
PETScWrappers::SparseMatrix A, B;
std::vector<PETScWrappers::MPI::Vector> x;
- std::vector<double> lambda;
- AffineConstraints<double> constraints;
+ std::vector<PetscScalar> lambda;
+ AffineConstraints<PetscScalar> constraints;
TableHandler output_table;
};
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_A(dofs_per_cell, dofs_per_cell);
- FullMatrix<double> cell_B(dofs_per_cell, dofs_per_cell);
+ FullMatrix<PetscScalar> cell_A(dofs_per_cell, dofs_per_cell);
+ FullMatrix<PetscScalar> cell_B(dofs_per_cell, dofs_per_cell);
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
// some output
- output_table.add_value("lambda", lambda[0]);
- output_table.add_value("error", std::fabs(2. - lambda[0]));
+ output_table.add_value("lambda", std::abs(lambda[0]));
+ output_table.add_value("error", std::fabs(2. - std::abs(lambda[0])));
}
void
solve();
// check energy convergence with previous result
- AssertThrow(lambda[0] < old_lambda,
+ AssertThrow(std::abs(lambda[0]) < old_lambda,
ExcMessage("solution is not converging"));
- old_lambda = lambda[0];
+ old_lambda = std::abs(lambda[0]);
}
// push back analytic result
typedef Vector<double> VectorType;
- time_stepper.residual = [&](const double t,
+ time_stepper.residual = [&](const double /*t*/,
const VectorType &y,
const VectorType &y_dot,
VectorType & res) -> int {
return 0;
};
- time_stepper.output_step = [&](const double t,
- const VectorType & sol,
- const VectorType & sol_dot,
- const unsigned int step_number) -> int {
+ time_stepper.output_step = [&](const double /*t*/,
+ const VectorType & /*sol*/,
+ const VectorType & /*sol_dot*/,
+ const unsigned int /*step_number*/) -> int {
// In this test, don't output anything.
return 0;
};
void
assemble(const std::vector<int>::iterator &it,
- scratch_data & scratch,
- copy_data & data)
+ scratch_data & /*scratch*/,
+ copy_data &data)
{
data.value = (*it);
}