From: Wolfgang Bangerth Date: Tue, 19 Jul 2022 21:04:02 +0000 (-0600) Subject: Fix the remaining compiler errors. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F110%2Fhead;p=code-gallery.git Fix the remaining compiler errors. I live under no illusion that everything will just work as expected, but being able to compile is a good first step :-) --- diff --git a/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc b/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc index 1e527e6..fce41fe 100644 --- a/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc +++ b/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include #include @@ -2006,9 +2005,7 @@ namespace NonLinearPoroViscoElasticity DoFRenumbering::component_wise(dof_handler_ref, block_component); // Count the number of DoFs in each block - dofs_per_block.clear(); - dofs_per_block.resize(n_blocks); - DoFTools::count_dofs_per_block(dof_handler_ref, dofs_per_block, block_component); + dofs_per_block = DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); // Setup the sparsity pattern and tangent matrix all_locally_owned_dofs = DoFTools::locally_owned_dofs_per_subdomain (dof_handler_ref); @@ -3763,7 +3760,7 @@ namespace NonLinearPoroViscoElasticity for (unsigned int d=0; d<(solution_p_vector.size()); ++d) solution_vector[solution_u_vector.size()+d] = solution_p_vector[d]; - Functions::FEFieldFunction,Vector> + Functions::FEFieldFunction> find_solution(dof_handler_ref, solution_vector); for (unsigned int p=0; ptriangulation); + GridTools::rotate( Point<3>::unit_vector(1), rot_angle, this->triangulation); this->triangulation.reset_manifold(0); static const CylindricalManifold manifold_description_3d(2); @@ -4032,7 +4029,7 @@ namespace NonLinearPoroViscoElasticity { VectorTools::interpolate_boundary_values(this->dof_handler_ref, 2, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); } @@ -4225,7 +4222,7 @@ namespace NonLinearPoroViscoElasticity { VectorTools::interpolate_boundary_values(this->dof_handler_ref, 101, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); } @@ -4401,13 +4398,13 @@ namespace NonLinearPoroViscoElasticity { VectorTools::interpolate_boundary_values(this->dof_handler_ref, 1, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); VectorTools::interpolate_boundary_values(this->dof_handler_ref, 2, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); } @@ -4606,7 +4603,7 @@ namespace NonLinearPoroViscoElasticity { VectorTools::interpolate_boundary_values(this->dof_handler_ref, 100, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); } @@ -4647,7 +4644,7 @@ namespace NonLinearPoroViscoElasticity VectorTools::interpolate_boundary_values( this->dof_handler_ref, 5, - ConstantFunction(value[2],this->n_components), + Functions::ConstantFunction(value[2],this->n_components), constraints, this->fe.component_mask(direction)); } @@ -4762,7 +4759,7 @@ namespace NonLinearPoroViscoElasticity { VectorTools::interpolate_boundary_values(this->dof_handler_ref, 100, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); } @@ -4792,7 +4789,7 @@ namespace NonLinearPoroViscoElasticity VectorTools::interpolate_boundary_values( this->dof_handler_ref, 5, - ConstantFunction(value[2],this->n_components), + Functions::ConstantFunction(value[2],this->n_components), constraints, this->fe.component_mask(direction) ); @@ -4912,7 +4909,7 @@ namespace NonLinearPoroViscoElasticity { VectorTools::interpolate_boundary_values(this->dof_handler_ref, 100, - ConstantFunction(this->parameters.drained_pressure,this->n_components), + Functions::ConstantFunction(this->parameters.drained_pressure,this->n_components), constraints, (this->fe.component_mask(this->pressure))); } @@ -4942,7 +4939,7 @@ namespace NonLinearPoroViscoElasticity VectorTools::interpolate_boundary_values( this->dof_handler_ref, 4, - ConstantFunction(value[0],this->n_components), + Functions::ConstantFunction(value[0],this->n_components), constraints, this->fe.component_mask(direction)); @@ -4968,7 +4965,7 @@ namespace NonLinearPoroViscoElasticity const double current_time = this->time.get_current(); const double final_time = this->time.get_end(); const double num_cycles = 3.0; - const Point< 3, double> axis (0.0,1.0,0.0); + const Tensor<1,3> axis ({0.0,1.0,0.0}); const double angle = numbers::PI; static const Tensor< 2, dim, double> R(Physics::Transformations::Rotations::rotation_matrix_3d(axis,angle)); diff --git a/time_dependent_navier_stokes/time_dependent_navier_stokes.cc b/time_dependent_navier_stokes/time_dependent_navier_stokes.cc index 848337a..d53f0ae 100644 --- a/time_dependent_navier_stokes/time_dependent_navier_stokes.cc +++ b/time_dependent_navier_stokes/time_dependent_navier_stokes.cc @@ -17,9 +17,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -645,9 +645,7 @@ namespace fluid std::vector block_component(dim + 1, 0); block_component[dim] = 1; DoFRenumbering::component_wise(dof_handler, block_component); - dofs_per_block.resize(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + dofs_per_block = DoFTools::count_dofs_per_fe_block(dof_handler, block_component); // Partitioning. unsigned int dof_u = dofs_per_block[0]; unsigned int dof_p = dofs_per_block[1]; @@ -720,7 +718,7 @@ namespace fluid sparsity_pattern.copy_from(dsp); SparsityTools::distribute_sparsity_pattern( dsp, - dof_handler.locally_owned_dofs_per_processor(), + dof_handler.locally_owned_dofs(), mpi_communicator, locally_relevant_dofs); @@ -1074,7 +1072,7 @@ namespace fluid FEValuesExtractors::Vector velocity(0); KellyErrorEstimator::estimate(dof_handler, face_quad_formula, - typename FunctionMap::type(), + {}, present_solution, estimated_error_per_cell, fe.component_mask(velocity)); diff --git a/two_phase_flow/LevelSetSolver.cc b/two_phase_flow/LevelSetSolver.cc index 6f36032..a732b0a 100644 --- a/two_phase_flow/LevelSetSolver.cc +++ b/two_phase_flow/LevelSetSolver.cc @@ -4,9 +4,9 @@ #include #include #include -#include #include -#include +#include +#include #include #include #include @@ -490,87 +490,57 @@ void LevelSetSolver::setup() DynamicSparsityPattern dsp (locally_relevant_dofs_LS); DoFTools::make_sparsity_pattern (dof_handler_LS,dsp,constraints,false); SparsityTools::distribute_sparsity_pattern (dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), + dof_handler_LS.locally_owned_dofs(), mpi_communicator, locally_relevant_dofs_LS); - MC_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - Cx_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - CTx_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - Cy_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - CTy_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); + MC_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + Cx_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + CTx_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + Cy_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + CTy_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); if (dim==3) { - Cz_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - CTz_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); + Cz_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + CTz_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); } - dLij_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - EntRes_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - SuppSize_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - dCij_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - A_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - LxA_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - Akp1_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - LxAkp1_matrix.reinit (mpi_communicator, - dsp, - dof_handler_LS.n_locally_owned_dofs_per_processor(), - dof_handler_LS.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); + dLij_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + EntRes_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + SuppSize_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + dCij_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + A_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + LxA_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + Akp1_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); + LxAkp1_matrix.reinit (dof_handler_LS.locally_owned_dofs(), + dof_handler_LS.locally_owned_dofs(), + dsp, mpi_communicator); //COMPUTE MASS MATRICES (AND OTHERS) FOR FIRST TIME STEP // assemble_ML(); invert_ML(); diff --git a/two_phase_flow/MultiPhase.cc b/two_phase_flow/MultiPhase.cc index 89e0aa9..771fd2b 100644 --- a/two_phase_flow/MultiPhase.cc +++ b/two_phase_flow/MultiPhase.cc @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/two_phase_flow/NavierStokesSolver.cc b/two_phase_flow/NavierStokesSolver.cc index 3f013b2..7422847 100644 --- a/two_phase_flow/NavierStokesSolver.cc +++ b/two_phase_flow/NavierStokesSolver.cc @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -551,39 +551,44 @@ void NavierStokesSolver::setup_VECTORS() DynamicSparsityPattern dsp_Matrix(locally_relevant_dofs_U); DoFTools::make_sparsity_pattern(dof_handler_U,dsp_Matrix,constraints,false); SparsityTools::distribute_sparsity_pattern(dsp_Matrix, - dof_handler_U.n_locally_owned_dofs_per_processor(),mpi_communicator, + dof_handler_U.locally_owned_dofs(), + mpi_communicator, locally_relevant_dofs_U); - system_Matrix_u.reinit(mpi_communicator,dsp_Matrix, - dof_handler_U.n_locally_owned_dofs_per_processor(), - dof_handler_U.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - system_Matrix_v.reinit(mpi_communicator,dsp_Matrix, - dof_handler_U.n_locally_owned_dofs_per_processor(), - dof_handler_U.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); - system_Matrix_w.reinit(mpi_communicator,dsp_Matrix, - dof_handler_U.n_locally_owned_dofs_per_processor(), - dof_handler_U.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); + system_Matrix_u.reinit(dof_handler_U.locally_owned_dofs(), + dof_handler_U.locally_owned_dofs(), + dsp_Matrix, + mpi_communicator); + system_Matrix_v.reinit(dof_handler_U.locally_owned_dofs(), + dof_handler_U.locally_owned_dofs(), + dsp_Matrix, + mpi_communicator); + system_Matrix_w.reinit(dof_handler_U.locally_owned_dofs(), + dof_handler_U.locally_owned_dofs(), + dsp_Matrix, + mpi_communicator); rebuild_Matrix_U=true; // sparsity pattern for S DynamicSparsityPattern dsp_S(locally_relevant_dofs_P); DoFTools::make_sparsity_pattern(dof_handler_P,dsp_S,constraints_psi,false); SparsityTools::distribute_sparsity_pattern(dsp_S, - dof_handler_P.n_locally_owned_dofs_per_processor(),mpi_communicator, + dof_handler_P.locally_owned_dofs(), + mpi_communicator, locally_relevant_dofs_P); - system_S.reinit(mpi_communicator,dsp_S,dof_handler_P.n_locally_owned_dofs_per_processor(), - dof_handler_P.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); + system_S.reinit(dof_handler_P.locally_owned_dofs(), + dof_handler_P.locally_owned_dofs(), + dsp_S, + mpi_communicator); // sparsity pattern for M DynamicSparsityPattern dsp_M(locally_relevant_dofs_P); DoFTools::make_sparsity_pattern(dof_handler_P,dsp_M,constraints_psi,false); SparsityTools::distribute_sparsity_pattern(dsp_M, - dof_handler_P.n_locally_owned_dofs_per_processor(),mpi_communicator, + dof_handler_P.locally_owned_dofs(), + mpi_communicator, locally_relevant_dofs_P); - system_M.reinit(mpi_communicator,dsp_M,dof_handler_P.n_locally_owned_dofs_per_processor(), - dof_handler_P.n_locally_owned_dofs_per_processor(), - Utilities::MPI::this_mpi_process(mpi_communicator)); + system_M.reinit(dof_handler_P.locally_owned_dofs(), + dof_handler_P.locally_owned_dofs(), + dsp_M, + mpi_communicator); rebuild_S_M=true; } diff --git a/two_phase_flow/TestLevelSet.cc b/two_phase_flow/TestLevelSet.cc index 3426be6..541a56f 100644 --- a/two_phase_flow/TestLevelSet.cc +++ b/two_phase_flow/TestLevelSet.cc @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/two_phase_flow/TestNavierStokes.cc b/two_phase_flow/TestNavierStokes.cc index 651da17..0e074ac 100644 --- a/two_phase_flow/TestNavierStokes.cc +++ b/two_phase_flow/TestNavierStokes.cc @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include