From: kanschat Date: Fri, 12 Mar 2010 20:46:18 +0000 (+0000) Subject: remove FEVALUESBASE template argument in IntegrationInfo X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0113f450aa1c8227da9cf9d94cbf0ceb4e7d737a;p=dealii-svn.git remove FEVALUESBASE template argument in IntegrationInfo git-svn-id: https://svn.dealii.org/trunk@20815 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/mesh_worker.h b/deal.II/deal.II/include/numerics/mesh_worker.h index 4dc8718f46..3602b4331f 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker.h +++ b/deal.II/deal.II/include/numerics/mesh_worker.h @@ -169,13 +169,13 @@ namespace MeshWorker * The info type expected by a * cell integrator. */ - typedef IntegrationInfo, dim> CellInfo; + typedef IntegrationInfo CellInfo; /** * The info type expected by a * face integrator. */ - typedef IntegrationInfo, dim> FaceInfo; + typedef IntegrationInfo FaceInfo; /** * Initialize default values. diff --git a/deal.II/deal.II/include/numerics/mesh_worker_info.h b/deal.II/deal.II/include/numerics/mesh_worker_info.h index f48fe4b9e1..767a5c4142 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_info.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_info.h @@ -474,15 +474,15 @@ namespace MeshWorker * @ingroup MeshWorker * @author Guido Kanschat, 2009 */ - template + template class IntegrationInfo { private: /// vector of FEValues objects - std::vector > fevalv; + std::vector > > fevalv; public: - static const unsigned int dimension = FEVALUESBASE::dimension; - static const unsigned int space_dimension = FEVALUESBASE::space_dimension; + static const unsigned int dimension = dim; + static const unsigned int space_dimension = spacedim; /** * Constructor. @@ -494,7 +494,7 @@ namespace MeshWorker * clone to be used by * WorksTream::run(). */ - IntegrationInfo(const IntegrationInfo& other); + IntegrationInfo(const IntegrationInfo& other); /** * Build all internal @@ -560,7 +560,7 @@ namespace MeshWorker * exception, if applied to a * vector of elements. */ - const FEVALUESBASE& fe_values () const; + const FEValuesBase& fe_values () const; /// Access to finite elements /** @@ -571,7 +571,7 @@ namespace MeshWorker * * @see DGBlockSplitApplication */ - const FEVALUESBASE& fe_values (const unsigned int i) const; + const FEValuesBase& fe_values (const unsigned int i) const; /** * The vector containing the @@ -686,10 +686,10 @@ namespace MeshWorker public: /// The type of the info object for cells - typedef IntegrationInfo, spacedim> CellInfo; + typedef IntegrationInfo CellInfo; /// The type of the info objects for faces. - typedef IntegrationInfo, spacedim> FaceInfo; + typedef IntegrationInfo FaceInfo; template void initialize(const WORKER&, @@ -1047,31 +1047,31 @@ namespace MeshWorker //----------------------------------------------------------------------// - template - inline const FVB& - IntegrationInfo::fe_values() const + template + inline const FEValuesBase& + IntegrationInfo::fe_values() const { AssertDimension(fevalv.size(), 1); return *fevalv[0]; } - template - inline const FVB& - IntegrationInfo::fe_values(unsigned int i) const + template + inline const FEValuesBase& + IntegrationInfo::fe_values(unsigned int i) const { Assert (i + template inline void - IntegrationInfo::reinit(const DoFInfo& info) + IntegrationInfo::reinit(const DoFInfo& info) { for (unsigned int i=0;i& febase = *fevalv[i]; if (info.sub_number != deal_II_numbers::invalid_unsigned_int) { // This is a subface diff --git a/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h b/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h index 55c3bff7e1..28c1afe4f9 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_info.templates.h @@ -72,8 +72,8 @@ namespace MeshWorker //----------------------------------------------------------------------// - template - IntegrationInfo::IntegrationInfo() + template + IntegrationInfo::IntegrationInfo() : fevalv(0), multigrid(false), @@ -81,8 +81,8 @@ namespace MeshWorker {} - template - IntegrationInfo::IntegrationInfo(const IntegrationInfo& other) + template + IntegrationInfo::IntegrationInfo(const IntegrationInfo& other) : multigrid(other.multigrid), values(other.values), @@ -94,20 +94,21 @@ namespace MeshWorker fevalv.resize(other.fevalv.size()); for (unsigned int i=0;i& p = *other.fevalv[i]; const FEValues* pc = dynamic_cast*>(&p); const FEFaceValues* pf = dynamic_cast*>(&p); const FESubfaceValues* ps = dynamic_cast*>(&p); if (pc != 0) - fevalv[i] = typename boost::shared_ptr ( - reinterpret_cast(new FEValues (pc->get_mapping(), pc->get_fe(), - pc->get_quadrature(), pc->get_update_flags()))); + fevalv[i] = typename boost::shared_ptr > ( + reinterpret_cast*>( + new FEValues (pc->get_mapping(), pc->get_fe(), + pc->get_quadrature(), pc->get_update_flags()))); else if (pf != 0) - fevalv[i] = typename boost::shared_ptr ( + fevalv[i] = typename boost::shared_ptr > ( new FEFaceValues (pf->get_mapping(), pf->get_fe(), pf->get_quadrature(), pf->get_update_flags())); else if (ps != 0) - fevalv[i] = typename boost::shared_ptr ( + fevalv[i] = typename boost::shared_ptr > ( new FESubfaceValues (ps->get_mapping(), ps->get_fe(), ps->get_quadrature(), ps->get_update_flags())); else Assert(false, ExcInternalError()); @@ -115,10 +116,10 @@ namespace MeshWorker } - template + template template void - IntegrationInfo::initialize( + IntegrationInfo::initialize( const FiniteElement& el, const Mapping& mapping, const Quadrature& quadrature, @@ -128,7 +129,7 @@ namespace MeshWorker if (block_info == 0 || block_info->local().size() == 0) { fevalv.resize(1); - fevalv[0] = boost::shared_ptr ( + fevalv[0] = boost::shared_ptr > ( new FEVALUES (mapping, el, quadrature, flags)); } else @@ -136,7 +137,7 @@ namespace MeshWorker fevalv.resize(el.n_base_elements()); for (unsigned int i=0;i ( + fevalv[i] = boost::shared_ptr > ( new FEVALUES (mapping, el.base_element(i), quadrature, flags)); } } @@ -144,9 +145,9 @@ namespace MeshWorker } - template + template void - IntegrationInfo::initialize_data( + IntegrationInfo::initialize_data( const boost::shared_ptr > data) { global_data = data; @@ -198,18 +199,18 @@ namespace MeshWorker } - template + template void - IntegrationInfo::clear() + IntegrationInfo::clear() { fevalv.resize(0); } - template + template void - IntegrationInfo::fill_local_data(const DoFInfo& info, bool split_fevalues) + IntegrationInfo::fill_local_data(const DoFInfo& info, bool split_fevalues) { if (split_fevalues) { diff --git a/deal.II/deal.II/include/numerics/mesh_worker_loop.h b/deal.II/deal.II/include/numerics/mesh_worker_loop.h index 0e63154685..a423fc2af6 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_loop.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_loop.h @@ -253,17 +253,17 @@ namespace MeshWorker } // Loop over all cells - WorkStream::run(begin, end, - std_cxx1x::bind(cell_action, _1, _3, _2, - cell_worker, boundary_worker, face_worker, cells_first, true), - std_cxx1x::bind(internal::assemble, _1, assembler), - info, dof_info); +// WorkStream::run(begin, end, +// std_cxx1x::bind(cell_action, _1, _3, _2, +// cell_worker, boundary_worker, face_worker, cells_first, true), +// std_cxx1x::bind(internal::assemble, _1, assembler), +// info, dof_info); -// for (ITERATOR cell = begin; cell != end; ++cell) -// { -// cell_action(cell, dof_info, info, cell_worker, boundary_worker, face_worker, cells_first); -// dof_info.assemble(assembler); -// } + for (ITERATOR cell = begin; cell != end; ++cell) + { + cell_action(cell, dof_info, info, cell_worker, boundary_worker, face_worker, cells_first, true); + dof_info.assemble(assembler); + } } /** diff --git a/deal.II/deal.II/source/numerics/mesh_worker_info.cc b/deal.II/deal.II/source/numerics/mesh_worker_info.cc index 9d418fd23b..663b29e61b 100644 --- a/deal.II/deal.II/source/numerics/mesh_worker_info.cc +++ b/deal.II/deal.II/source/numerics/mesh_worker_info.cc @@ -28,18 +28,17 @@ namespace MeshWorker { template class LocalResults; template class DoFInfo; + template class IntegrationInfo; -#include "mesh_worker_info.inst" - - template void IntegrationInfo > + template void IntegrationInfo ::initialize >( const FiniteElement&, const Mapping&, const Quadrature::integral_dimension>&, const UpdateFlags, const BlockInfo*); - template void IntegrationInfo > + template void IntegrationInfo ::initialize >( const FiniteElement&, const Mapping&, const Quadrature::integral_dimension>&, const UpdateFlags, const BlockInfo*); - template void IntegrationInfo > + template void IntegrationInfo ::initialize >( const FiniteElement&, const Mapping&, const Quadrature::integral_dimension>&, const UpdateFlags, const BlockInfo*); diff --git a/deal.II/deal.II/source/numerics/mesh_worker_info.inst.in b/deal.II/deal.II/source/numerics/mesh_worker_info.inst.in index 8e123d5444..d79ce7b9be 100644 --- a/deal.II/deal.II/source/numerics/mesh_worker_info.inst.in +++ b/deal.II/deal.II/source/numerics/mesh_worker_info.inst.in @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id: fe_field_function.inst.in 19046 2009-07-08 19:30:23Z bangerth $ // -// Copyright (C) 2009 by the deal.II authors +// Copyright (C) 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -13,7 +13,6 @@ for (FEV : FEVALUES_BASES) { - template class IntegrationInfo; } for (FEV : FEVALUES_BASES) diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index 8eff89bddf..e672ba2a29 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -463,7 +463,7 @@ void Step12::integrate_cell_term (DoFInfo& dinfo, CellInfo& info) template void Step12::integrate_boundary_term (DoFInfo& dinfo, FaceInfo& info) { - const FEFaceValuesBase& fe_v = info.fe_values(); + const FEValuesBase& fe_v = info.fe_values(); FullMatrix& local_matrix = dinfo.matrix(0).matrix; Vector& local_vector = dinfo.vector(0).block(0); @@ -514,12 +514,12 @@ void Step12::integrate_face_term (DoFInfo& dinfo1, DoFInfo& dinfo2, // etc., we use the // FEFaceValuesBase object of the // first argument. - const FEFaceValuesBase& fe_v = info1.fe_values(); + const FEValuesBase& fe_v = info1.fe_values(); // For additional shape functions, // we have to ask the neighbors // FEFaceValuesBase. - const FEFaceValuesBase& fe_v_neighbor = info2.fe_values(); + const FEValuesBase& fe_v_neighbor = info2.fe_values(); // Then we get references to the // four local matrices. The letters diff --git a/deal.II/examples/step-39/step-39.cc b/deal.II/examples/step-39/step-39.cc index c2edd88720..558e32645e 100644 --- a/deal.II/examples/step-39/step-39.cc +++ b/deal.II/examples/step-39/step-39.cc @@ -137,7 +137,7 @@ void MatrixIntegrator::bdry( MeshWorker::DoFInfo& dinfo, typename MeshWorker::IntegrationWorker::FaceInfo& info) { - const FEFaceValuesBase& fe = info.fe_values(); + const FEValuesBase& fe = info.fe_values(); FullMatrix& local_matrix = dinfo.matrix(0,false).matrix; const unsigned int deg = fe.get_fe().tensor_degree(); @@ -160,8 +160,8 @@ void MatrixIntegrator::face( typename MeshWorker::IntegrationWorker::FaceInfo& info1, typename MeshWorker::IntegrationWorker::FaceInfo& info2) { - const FEFaceValuesBase& fe1 = info1.fe_values(); - const FEFaceValuesBase& fe2 = info2.fe_values(); + const FEValuesBase& fe1 = info1.fe_values(); + const FEValuesBase& fe2 = info2.fe_values(); FullMatrix& matrix_v1u1 = dinfo1.matrix(0,false).matrix; FullMatrix& matrix_v1u2 = dinfo1.matrix(0,true).matrix; FullMatrix& matrix_v2u1 = dinfo2.matrix(0,true).matrix; @@ -224,7 +224,7 @@ void RHSIntegrator::cell(MeshWorker::DoFInfo&, typename MeshWorker::In template void RHSIntegrator::bdry(MeshWorker::DoFInfo& dinfo, typename MeshWorker::IntegrationWorker::FaceInfo& info) { - const FEFaceValuesBase& fe = info.fe_values(); + const FEValuesBase& fe = info.fe_values(); Vector& local_vector = dinfo.vector(0).block(0); std::vector boundary_values(fe.n_quadrature_points); @@ -279,7 +279,7 @@ void Estimator::cell(MeshWorker::DoFInfo& dinfo, typename MeshWorker:: template void Estimator::bdry(MeshWorker::DoFInfo& dinfo, typename MeshWorker::IntegrationWorker::FaceInfo& info) { - const FEFaceValuesBase& fe = info.fe_values(); + const FEValuesBase& fe = info.fe_values(); std::vector boundary_values(fe.n_quadrature_points); exact_solution.value_list(fe.get_quadrature_points(), boundary_values); @@ -301,7 +301,7 @@ void Estimator::face(MeshWorker::DoFInfo& dinfo1, typename MeshWorker::IntegrationWorker::FaceInfo& info1, typename MeshWorker::IntegrationWorker::FaceInfo& info2) { - const FEFaceValuesBase& fe = info1.fe_values(); + const FEValuesBase& fe = info1.fe_values(); const std::vector& uh1 = info1.values[0][0]; const std::vector& uh2 = info2.values[0][0]; const std::vector >& Duh1 = info1.gradients[0][0]; @@ -708,7 +708,8 @@ Step39::run(unsigned int n_steps) int main() { + deallog.log_execution_time(true); FE_DGQ<2> fe1(3); Step39<2> test1(fe1); - test1.run(13); + test1.run(20); }