From: Martin Kronbichler Date: Thu, 16 Feb 2017 13:11:21 +0000 (+0100) Subject: Simplify project function in VectorTools, non-templated FEEvaluation X-Git-Tag: v8.5.0-rc1~106^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9036b66d480336b394103418996d991e327f1fcb;p=dealii.git Simplify project function in VectorTools, non-templated FEEvaluation --- diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index eb3305f2c7..930a1a9bbc 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -920,7 +920,8 @@ namespace VectorTools Assert (dof.get_fe().n_components() == function.n_components, ExcDimensionMismatch(dof.get_fe().n_components(), function.n_components)); - Assert (dof.get_fe().degree == fe_degree, + Assert (fe_degree == -1 || + dof.get_fe().degree == static_cast(fe_degree), ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); Assert (dof.get_fe().n_components() == components, ExcDimensionMismatch(components, dof.get_fe().n_components())); @@ -933,7 +934,7 @@ namespace VectorTools std_cxx11::shared_ptr > matrix_free( new MatrixFree ()); matrix_free->reinit (mapping, dof, constraints, - QGauss<1>(fe_degree+2), additional_data); + QGauss<1>(dof.get_fe().degree+2), additional_data); typedef MatrixFreeOperators::MassOperator MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); @@ -1004,38 +1005,10 @@ namespace VectorTools enforce_zero_boundary, q_boundary, project_to_boundary_first); break; - case 4: - project_matrix_free - (mapping, dof, constraints, quadrature, function, work_result, - enforce_zero_boundary, q_boundary, project_to_boundary_first); - break; - - case 5: - project_matrix_free - (mapping, dof, constraints, quadrature, function, work_result, - enforce_zero_boundary, q_boundary, project_to_boundary_first); - break; - - case 6: - project_matrix_free - (mapping, dof, constraints, quadrature, function, work_result, - enforce_zero_boundary, q_boundary, project_to_boundary_first); - break; - - case 7: - project_matrix_free - (mapping, dof, constraints, quadrature, function, work_result, - enforce_zero_boundary, q_boundary, project_to_boundary_first); - break; - - case 8: - project_matrix_free + default: + project_matrix_free (mapping, dof, constraints, quadrature, function, work_result, enforce_zero_boundary, q_boundary, project_to_boundary_first); - break; - - default: - Assert(false, ExcInternalError()); } } @@ -1145,9 +1118,9 @@ namespace VectorTools // enforce_zero_boundary and project_to_boundary_first // are not yet supported. // We have explicit instantiations only if - // the number of components and the degree is not too high. + // the number of components is not too high. if (enforce_zero_boundary || project_to_boundary_first - || dof.get_fe().degree>8 || dof.get_fe().n_components()>4) + || dof.get_fe().n_components()>4) use_matrix_free = false; if (use_matrix_free) @@ -1182,7 +1155,8 @@ namespace VectorTools 1)); Assert (vec_result.size() == dof.n_dofs(), ExcDimensionMismatch (vec_result.size(), dof.n_dofs())); - Assert (dof.get_fe().degree == fe_degree, + Assert (fe_degree == -1 || + dof.get_fe().degree == static_cast(fe_degree), ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); // set up mass matrix and right hand side @@ -1193,7 +1167,7 @@ namespace VectorTools std_cxx11::shared_ptr > matrix_free( new MatrixFree()); matrix_free->reinit (mapping, dof, constraints, - QGauss<1>(fe_degree+2), additional_data); + QGauss<1>(dof.get_fe().degree+2), additional_data); typedef MatrixFreeOperators::MassOperator MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); @@ -1281,7 +1255,8 @@ namespace VectorTools 1)); Assert (vec_result.size() == dof.n_dofs(), ExcDimensionMismatch (vec_result.size(), dof.n_dofs())); - Assert (dof.get_fe().degree == fe_degree, + Assert (fe_degree == -1 || + dof.get_fe().degree == static_cast(fe_degree), ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); typedef MatrixFreeOperators::MassOperator MatrixType; @@ -1361,23 +1336,8 @@ namespace VectorTools case 3: project_parallel (mapping,dof,constraints,quadrature,func,vec_result); break; - case 4: - project_parallel (mapping,dof,constraints,quadrature,func,vec_result); - break; - case 5: - project_parallel (mapping,dof,constraints,quadrature,func,vec_result); - break; - case 6: - project_parallel (mapping,dof,constraints,quadrature,func,vec_result); - break; - case 7: - project_parallel (mapping,dof,constraints,quadrature,func,vec_result); - break; - case 8: - project_parallel (mapping,dof,constraints,quadrature,func,vec_result); - break; default: - Assert (false, ExcNotImplemented()); + project_parallel (mapping,dof,constraints,quadrature,func,vec_result); } } @@ -1407,23 +1367,8 @@ namespace VectorTools case 3: project_parallel (matrix_free,constraints,func,vec_result); break; - case 4: - project_parallel (matrix_free,constraints,func,vec_result); - break; - case 5: - project_parallel (matrix_free,constraints,func,vec_result); - break; - case 6: - project_parallel (matrix_free,constraints,func,vec_result); - break; - case 7: - project_parallel (matrix_free,constraints,func,vec_result); - break; - case 8: - project_parallel (matrix_free,constraints,func,vec_result); - break; default: - Assert (false, ExcNotImplemented()); + project_parallel (matrix_free,constraints,func,vec_result); } }