void solve();
void write_high_order_mesh(const unsigned cycle);
- Triangulation<dim> triangulation;
- const FE_Q<dim> fe;
- DoFHandler<dim> dof_handler;
- MappingQ<dim> mapping;
+ Triangulation<dim> triangulation;
+ const FE_Q<dim> fe;
+ DoFHandler<dim> dof_handler;
+ const MappingQ<dim> mapping;
SparsityPattern sparsity_pattern;
SparseMatrix<double> system_matrix;
template <int dim>
void LaplaceProblem<dim>::assemble_system()
{
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
auto cell_worker =
[&](const typename DoFHandler<dim>::active_cell_iterator &cell,
template <int dim>
void LaplaceProblem<dim>::assemble_multigrid()
{
- MappingQ1<dim> mapping;
- const unsigned int n_levels = triangulation.n_levels();
+ const MappingQ1<dim> mapping;
+ const unsigned int n_levels = triangulation.n_levels();
std::vector<AffineConstraints<double>> boundary_constraints(n_levels);
for (unsigned int level = 0; level < n_levels; ++level)
// finite element space. The order of the finite element space and of the
// mapping can be selected in the constructor of the class.
- Triangulation<dim - 1, dim> tria;
- const FE_Q<dim - 1, dim> fe;
- DoFHandler<dim - 1, dim> dof_handler;
- MappingQ<dim - 1, dim> mapping;
+ Triangulation<dim - 1, dim> tria;
+ const FE_Q<dim - 1, dim> fe;
+ DoFHandler<dim - 1, dim> dof_handler;
+ const MappingQ<dim - 1, dim> mapping;
// In BEM methods, the matrix that is generated is dense. Depending on the
// size of the problem, the final system might be solved by direct LU
const FE_Q<dim> fe;
DoFHandler<dim> dof_handler;
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
AffineConstraints<double> constraints;
using SystemMatrixType =
void compute_error() const;
- Triangulation<dim, spacedim> triangulation;
- const FE_Q<dim, spacedim> fe;
- DoFHandler<dim, spacedim> dof_handler;
- MappingQ<dim, spacedim> mapping;
+ Triangulation<dim, spacedim> triangulation;
+ const FE_Q<dim, spacedim> fe;
+ DoFHandler<dim, spacedim> dof_handler;
+ const MappingQ<dim, spacedim> mapping;
SparsityPattern sparsity_pattern;
SparseMatrix<double> system_matrix;
Vector<double> soln(solution_n.size());
for (unsigned int i = 0; i < soln.size(); ++i)
soln(i) = solution_n(i);
- MappingQEulerian<dim> q_mapping(degree, dof_handler, soln);
+ const MappingQEulerian<dim> q_mapping(degree, dof_handler, soln);
data_out.build_patches(q_mapping, degree);
std::ofstream output("solution-" + std::to_string(dim) + "d-" +
ConditionalOStream pcout;
- MappingQ<dim> mapping;
+ const MappingQ<dim> mapping;
};
Triangulation<dim> triangulation;
- MappingQ<dim> mapping;
+ const MappingQ<dim> mapping;
const FE_Q<dim> fe;
DoFHandler<dim> dof_handler;
const FE_Q<dim> fe;
DoFHandler<dim> dof_handler;
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
AffineConstraints<double> constraints;
IndexSet locally_relevant_dofs;
const FE_DGQHermite<dim> fe;
DoFHandler<dim> dof_handler;
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
using SystemMatrixType = LaplaceOperator<dim, fe_degree, double>;
SystemMatrixType system_matrix;
std::ofstream output("grid-" + std::to_string(cycle) + ".gnuplot");
GridOutFlags::Gnuplot gnuplot_flags(false, 5);
grid_out.set_flags(gnuplot_flags);
- MappingQ<dim> mapping(3);
+ const MappingQ<dim> mapping(3);
grid_out.write_gnuplot(triangulation, output, &mapping);
}
const DoFHandler<dim> &dof_handler,
const AffineConstraints<double> &constraints)
{
- MappingQ<dim> mapping(fe_degree);
+ const MappingQ<dim> mapping(fe_degree);
typename Portable::MatrixFree<dim, double>::AdditionalData additional_data;
additional_data.mapping_update_flags = update_values | update_gradients |
update_JxW_values |
<< std::endl
<< std::endl;
- MappingQ<dim> mapping(fe.degree + 1);
+ const MappingQ<dim> mapping(fe.degree + 1);
setup_system(mapping);
assemble_system(mapping);
solve();
#endif
const FESystem<dim> fe;
- MappingQ<dim> mapping;
+ const MappingQ<dim> mapping;
DoFHandler<dim> dof_handler;
TimerOutput timer;
DoFHandler<dim> fluid_dh;
const FESystem<dim> fluid_fe;
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
LinearAlgebra::distributed::Vector<double> velocity_field;
Functions::RayleighKotheVortex<dim> velocity;
#endif
const FESystem<dim> fe;
- MappingQ<dim> mapping;
+ const MappingQ<dim> mapping;
DoFHandler<dim> dof_handler;
TimerOutput timer;
system_rhs = 0;
- MappingQ<dim> mapping(1);
+ const MappingQ<dim> mapping(1);
const QGauss<dim> quadrature_formula(fe.degree + 1);
const QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(mapping,
BlockVector<double> test_rhs;
test_rhs.reinit(system_rhs);
- MappingQ<dim> mapping(1);
+ const MappingQ<dim> mapping(1);
const QGauss<dim> quadrature_formula(fe.degree + 1);
const QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(mapping,
// Start with computing the objective function:
double objective_function_merit = 0;
{
- MappingQ<dim> mapping(1);
+ const MappingQ<dim> mapping(1);
const QGauss<dim> quadrature_formula(fe.degree + 1);
const QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(mapping,
constexpr unsigned int dim = 2;
constexpr unsigned int fe_degree = 3;
- MappingQ1<dim> mapping;
- Triangulation<dim> tria;
+ const MappingQ1<dim> mapping;
+ Triangulation<dim> tria;
GridGenerator::subdivided_hyper_cube(tria, 7);
const FE_Q<dim> fe(fe_degree);
pcout << "Running: example 1" << std::endl;
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
DistributedTriangulation<dim> tria(MPI_COMM_WORLD);
GridGenerator::subdivided_hyper_cube(tria, 7);
pcout << " - create system" << std::endl;
const FE_Q<dim> fe(fe_degree);
- MappingQ1<dim> mapping;
+ const MappingQ1<dim> mapping;
DistributedTriangulation<dim> tria(MPI_COMM_WORLD);
GridGenerator::subdivided_hyper_cube(tria, 50);
GridGenerator::hyper_cube(tria_background);
tria_background.refine_global(5);
- MappingQ1<dim> mapping_background;
- const FESystem<dim> fe_background(FE_Q<dim>(degree), dim);
- DoFHandler<dim> dof_handler_background(tria_background);
+ const MappingQ1<dim> mapping_background;
+ const FESystem<dim> fe_background(FE_Q<dim>(degree), dim);
+ DoFHandler<dim> dof_handler_background(tria_background);
dof_handler_background.distribute_dofs(fe_background);
// and, similarly, for the immersed surface mesh.
// that is updated in every time step according to the nodal
// displacements. Two types of finite elements are used to
// represent scalar and vector-valued DoF values.
- MappingQ<dim - 1, dim> mapping_immersed_base(3);
- MappingQCache<dim - 1, dim> mapping_immersed(3);
+ const MappingQ<dim - 1, dim> mapping_immersed_base(3);
+ MappingQCache<dim - 1, dim> mapping_immersed(3);
mapping_immersed.initialize(mapping_immersed_base, tria_immersed);
const QGauss<dim - 1> quadrature_immersed(degree + 1);