3 #include "../../include/matrixFreePDE.h" 4 #include <deal.II/grid/grid_generator.h> 6 template <
int dim,
int degree>
10 std::vector<unsigned int> subdivisions;
11 subdivisions.push_back(10);
13 subdivisions.push_back(10);
15 subdivisions.push_back(10);
20 GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions, Point<dim>(), Point<dim>(1,1,1));
23 GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions, Point<dim>(), Point<dim>(1,1));
26 GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions, Point<dim>(), Point<dim>(1));
32 fe=
new FESystem<dim>(FE_Q<dim>(QGaussLobatto<1>(degree+1)),1);
36 DoFHandler<dim>* dof_handler;
37 dof_handler=
new DoFHandler<dim>(triangulation);
38 dofHandlersSet.push_back(dof_handler);
39 dofHandlersSet_nonconst.push_back(dof_handler);
40 dof_handler->distribute_dofs (*fe);
43 IndexSet* locally_relevant_dofs;
44 locally_relevant_dofs=
new IndexSet;
45 locally_relevant_dofsSet.push_back(locally_relevant_dofs);
46 locally_relevant_dofsSet_nonconst.push_back(locally_relevant_dofs);
47 locally_relevant_dofs->clear();
48 DoFTools::extract_locally_relevant_dofs (*dof_handler, *locally_relevant_dofs);
51 ConstraintMatrix *constraintsOther;
52 constraintsOther=
new ConstraintMatrix; constraintsOtherSet.push_back(constraintsOther);
53 constraintsOtherSet_nonconst.push_back(constraintsOther);
54 constraintsOther->clear(); constraintsOther->reinit(*locally_relevant_dofs);
55 DoFTools::make_hanging_node_constraints (*dof_handler, *constraintsOther);
59 typename MatrixFree<dim,double>::AdditionalData additional_data;
61 #if (DEAL_II_VERSION_MAJOR < 9 && DEAL_II_VERSION_MINOR < 5) 62 additional_data.mpi_communicator = MPI_COMM_WORLD;
64 additional_data.tasks_parallel_scheme = MatrixFree<dim,double>::AdditionalData::partition_partition;
65 additional_data.mapping_update_flags = (update_values | update_gradients | update_JxW_values | update_quadrature_points);
66 QGaussLobatto<1> quadrature (degree+1);
67 matrixFreeObject.clear();
68 matrixFreeObject.reinit (dofHandlersSet, constraintsOtherSet, quadrature, additional_data);
73 solutionSet.push_back(U); residualSet.push_back(R);
74 matrixFreeObject.initialize_dof_vector(*R, 0); *R=0;
75 matrixFreeObject.initialize_dof_vector(*U, 0); *U=0;
80 #include "../../include/matrixFreePDE_template_instantiations.h" dealii::parallel::distributed::Vector< double > vectorType