From 6ca5ff816f9165403e8621aea0f4626a2bc5caa8 Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 19 Dec 2000 16:24:22 +0000 Subject: [PATCH] Take over the relevant changes from the main branch. git-svn-id: https://svn.dealii.org/branches/Branch-3-1@3581 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/Makefile | 8 +- deal.II/deal.II/include/grid/geometry_info.h | 2 +- deal.II/deal.II/source/dofs/dof_tools.cc | 115 ++++++++++++------- deal.II/deal.II/source/grid/tria.cc | 67 +++++------ 4 files changed, 105 insertions(+), 87 deletions(-) diff --git a/deal.II/base/Makefile b/deal.II/base/Makefile index 4c6c766795..a6d1912e9f 100644 --- a/deal.II/base/Makefile +++ b/deal.II/base/Makefile @@ -76,20 +76,20 @@ endif lib/libbase.a: $(forward-declarations) $(o-files) - @echo =====base=============debug=====$(MT)== Linking library: $@ + @echo =====base=============debug======$(MT)== Linking library: $@ @ar ruv $@ $(o-files) lib/libbase.g.a: $(forward-declarations) $(go-files) - @echo =====base=============optimized=$(MT)== Linking library: $@ + @echo =====base=============optimized==$(MT)== Linking library: $@ @ar ruv $@ $(go-files) lib/libbase.so: $(forward-declarations) $(o-files) - @echo =====base=============optimized=$(MT)== Linking library: $@ + @echo =====base=============optimized==$(MT)== Linking library: $@ @$(CC) $(CXXFLAGS.o) -shared -o $@ $(o-files) lib/libbase.g.so: $(forward-declarations) $(go-files) - @echo =====base=============debug=====$(MT)== Linking library: $@ + @echo =====base=============debug======$(MT)== Linking library: $@ @$(CC) $(CXXFLAGS.g) -shared -o $@ $(go-files) diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index 5e29548f95..008ccb3e38 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -24,7 +24,7 @@ * This class contains as static members information on vertices and * faces of a @p{dim}-dimensional grid cell. The interface is the same * for all dimensions. If a value is of no use in a low dimensional - * cell, it is (correctly) set to zero, e.g. @p{sub_faces_per_cell} in + * cell, it is (correctly) set to zero, e.g. @p{subfaces_per_cell} in * 1d. * * This information should always replace hard-coded numbers of diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 1a9d46969b..6e9f8de5ca 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1050,8 +1050,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa n_fine_dofs = fine_grid.n_dofs(); // local numbers of dofs - const unsigned int coarse_dofs_per_cell = coarse_fe.dofs_per_cell, - fine_dofs_per_cell = fine_fe.dofs_per_cell; + const unsigned int fine_dofs_per_cell = fine_fe.dofs_per_cell; // alias the number of dofs per // cell belonging to the @@ -1152,7 +1151,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa // to true if this is an // interesting dof. finally count // how many true's there - vector dof_is_interesting (fine_grid.n_dofs(), false); + vector dof_is_interesting (fine_grid.n_dofs(), false); vector local_dof_indices (fine_fe.dofs_per_cell); for (DoFHandler::active_cell_iterator cell=fine_grid.begin_active(); @@ -1165,10 +1164,23 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa }; n_parameters_on_fine_grid = count (dof_is_interesting.begin(), - dof_is_interesting.end(), - true); + dof_is_interesting.end(), + true); }; + // get an array in which we store + // which dof on the coarse grid is + // a parameter and which is not + vector coarse_dof_is_parameter (coarse_grid.n_dofs()); + if (true) + { + vector mask (coarse_grid.get_fe().n_components(), + false); + mask[coarse_component] = true; + extract_dofs (coarse_grid, mask, coarse_dof_is_parameter); + }; + + // store the weights with which a dof // on the parameter grid contributes @@ -1203,13 +1215,6 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa // set up this mapping if (true) { - // list of local dof numbers - // belonging to the parameter - // part of the FE on the fine grid - vector parameter_dofs; - for (unsigned int i=0; i local_dof_indices(fine_fe.dofs_per_cell); unsigned int next_free_index=0; for (typename DoFHandler::active_cell_iterator cell=fine_grid.begin_active(); @@ -1232,7 +1237,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa Assert (next_free_index == n_parameters_on_fine_grid, ExcInternalError()); }; - + // for each cell on the parameter grid: // find out which degrees of freedom on the @@ -1250,7 +1255,6 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa coarse_to_fine_grid_map, parameter_dofs, weight_mapping, weights); - // ok, now we have all weights for each // dof on the fine grid. if in debug // mode lets see if everything went smooth, @@ -1305,28 +1309,40 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa // possibly others) vector representants(weights.m(), -1); for (unsigned int parameter_dof=0; parameter_dof(column)) - break; - Assert (global_dof < weight_mapping.size(), ExcInternalError()); - - // now enter the representants global - // index into our list - representants[parameter_dof] = global_dof; - }; + if (coarse_dof_is_parameter[parameter_dof] == true) + { + unsigned int column=0; + for (; column(column)) + break; + Assert (global_dof < weight_mapping.size(), ExcInternalError()); + + // now enter the representants global + // index into our list + representants[parameter_dof] = global_dof; + } + else + { + // consistency check: if this + // is no parameter dof on the + // coarse grid, then the + // respective row must be + // empty! + for (unsigned int col=0; col &coa if ((weights(first_used_row,weight_mapping[global_dof]) == 1) && (representants[first_used_row] == static_cast(global_dof))) - // dof unconstrained + // dof unconstrained or + // constrained to itself + // (in case this cell is + // mapped to itself, rather + // than to children of + // itself) continue; // otherwise enter all constraints @@ -1397,7 +1418,7 @@ DoFTools::compute_intergrid_weights (const DoFHandler &coarse_ cell_intervals = Threads::split_range (coarse_grid.begin_active(), coarse_grid.end(), multithread_info.n_default_threads); - + Threads::ThreadManager thread_manager; for (unsigned int i=0; i &coars // aliases to the finite elements // used by the dof handlers: const FiniteElement &coarse_fe = coarse_grid.get_fe(); - + // for each cell on the parameter grid: // find out which degrees of freedom on the // fine grid correspond in which way to @@ -1514,13 +1535,19 @@ DoFTools::compute_intergrid_weights_1 (const DoFHandler &coars // loop over all dofs on this // cell and check whether they // are interesting for us - for (unsigned int local_parameter_dof=0; - local_parameter_dof &coars // zero if (global_parameter_representation(i) != 0) { - const unsigned int wi = parameter_dof_indices[local_parameter_dof], + const unsigned int wi = parameter_dof_indices[local_dof], wj = weight_mapping[i]; weights(wi,wj) = global_parameter_representation(i); }; diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index fc21e14a58..5ad1391713 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -3476,72 +3476,55 @@ unsigned int Triangulation::n_active_quads (const unsigned int level) const #if deal_II_dimension < 3 -template <> -unsigned int Triangulation<1>::n_hexs () const { +template +unsigned int Triangulation::n_hexs () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; -template <> -unsigned int Triangulation<1>::n_hexs (const unsigned int) const { - Assert (false, ExcFunctionNotUseful()); - return 0; -}; - -template <> -unsigned int Triangulation<1>::n_active_hexs () const { +template +unsigned int Triangulation::n_hexs (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; -template <> -unsigned int Triangulation<1>::n_active_hexs (const unsigned int) const { - Assert (false, ExcFunctionNotUseful()); - return 0; -}; - -template <> -unsigned int Triangulation<2>::n_hexs () const { +template +unsigned int Triangulation::n_active_hexs () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; -template <> -unsigned int Triangulation<2>::n_hexs (const unsigned int) const { - Assert (false, ExcFunctionNotUseful()); - return 0; -}; - -template <> -unsigned int Triangulation<2>::n_active_hexs () const { +template +unsigned int Triangulation::n_active_hexs (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; -template <> -unsigned int Triangulation<2>::n_active_hexs (const unsigned int) const { - Assert (false, ExcFunctionNotUseful()); - return 0; -}; - -#endif +#else template -unsigned int Triangulation::n_hexs () const { +unsigned int Triangulation::n_hexs () const +{ return number_cache.n_hexes; }; + template -unsigned int Triangulation::n_hexs (const unsigned int level) const { +unsigned int Triangulation::n_hexs (const unsigned int level) const +{ Assert (level < number_cache.n_hexes_level.size(), ExcIndexRange (level, 0, number_cache.n_hexes_level.size())); @@ -3549,14 +3532,18 @@ unsigned int Triangulation::n_hexs (const unsigned int level) const { }; + template -unsigned int Triangulation::n_active_hexs () const { +unsigned int Triangulation::n_active_hexs () const +{ return number_cache.n_active_hexes; }; + template -unsigned int Triangulation::n_active_hexs (const unsigned int level) const { +unsigned int Triangulation::n_active_hexs (const unsigned int level) const +{ Assert (level < number_cache.n_hexes_level.size(), ExcIndexRange (level, 0, number_cache.n_hexes_level.size())); @@ -3564,8 +3551,12 @@ unsigned int Triangulation::n_active_hexs (const unsigned int level) const }; +#endif + + template -unsigned int Triangulation::n_levels () const { +unsigned int Triangulation::n_levels () const +{ if (levels.size() == 0) return 0; // check whether there are -- 2.39.5