From 3f9d30203cdd744339566685345543484d984b9a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 6 Aug 2010 00:01:51 +0000 Subject: [PATCH] Make an argument a reference. git-svn-id: https://svn.dealii.org/trunk@21612 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/numerics/mesh_worker_info.h | 56 +++++++++---------- .../numerics/mesh_worker_info.templates.h | 52 ++++++++--------- 2 files changed, 54 insertions(+), 54 deletions(-) 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 e14ec200ac..3979448325 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_info.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_info.h @@ -109,7 +109,7 @@ namespace MeshWorker */ template DoFInfo (const DH& dof_handler); - + /** * Set the current cell and * fill #indices. @@ -156,7 +156,7 @@ namespace MeshWorker * DoFInfoBox. */ DoFInfo (); - + /// Fill index vector with active indices void get_indices(const typename DoFHandler::cell_iterator& c); @@ -175,7 +175,7 @@ namespace MeshWorker * degrees of freedom per cell. */ BlockIndices aux_local_indices; - + friend class DoFInfoBox >; }; @@ -207,7 +207,7 @@ namespace MeshWorker * in the other constructor. */ DoFInfoBox(const DoFInfoBox&); - + /** * Reset all the availability flags. */ @@ -224,8 +224,8 @@ namespace MeshWorker */ template void assemble(ASSEMBLER& ass) const; - - + + /** * The data for the cell. */ @@ -254,7 +254,7 @@ namespace MeshWorker }; - + /** * Class for objects handed to local integration functions. @@ -315,19 +315,19 @@ namespace MeshWorker public: static const unsigned int dimension = dim; static const unsigned int space_dimension = spacedim; - + /** * Constructor. */ IntegrationInfo(); - + /** * Copy constructor, creating a * clone to be used by * WorksTream::run(). */ IntegrationInfo(const IntegrationInfo& other); - + /** * Build all internal * structures, in particular @@ -373,7 +373,7 @@ namespace MeshWorker * vector and cache the * selector. */ - void initialize_data(const boost::shared_ptr > data); + void initialize_data(const boost::shared_ptr > &data); /** * Delete the data created by initialize(). @@ -458,7 +458,7 @@ namespace MeshWorker * structures for use on a cell. */ void reinit(const DoFInfo& i); - + /** * Use the finite element * functions in #global_data @@ -505,7 +505,7 @@ namespace MeshWorker * *
    *
  1. It provides the interface needed by MeshWorker::loop(), namely - * the two functions post_cell() and post_faces(), as well as + * the two functions post_cell() and post_faces(), as well as * the data members #cell, #boundary, #face, * #subface, and #neighbor. * @@ -650,7 +650,7 @@ namespace MeshWorker */ Quadrature face_quadrature; /* @} */ - + /** * @name Data vectors */ @@ -699,7 +699,7 @@ namespace MeshWorker * interior faces. */ MeshWorker::VectorSelector face_selector; - + boost::shared_ptr > cell_data; boost::shared_ptr > boundary_data; boost::shared_ptr > face_data; @@ -743,7 +743,7 @@ namespace MeshWorker */ template void post_cell(const DoFInfoBox&); - + /** * A callback function which is * called in the loop over all @@ -776,7 +776,7 @@ namespace MeshWorker */ template void post_faces(const DoFInfoBox&); - + /// The info object for a cell CellInfo cell; /// The info object for a boundary face @@ -873,7 +873,7 @@ namespace MeshWorker } //----------------------------------------------------------------------// - + template inline DoFInfoBox::DoFInfoBox(const DOFINFO& seed) @@ -917,7 +917,7 @@ namespace MeshWorker } } - + template template inline void @@ -939,7 +939,7 @@ namespace MeshWorker } } } - + //----------------------------------------------------------------------// @@ -955,7 +955,7 @@ namespace MeshWorker { if (block_info == 0 || block_info->local().size() == 0) { - fevalv.resize(1); + fevalv.resize(1); fevalv[0] = boost::shared_ptr > ( new FEVALUES (mapping, el, quadrature, flags)); } @@ -970,7 +970,7 @@ namespace MeshWorker } n_components = el.n_components(); } - + template inline const FEValuesBase& @@ -1007,7 +1007,7 @@ namespace MeshWorker { // This is a face FEFaceValues& fe = dynamic_cast&> (febase); - fe.reinit(info.cell, info.face_number); + fe.reinit(info.cell, info.face_number); } else { @@ -1041,7 +1041,7 @@ namespace MeshWorker p->initialize(data); cell_data = p; cell.initialize_data(p); - + p = boost::shared_ptr >(new VectorData (boundary_selector)); p->initialize(data); boundary_data = p; @@ -1085,15 +1085,15 @@ namespace MeshWorker subface.initialize_data(p); neighbor.initialize_data(p); } - - + + template template void IntegrationInfoBox::post_cell(const DoFInfoBox&) {} - - + + template template void 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 3b262de88d..40f12d38b3 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 @@ -38,7 +38,7 @@ namespace MeshWorker if (!c->has_children()) { indices.resize(c->get_fe().dofs_per_cell); - + if (block_info == 0 || block_info->local().size() == 0) c->get_dof_indices(indices); else @@ -61,7 +61,7 @@ namespace MeshWorker DoFInfo::get_indices(const typename MGDoFHandler::cell_iterator& c) { indices.resize(c->get_fe().dofs_per_cell); - + if (block_info == 0 || block_info->local().size() == 0) c->get_mg_dof_indices(indices); else @@ -84,7 +84,7 @@ namespace MeshWorker global_data(boost::shared_ptr >(new VectorDataBase)) {} - + template IntegrationInfo::IntegrationInfo(const IntegrationInfo& other) : @@ -102,7 +102,7 @@ namespace MeshWorker const FEValues* pc = dynamic_cast*>(&p); const FEFaceValues* pf = dynamic_cast*>(&p); const FESubfaceValues* ps = dynamic_cast*>(&p); - + if (pc != 0) fevalv[i] = boost::shared_ptr > ( reinterpret_cast*>( @@ -118,16 +118,16 @@ namespace MeshWorker Assert(false, ExcInternalError()); } } - + template void IntegrationInfo::initialize_data( - const boost::shared_ptr > data) + const boost::shared_ptr > &data) { global_data = data; const unsigned int nqp = fevalv[0]->n_quadrature_points; - + values.resize(global_data->n_values()); // deallog << "values: " << values.size() << " ["; // For all selected finite @@ -145,7 +145,7 @@ namespace MeshWorker // deallog << " }"; } // deallog << " ]" << std::endl; - + gradients.resize(global_data->n_gradients()); // For all selected finite // element functions @@ -158,7 +158,7 @@ namespace MeshWorker gradients[i][j].resize(nqp); } } - + hessians.resize(global_data->n_hessians()); // For all selected finite // element functions @@ -199,7 +199,7 @@ namespace MeshWorker const unsigned int n_comp = fe.get_fe().n_components(); const unsigned int block_start = info.block_info->local().block_start(b); const unsigned int block_size = info.block_info->local().block_size(b); - + if(info.level_cell) this->global_data->mg_fill(values, gradients, hessians, fe, info.cell->level(), info.indices, comp, n_comp, block_start, block_size); @@ -221,11 +221,11 @@ namespace MeshWorker 0, n_comp, 0, info.indices.size()); } } - - + + //----------------------------------------------------------------------// - - + + template void IntegrationInfoBox::initialize_update_flags () @@ -234,25 +234,25 @@ namespace MeshWorker boundary_flags = UpdateFlags(update_JxW_values | update_normal_vectors); face_flags = boundary_flags; neighbor_flags = update_default; - + if (cell_selector.has_values() != 0) cell_flags |= update_values; if (cell_selector.has_gradients() != 0) cell_flags |= update_gradients; if (cell_selector.has_hessians() != 0) cell_flags |= update_hessians; - + if (boundary_selector.has_values() != 0) boundary_flags |= update_values; if (boundary_selector.has_gradients() != 0) boundary_flags |= update_gradients; if (boundary_selector.has_hessians() != 0) boundary_flags |= update_hessians; - + if (face_selector.has_values() != 0) face_flags |= update_values; if (face_selector.has_gradients() != 0) face_flags |= update_gradients; if (face_selector.has_hessians() != 0) face_flags |= update_hessians; - + if (face_selector.has_values() != 0) neighbor_flags |= update_values; if (face_selector.has_gradients() != 0) neighbor_flags |= update_gradients; - if (face_selector.has_hessians() != 0) neighbor_flags |= update_hessians; + if (face_selector.has_hessians() != 0) neighbor_flags |= update_hessians; } - - + + template void IntegrationInfoBox::add_update_flags( @@ -265,10 +265,10 @@ namespace MeshWorker if (cell) cell_flags |= flags; if (boundary) boundary_flags |= flags; if (face) face_flags |= flags; - if (neighbor) neighbor_flags |= flags; + if (neighbor) neighbor_flags |= flags; } - - + + template void IntegrationInfoBox::initialize_gauss_quadrature( @@ -281,8 +281,8 @@ namespace MeshWorker face_quadrature = QGauss(fp); } - - + + template void IntegrationInfoBox:: -- 2.39.5