From 4fa606d4a701600aa53ab73de72b8fd82dd93d67 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 19 Jan 2001 17:45:06 +0000 Subject: [PATCH] Compatibility patches for IBMs xlC compiler 5.0, and other assorted minor changes enhancing the correctness of the library. git-svn-id: https://svn.dealii.org/branches/Branch-3-1@3732 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 64 ++++++++ deal.II/base/Makefile | 4 +- deal.II/base/include/base/data_out_base.h | 14 +- deal.II/base/include/base/exceptions.h | 2 +- deal.II/base/include/base/function.h | 38 ++--- .../base/include/base/function_derivative.h | 6 +- deal.II/base/include/base/function_lib.h | 48 +++--- .../base/include/base/memory_consumption.h | 33 ++++- deal.II/base/include/base/parameter_handler.h | 23 +-- deal.II/base/include/base/point.h | 29 ++++ deal.II/base/include/base/quadrature.h | 14 +- deal.II/base/include/base/tensor_function.h | 8 +- deal.II/base/source/convergence_table.cc | 2 +- deal.II/base/source/data_out_base.cc | 57 ++++---- deal.II/base/source/function.cc | 47 +++--- deal.II/base/source/function_derivative.cc | 14 +- deal.II/base/source/function_lib.cc | 88 +++++------ deal.II/base/source/parameter_handler.cc | 12 +- deal.II/base/source/quadrature.cc | 22 ++- deal.II/base/source/tensor_function.cc | 14 +- deal.II/configure.in | 70 +++++++-- deal.II/deal.II/include/dofs/dof_accessor.h | 5 +- .../include/dofs/dof_accessor.templates.h | 6 + deal.II/deal.II/include/dofs/dof_handler.h | 4 +- deal.II/deal.II/include/fe/fe.h | 92 ++++++------ .../deal.II/include/fe/fe_lib.criss_cross.h | 54 +++---- deal.II/deal.II/include/fe/fe_lib.dg.h | 28 ++-- deal.II/deal.II/include/fe/fe_lib.dgp.h | 48 +++--- deal.II/deal.II/include/fe/fe_lib.lagrange.h | 48 +++--- deal.II/deal.II/include/fe/fe_system.h | 58 ++++---- deal.II/deal.II/include/fe/fe_values.h | 80 +++++----- deal.II/deal.II/include/fe/q1_mapping.h | 46 +++--- deal.II/deal.II/include/grid/geometry_info.h | 31 ++-- deal.II/deal.II/include/grid/grid_in.h | 12 +- .../deal.II/include/grid/grid_reordering.h | 47 ++++-- deal.II/deal.II/include/grid/intergrid_map.h | 5 +- .../deal.II/include/grid/persistent_tria.h | 6 +- deal.II/deal.II/include/grid/tria.h | 10 +- .../include/grid/tria_accessor.templates.h | 19 ++- deal.II/deal.II/include/grid/tria_iterator.h | 7 +- deal.II/deal.II/include/multigrid/mg_base.h | 3 +- .../include/multigrid/mg_dof_handler.h | 4 +- deal.II/deal.II/include/numerics/assembler.h | 8 +- deal.II/deal.II/include/numerics/base.h | 2 +- deal.II/deal.II/include/numerics/data_out.h | 8 +- .../deal.II/include/numerics/data_out_faces.h | 2 +- .../deal.II/include/numerics/data_out_stack.h | 9 +- .../include/numerics/dof_renumbering.h | 8 +- .../include/numerics/error_estimator.h | 27 +++- deal.II/deal.II/include/numerics/histogram.h | 8 +- deal.II/deal.II/include/numerics/matrices.h | 2 +- .../include/numerics/solution_transfer.h | 12 +- deal.II/deal.II/include/numerics/vectors.h | 2 +- deal.II/deal.II/source/dofs/dof_accessor.cc | 10 +- deal.II/deal.II/source/dofs/dof_handler.cc | 7 + .../deal.II/source/dofs/dof_renumbering.cc | 17 +-- deal.II/deal.II/source/dofs/dof_tools.cc | 10 +- deal.II/deal.II/source/fe/fe.cc | 77 ++++++---- .../deal.II/source/fe/fe_lib.criss_cross.cc | 41 ++++-- deal.II/deal.II/source/fe/fe_lib.cubic.cc | 29 ++-- deal.II/deal.II/source/fe/fe_lib.dg.cc | 18 ++- .../deal.II/source/fe/fe_lib.dg.constant.cc | 16 +- deal.II/deal.II/source/fe/fe_lib.dgp1.cc | 31 +++- deal.II/deal.II/source/fe/fe_lib.dgp2.cc | 29 +++- deal.II/deal.II/source/fe/fe_lib.dgp3.cc | 27 +++- deal.II/deal.II/source/fe/fe_lib.linear.cc | 45 ++++-- deal.II/deal.II/source/fe/fe_lib.quadratic.cc | 39 +++-- deal.II/deal.II/source/fe/fe_lib.quartic.cc | 27 ++-- deal.II/deal.II/source/fe/fe_system.cc | 60 ++++---- deal.II/deal.II/source/fe/fe_tools.cc | 5 + deal.II/deal.II/source/fe/fe_values.cc | 18 ++- deal.II/deal.II/source/fe/q1_mapping.cc | 54 ++++--- .../deal.II/source/fe/q1_mapping.jacobians.cc | 10 +- deal.II/deal.II/source/grid/geometry_info.cc | 17 +-- deal.II/deal.II/source/grid/grid_generator.cc | 18 +-- deal.II/deal.II/source/grid/grid_in.cc | 19 ++- .../deal.II/source/grid/grid_refinement.cc | 9 +- .../deal.II/source/grid/grid_reordering.cc | 30 ++-- deal.II/deal.II/source/grid/intergrid_map.cc | 2 + .../deal.II/source/grid/persistent_tria.cc | 11 +- .../source/grid/tria.all_dimensions.cc | 1 + deal.II/deal.II/source/grid/tria.cc | 6 + deal.II/deal.II/source/grid/tria_accessor.cc | 4 +- .../source/multigrid/mg_dof_accessor.cc | 7 + .../source/multigrid/mg_dof_handler.cc | 7 +- .../deal.II/source/multigrid/mg_smoother.cc | 1 + deal.II/deal.II/source/multigrid/multigrid.cc | 1 + deal.II/deal.II/source/numerics/assembler.cc | 5 + deal.II/deal.II/source/numerics/base.cc | 5 + deal.II/deal.II/source/numerics/data_out.cc | 9 +- .../source/numerics/data_out_rotation.cc | 6 + .../deal.II/source/numerics/data_out_stack.cc | 8 +- .../numerics/derivative_approximation.cc | 2 +- .../source/numerics/error_estimator.cc | 9 +- deal.II/deal.II/source/numerics/histogram.cc | 22 +-- deal.II/deal.II/source/numerics/matrices.cc | 15 +- .../source/numerics/solution_transfer.cc | 11 +- .../deal.II/source/numerics/time_dependent.cc | 8 +- deal.II/deal.II/source/numerics/vectors.cc | 8 +- deal.II/doc/platforms/ibm_aix_xlc.html | 137 ++++++++++++++++++ deal.II/doc/readme.html | 3 + deal.II/lac/include/lac/block_sparse_matrix.h | 2 +- .../lac/block_sparse_matrix.templates.h | 1 - deal.II/lac/include/lac/block_vector.h | 2 +- .../lac/include/lac/block_vector.templates.h | 5 + deal.II/lac/include/lac/precondition_block.h | 4 +- deal.II/lac/include/lac/solver.h | 2 +- .../lac/include/lac/sparse_vanka.templates.h | 6 + deal.II/lac/include/lac/vector.h | 16 +- deal.II/lac/include/lac/vector.templates.h | 10 +- deal.II/lac/include/lac/vector_memory.h | 13 +- deal.II/lac/source/full_matrix.double.cc | 6 +- deal.II/lac/source/sparsity_pattern.cc | 2 +- 113 files changed, 1505 insertions(+), 825 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index b2f01df5f6..08d2e69ee3 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -300,4 +300,68 @@ AC_DEFUN(DEAL_II_CHECK_ASSERT_THROW, dnl AC_MSG_RESULT("no") $3 ]) +) + + + +dnl IBM xlC 5.0 from the VisualAge C++ pack has a bug with the following +dnl code. We can work around it if we insert code like "using namespace std;" +dnl in the right place, but we'd like to do so only if absolutely necessary. +dnl Check whether the compiler which we are using has this bug. +dnl +dnl Usage: DEAL_II_CHECK_IBM_XLC_ERROR +dnl +AC_DEFUN(DEAL_II_CHECK_IBM_XLC_ERROR, dnl + AC_MSG_CHECKING(for std::vector bug) + AC_LANG_CPLUSPLUS + CXXFLAGS="$CXXFLAGSG" + AC_TRY_COMPILE( + [ + namespace std { + template class allocator {}; + template > class vector{}; + } + + struct X {}; + template void g (const std::vector &x); + + void f () { + std::vector x; + g<1> (x); + }; + ], + [], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(yes. trying to work around) + AC_DEFINE(XLC_WORK_AROUND_STD_BUG) + ]) +) + + +dnl gcc2.95 doesn't have the std::iterator class, but the standard requires it, so +dnl check whether we have to work around it +dnl +dnl Usage: DEAL_II_HAVE_STD_ITERATOR +dnl +AC_DEFUN(DEAL_II_HAVE_STD_ITERATOR, dnl + AC_MSG_CHECKING(for std::iterator class) + AC_LANG_CPLUSPLUS + CXXFLAGS="$CXXFLAGSG" + AC_TRY_COMPILE( + [ +#include + class MyIterator : public std::iterator + {}; + ], + [], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_STD_ITERATOR_CLASS) + ], + [ + AC_MSG_RESULT(no) + ]) ) \ No newline at end of file diff --git a/deal.II/base/Makefile b/deal.II/base/Makefile index a6d1912e9f..c7fcbd82d1 100644 --- a/deal.II/base/Makefile +++ b/deal.II/base/Makefile @@ -76,11 +76,11 @@ endif lib/libbase.a: $(forward-declarations) $(o-files) - @echo =====base=============debug======$(MT)== Linking library: $@ + @echo =====base=============optimized==$(MT)== Linking library: $@ @ar ruv $@ $(o-files) lib/libbase.g.a: $(forward-declarations) $(go-files) - @echo =====base=============optimized==$(MT)== Linking library: $@ + @echo =====base=============debug======$(MT)== Linking library: $@ @ar ruv $@ $(go-files) diff --git a/deal.II/base/include/base/data_out_base.h b/deal.II/base/include/base/data_out_base.h index 616b2dd7be..05465b3fa0 100644 --- a/deal.II/base/include/base/data_out_base.h +++ b/deal.II/base/include/base/data_out_base.h @@ -1003,7 +1003,7 @@ class DataOutBase * on the parameters. */ template - static void write_ucd (const std::vector > &patches, + static void write_ucd (const typename std::vector > &patches, const std::vector &data_names, const UcdFlags &flags, std::ostream &out); @@ -1016,7 +1016,7 @@ class DataOutBase * on the parameters. */ template - static void write_gnuplot (const std::vector > &patches, + static void write_gnuplot (const typename std::vector > &patches, const std::vector &data_names, const GnuplotFlags &flags, std::ostream &out); @@ -1029,7 +1029,7 @@ class DataOutBase * on the parameters. */ template - static void write_povray (const std::vector > &patches, + static void write_povray (const typename std::vector > &patches, const std::vector &data_names, const PovrayFlags &flags, std::ostream &out); @@ -1042,7 +1042,7 @@ class DataOutBase * on the parameters. */ template - static void write_eps (const std::vector > &patches, + static void write_eps (const typename std::vector > &patches, const std::vector &data_names, const EpsFlags &flags, std::ostream &out); @@ -1055,7 +1055,7 @@ class DataOutBase * on the parameters. */ template - static void write_gmv (const std::vector > &patches, + static void write_gmv (const typename std::vector > &patches, const std::vector &data_names, const GmvFlags &flags, std::ostream &out); @@ -1175,7 +1175,7 @@ class DataOutBase */ template static void - write_gmv_reorder_data_vectors (const std::vector > &patches, + write_gmv_reorder_data_vectors (const typename std::vector > &patches, std::vector > &data_vectors); }; @@ -1514,7 +1514,7 @@ class DataOutInterface : private DataOutBase * allow the output functions to * know what they shall print. */ - virtual const std::vector > & + virtual const typename std::vector > & get_patches () const = 0; /** diff --git a/deal.II/base/include/base/exceptions.h b/deal.II/base/include/base/exceptions.h index 927c2e1e90..e92efa71e9 100644 --- a/deal.II/base/include/base/exceptions.h +++ b/deal.II/base/include/base/exceptions.h @@ -14,8 +14,8 @@ #define __deal2__exceptions_h +#include #include -#include #include #ifndef __GNUC__ diff --git a/deal.II/base/include/base/function.h b/deal.II/base/include/base/function.h index de66b9f622..9e64352053 100644 --- a/deal.II/base/include/base/function.h +++ b/deal.II/base/include/base/function.h @@ -162,7 +162,7 @@ class Function : public FunctionTime, * right size, i.e. the same * size as the @p{points} array. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -177,7 +177,7 @@ class Function : public FunctionTime, * the same number of components * as this function has. */ - virtual void vector_value_list (const std::vector > &points, + virtual void vector_value_list (const typename std::vector > &points, std::vector > &values) const; /** @@ -194,7 +194,7 @@ class Function : public FunctionTime, * function at the given point. */ virtual void vector_gradient (const Point &p, - std::vector > &gradients) const; + typename std::vector > &gradients) const; /** * Set @p{gradients} to the @@ -205,8 +205,8 @@ class Function : public FunctionTime, * right size, i.e. the same * size as the @p{points} array. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -223,8 +223,8 @@ class Function : public FunctionTime, * over the different components * of the function. */ - virtual void vector_gradient_list (const std::vector > &points, - std::vector > > &gradients) const; + virtual void vector_gradient_list (const typename std::vector > &points, + typename std::vector > > &gradients) const; /** * Compute the Laplacian of a @@ -245,7 +245,7 @@ class Function : public FunctionTime, * Compute the Laplacian of one * component at a set of points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -253,7 +253,7 @@ class Function : public FunctionTime, * Compute the Laplacians of all * components at a set of points. */ - virtual void vector_laplacian_list (const std::vector > &points, + virtual void vector_laplacian_list (const typename std::vector > &points, std::vector > &values) const; /** @@ -329,7 +329,7 @@ class ZeroFunction : public Function * the same size as the @p{points} * array. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -342,7 +342,7 @@ class ZeroFunction : public Function * the same size as the @p{points} * array. */ - virtual void vector_value_list (const std::vector > &points, + virtual void vector_value_list (const typename std::vector > &points, std::vector > &values) const; /** @@ -360,7 +360,7 @@ class ZeroFunction : public Function * for all components. */ virtual void vector_gradient (const Point &p, - std::vector > &gradients) const; + typename std::vector > &gradients) const; /** * Set @p{gradients} to the gradients of @@ -370,8 +370,8 @@ class ZeroFunction : public Function * already has the right size, i.e. * the same size as the @p{points} array. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -388,8 +388,8 @@ class ZeroFunction : public Function * over the different components * of the function. */ - virtual void vector_gradient_list (const std::vector > &points, - std::vector > > &gradients) const; + virtual void vector_gradient_list (const typename std::vector > &points, + typename std::vector > > &gradients) const; }; @@ -457,7 +457,7 @@ class ConstantFunction : public ZeroFunction * the same size as the @p{points} * array. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -470,7 +470,7 @@ class ConstantFunction : public ZeroFunction * the same size as the @p{points} * array. */ - virtual void vector_value_list (const std::vector > &points, + virtual void vector_value_list (const typename std::vector > &points, std::vector > &values) const; /** @@ -538,7 +538,7 @@ class ComponentSelectFunction : public ConstantFunction * the same size as the @p{points} * array. */ - virtual void vector_value_list (const std::vector > &points, + virtual void vector_value_list (const typename std::vector > &points, std::vector > &values) const; /** diff --git a/deal.II/base/include/base/function_derivative.h b/deal.II/base/include/base/function_derivative.h index 91375ee706..bffcabc2c7 100644 --- a/deal.II/base/include/base/function_derivative.h +++ b/deal.II/base/include/base/function_derivative.h @@ -86,9 +86,9 @@ class FunctionDerivative : public Function /** * Function values at multiple points. */ - virtual void value_list (const std::vector > &points, - std::vector &values, - const unsigned int component = 0) const; + virtual void value_list (const typename std::vector > &points, + std::vector &values, + const unsigned int component = 0) const; /** * Determine an estimate for diff --git a/deal.II/base/include/base/function_lib.h b/deal.II/base/include/base/function_lib.h index f0be7ae3ff..c7aab5d4eb 100644 --- a/deal.II/base/include/base/function_lib.h +++ b/deal.II/base/include/base/function_lib.h @@ -40,7 +40,7 @@ class SquareFunction : public Function /** * Function values at multiple points. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -53,8 +53,8 @@ class SquareFunction : public Function /** Gradients at multiple points. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -66,7 +66,7 @@ class SquareFunction : public Function /** * Laplacian of the function at multiple points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; }; @@ -92,7 +92,7 @@ class Q1WedgeFunction : public Function /** * Function values at multiple points. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -105,8 +105,8 @@ class Q1WedgeFunction : public Function /** Gradients at multiple points. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -118,7 +118,7 @@ class Q1WedgeFunction : public Function /** * Laplacian of the function at multiple points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; }; @@ -159,7 +159,7 @@ class PillowFunction : public Function /** * Values at multiple points. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -172,8 +172,8 @@ class PillowFunction : public Function /** * Gradients at multiple points. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -185,7 +185,7 @@ class PillowFunction : public Function /** * Laplacian at multiple points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; private: @@ -213,7 +213,7 @@ class CosineFunction : public Function /** * Values at multiple points. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -226,8 +226,8 @@ class CosineFunction : public Function /** * Gradients at multiple points. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -239,7 +239,7 @@ class CosineFunction : public Function /** * Laplacian at multiple points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; }; @@ -263,7 +263,7 @@ class ExpFunction : public Function /** * Values at multiple points. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -276,8 +276,8 @@ class ExpFunction : public Function /** * Gradients at multiple points. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -289,7 +289,7 @@ class ExpFunction : public Function /** * Laplacian at multiple points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; }; @@ -428,7 +428,7 @@ class JumpFunction : public Function /** * Function values at multiple points. */ - virtual void value_list (const std::vector > &points, + virtual void value_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; @@ -441,8 +441,8 @@ class JumpFunction : public Function /** Gradients at multiple points. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients, + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component = 0) const; /** @@ -454,7 +454,7 @@ class JumpFunction : public Function /** * Laplacian of the function at multiple points. */ - virtual void laplacian_list (const std::vector > &points, + virtual void laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int component = 0) const; diff --git a/deal.II/base/include/base/memory_consumption.h b/deal.II/base/include/base/memory_consumption.h index 1df064f48a..0035ff8658 100644 --- a/deal.II/base/include/base/memory_consumption.h +++ b/deal.II/base/include/base/memory_consumption.h @@ -194,7 +194,7 @@ namespace MemoryConsumption * vectors of bools. */ template - unsigned int memory_consumption (const std::vector &v); + unsigned int memory_consumption (const typename std::vector &v); /** * Estimate the amount of memory @@ -274,7 +274,23 @@ namespace MemoryConsumption * for a vector of pointers. */ template - unsigned int memory_consumption (const std::vector &v); + unsigned int memory_consumption (const typename std::vector &v); + + /** + * Specialization of the + * determination of the memory + * consumption of a vector, here + * for a vector of strings. This + * function is not necessary from a + * struct C++ viewpoint, since it + * could be generated, but is + * necessary for compatibility with + * IBM's xlC 5.0 compiler, and + * doesn't harm for other compilers + * as well. + */ + unsigned int memory_consumption (const std::vector &v); + /** * Determine an estimate of the @@ -282,7 +298,7 @@ namespace MemoryConsumption * consumed by a pair of values. */ template - unsigned int memory_consumption (const std::pair &p); + unsigned int memory_consumption (const typename std::pair &p); /** * Return the amount of memory @@ -413,8 +429,13 @@ namespace MemoryConsumption +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG + using namespace std; +#endif + template - unsigned int memory_consumption (const std::vector &v) + unsigned int memory_consumption (const typename std::vector &v) { unsigned int mem = sizeof(std::vector); const unsigned int n = v.size(); @@ -492,7 +513,7 @@ namespace MemoryConsumption template inline - unsigned int memory_consumption (const std::vector &v) + unsigned int memory_consumption (const typename std::vector &v) { return (v.capacity() * sizeof(T *) + sizeof(v)); @@ -502,7 +523,7 @@ namespace MemoryConsumption template inline - unsigned int memory_consumption (const std::pair &p) + unsigned int memory_consumption (const typename std::pair &p) { return (memory_consumption(p.first) + memory_consumption(p.second)); diff --git a/deal.II/base/include/base/parameter_handler.h b/deal.II/base/include/base/parameter_handler.h index aac88a1ed6..81f1a4e8f2 100644 --- a/deal.II/base/include/base/parameter_handler.h +++ b/deal.II/base/include/base/parameter_handler.h @@ -1625,17 +1625,6 @@ class MultipleParameterLoop : public ParameterHandler unsigned int memory_consumption () const; private: - /** - * Declare what a multiple entry - * is: a variant * entry (in - * curly braces @p{{}}) or an - * array (in double curly braces - * @p{{{}}}). - */ - enum MultipleEntryType - { - variant, array - }; /** * An object in the list of entries with @@ -1644,6 +1633,18 @@ class MultipleParameterLoop : public ParameterHandler class Entry { public: + /** + * Declare what a multiple entry + * is: a variant * entry (in + * curly braces @p{{}}) or an + * array (in double curly braces + * @p{{{}}}). + */ + enum MultipleEntryType + { + variant, array + }; + /** * Constructor */ diff --git a/deal.II/base/include/base/point.h b/deal.II/base/include/base/point.h index bcb07d2a17..11799280fa 100644 --- a/deal.II/base/include/base/point.h +++ b/deal.II/base/include/base/point.h @@ -385,5 +385,34 @@ Point operator * (const double factor, const Point &p) }; +/** + * Output operator for points. Print the elements consecutively, + * with a space in between. + */ +template +inline +std::ostream & operator << (std::ostream &out, const Point &p) +{ + for (unsigned int i=0; i &p) +{ + out << p[0]; + + return out; +}; #endif diff --git a/deal.II/base/include/base/quadrature.h b/deal.II/base/include/base/quadrature.h index 410705c688..af53021cdf 100644 --- a/deal.II/base/include/base/quadrature.h +++ b/deal.II/base/include/base/quadrature.h @@ -94,7 +94,7 @@ class Quadrature : public Subscriptor /** * Constructor from given vectors. */ - Quadrature (const std::vector > &points, + Quadrature (const typename std::vector > &points, const std::vector &weights); /** @@ -111,7 +111,7 @@ class Quadrature : public Subscriptor * Return a reference to the whole array of * quadrature points. */ - const std::vector > & get_points () const; + const typename std::vector > & get_points () const; /** * Return the weight of the @p{i}th @@ -138,7 +138,7 @@ class Quadrature : public Subscriptor * List of quadrature points. To be filled * by the constructors of derived classes. */ - std::vector > quadrature_points; + typename std::vector > quadrature_points; /** * List of weights of the quadrature points. @@ -256,7 +256,7 @@ class QProjector */ static void project_to_face (const Quadrature &quadrature, const unsigned int face_no, - std::vector > &q_points); + typename std::vector > &q_points); /** * Projection to all faces. @@ -264,7 +264,7 @@ class QProjector * over all faces at the same time. */ static void project_to_faces (const Quadrature &quadrature, - std::vector > &q_points); + typename std::vector > &q_points); /** * Compute the quadrature points on the @@ -277,7 +277,7 @@ class QProjector static void project_to_subface (const Quadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, - std::vector > &q_points); + typename std::vector > &q_points); /** * Projection to all child faces. @@ -287,7 +287,7 @@ class QProjector * then by subface */ static void project_to_subfaces (const Quadrature &quadrature, - std::vector > &q_points); + typename std::vector > &q_points); }; diff --git a/deal.II/base/include/base/tensor_function.h b/deal.II/base/include/base/tensor_function.h index 616c624338..04325c89b7 100644 --- a/deal.II/base/include/base/tensor_function.h +++ b/deal.II/base/include/base/tensor_function.h @@ -85,8 +85,8 @@ class TensorFunction : public FunctionTime, * the right size, i.e. the same * size as the @p{points} array. */ - virtual void value_list (const std::vector > &points, - std::vector > &values) const; + virtual void value_list (const typename std::vector > &points, + typename std::vector > &values) const; /** * Return the gradient of the @@ -102,8 +102,8 @@ class TensorFunction : public FunctionTime, * the right size, i.e. the same * size as the @p{points} array. */ - virtual void gradient_list (const std::vector > &points, - std::vector > &gradients) const; + virtual void gradient_list (const typename std::vector > &points, + typename std::vector > &gradients) const; /** * Exception diff --git a/deal.II/base/source/convergence_table.cc b/deal.II/base/source/convergence_table.cc index b1096d5268..775c35bc06 100644 --- a/deal.II/base/source/convergence_table.cc +++ b/deal.II/base/source/convergence_table.cc @@ -122,7 +122,7 @@ void ConvergenceTable::evaluate_convergence_rates(const std::string &data_column // first row add_value(rate_key, std::string("-")); for (unsigned int i=1; i +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template DataOutBase::Patch::Patch () : n_subdivisions (1) @@ -50,7 +57,7 @@ DataOutBase::Patch::memory_consumption () const template -void DataOutBase::write_ucd (const std::vector > &patches, +void DataOutBase::write_ucd (const typename std::vector > &patches, const std::vector &data_names, const UcdFlags &flags, std::ostream &out) @@ -460,7 +467,7 @@ void DataOutBase::write_ucd (const std::vector > &patches, template -void DataOutBase::write_gnuplot (const std::vector > &patches, +void DataOutBase::write_gnuplot (const typename std::vector > &patches, const std::vector &data_names, const GnuplotFlags &/*flags*/, std::ostream &out) @@ -748,7 +755,7 @@ void DataOutBase::write_gnuplot (const std::vector > &patche template -void DataOutBase::write_povray (const std::vector > &patches, +void DataOutBase::write_povray (const typename std::vector > &patches, const std::vector &data_names, const PovrayFlags &flags, std::ostream &out) @@ -954,13 +961,13 @@ void DataOutBase::write_povray (const std::vector > &patches << ver[dl](0) << "," << patch->data(0,dl) << "," << ver[dl](1) << ">, <" - << nrml[dl] << ">," << std::endl - << " \t<" + << nrml[dl] << ">," << std::endl; + out << " \t<" << ver[dl+n_subdivisions+1](0) << "," << patch->data(0,dl+n_subdivisions+1) << "," << ver[dl+n_subdivisions+1](1) << ">, <" - << nrml[dl+n_subdivisions+1] << ">," << std::endl - << "\t<" + << nrml[dl+n_subdivisions+1] << ">," << std::endl; + out << "\t<" << ver[dl+n_subdivisions+2](0) << "," << patch->data(0,dl+n_subdivisions+2) << "," << ver[dl+n_subdivisions+2](1) << ">, <" @@ -971,13 +978,13 @@ void DataOutBase::write_povray (const std::vector > &patches << ver[dl](0) << "," << patch->data(0,dl) << "," << ver[dl](1) << ">, <" - << nrml[dl] << ">," << std::endl - << "\t<" + << nrml[dl] << ">," << std::endl; + out << "\t<" << ver[dl+n_subdivisions+2](0) << "," << patch->data(0,dl+n_subdivisions+2) << "," << ver[dl+n_subdivisions+2](1) << ">, <" - << nrml[dl+n_subdivisions+2] << ">," << std::endl - << "\t<" + << nrml[dl+n_subdivisions+2] << ">," << std::endl; + out << "\t<" << ver[dl+1](0) << "," << patch->data(0,dl+1) << "," << ver[dl+1](1) << ">, <" @@ -990,12 +997,12 @@ void DataOutBase::write_povray (const std::vector > &patches out << "triangle {" << std::endl << "\t<" << ver[dl](0) << "," << patch->data(0,dl) << "," - << ver[dl](1) << ">," << std::endl - << "\t<" + << ver[dl](1) << ">," << std::endl; + out << "\t<" << ver[dl+n_subdivisions+1](0) << "," << patch->data(0,dl+n_subdivisions+1) << "," - << ver[dl+n_subdivisions+1](1) << ">," << std::endl - << "\t<" + << ver[dl+n_subdivisions+1](1) << ">," << std::endl; + out << "\t<" << ver[dl+n_subdivisions+2](0) << "," << patch->data(0,dl+n_subdivisions+2) << "," << ver[dl+n_subdivisions+2](1) << ">}" << std::endl; @@ -1004,12 +1011,12 @@ void DataOutBase::write_povray (const std::vector > &patches out << "triangle {" << std::endl << "\t<" << ver[dl](0) << "," << patch->data(0,dl) << "," - << ver[dl](1) << ">," << std::endl - << "\t<" + << ver[dl](1) << ">," << std::endl; + out << "\t<" << ver[dl+n_subdivisions+2](0) << "," << patch->data(0,dl+n_subdivisions+2) << "," - << ver[dl+n_subdivisions+2](1) << ">," << std::endl - << "\t<" + << ver[dl+n_subdivisions+2](1) << ">," << std::endl; + out << "\t<" << ver[dl+1](0) << "," << patch->data(0,dl+1) << "," << ver[dl+1](1) << ">}" << std::endl; @@ -1050,7 +1057,7 @@ void DataOutBase::write_povray (const std::vector > &patches template -void DataOutBase::write_eps (const std::vector > &patches, +void DataOutBase::write_eps (const typename std::vector > &patches, const std::vector &/*data_names*/, const EpsFlags &flags, std::ostream &out) @@ -1389,7 +1396,7 @@ void DataOutBase::write_eps (const std::vector > &patches, template -void DataOutBase::write_gmv (const std::vector > &patches, +void DataOutBase::write_gmv (const typename std::vector > &patches, const std::vector &data_names, const GmvFlags &/*flags*/, std::ostream &out) @@ -1563,7 +1570,7 @@ void DataOutBase::write_gmv (const std::vector > &patches, // d>spacedim. write zeros instead { const unsigned int n_points - = static_cast(pow (n_subdivisions+1, dim)); + = static_cast(pow (static_cast(n_subdivisions+1), dim)); for (unsigned int i=0; i > &patches, template void -DataOutBase::write_gmv_reorder_data_vectors (const std::vector > &patches, +DataOutBase::write_gmv_reorder_data_vectors (const typename std::vector > &patches, std::vector > &data_vectors) { // unlike in the main function, we @@ -1796,7 +1803,7 @@ template void DataOutInterface::write_ucd (std::ostream &out) const { DataOutBase::write_ucd (get_patches(), get_dataset_names(), - ucd_flags, out); + ucd_flags, out); }; @@ -1954,7 +1961,7 @@ std::string DataOutInterface::default_suffix (OutputFormat output_ template -DataOutInterface::OutputFormat +typename DataOutInterface::OutputFormat DataOutInterface::parse_output_format (const std::string &format_name) { if (format_name == "ucd") diff --git a/deal.II/base/source/function.cc b/deal.II/base/source/function.cc index 0b39d30ba6..38499f74ef 100644 --- a/deal.II/base/source/function.cc +++ b/deal.II/base/source/function.cc @@ -48,10 +48,15 @@ void Function::vector_value (const Point &, }; +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template -void Function::value_list (const std::vector > &points, - std::vector &values, - const unsigned int component) const +void Function::value_list (const typename std::vector > &points, + std::vector &values, + const unsigned int component) const { // check whether component is in // the valid range is up to the @@ -65,7 +70,7 @@ void Function::value_list (const std::vector > &points, template -void Function::vector_value_list (const std::vector > &points, +void Function::vector_value_list (const typename std::vector > &points, std::vector > &values) const { // check whether component is in @@ -90,15 +95,15 @@ Tensor<1,dim> Function::gradient (const Point &, template void Function::vector_gradient (const Point &, - std::vector > &) const + typename std::vector > &) const { Assert (false, ExcPureFunctionCalled()); }; template -void Function::gradient_list (const std::vector > &points, - std::vector > &gradients, +void Function::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int component) const { Assert (gradients.size() == points.size(), @@ -110,8 +115,8 @@ void Function::gradient_list (const std::vector > &points, template -void Function::vector_gradient_list (const std::vector > &points, - std::vector > > &gradients) const +void Function::vector_gradient_list (const typename std::vector > &points, + typename std::vector > > &gradients) const { Assert (gradients.size() == points.size(), ExcDimensionMismatch(gradients.size(), points.size())); @@ -146,7 +151,7 @@ void Function::vector_laplacian (const Point &, template -void Function::laplacian_list (const std::vector > &points, +void Function::laplacian_list (const typename std::vector > &points, std::vector &laplacians, const unsigned int component) const { @@ -162,7 +167,7 @@ void Function::laplacian_list (const std::vector > &points, template -void Function::vector_laplacian_list (const std::vector > &points, +void Function::vector_laplacian_list (const typename std::vector > &points, std::vector > &laplacians) const { // check whether component is in @@ -220,7 +225,7 @@ void ZeroFunction::vector_value (const Point &, template -void ZeroFunction::value_list (const std::vector > &points, +void ZeroFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int /*component*/) const { Assert (values.size() == points.size(), @@ -231,7 +236,7 @@ void ZeroFunction::value_list (const std::vector > &points, template -void ZeroFunction::vector_value_list (const std::vector > &points, +void ZeroFunction::vector_value_list (const typename std::vector > &points, std::vector > &values) const { Assert (values.size() == points.size(), @@ -256,7 +261,7 @@ Tensor<1,dim> ZeroFunction::gradient (const Point &, template void ZeroFunction::vector_gradient (const Point &, - std::vector > &gradients) const + typename std::vector > &gradients) const { Assert (gradients.size() == n_components, ExcDimensionMismatch(gradients.size(), n_components)); @@ -267,8 +272,8 @@ void ZeroFunction::vector_gradient (const Point &, template -void ZeroFunction::gradient_list (const std::vector > &points, - std::vector > &gradients, +void ZeroFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int /*component*/) const { Assert (gradients.size() == points.size(), @@ -280,8 +285,8 @@ void ZeroFunction::gradient_list (const std::vector > &points, template -void ZeroFunction::vector_gradient_list (const std::vector > &points, - std::vector > > &gradients) const +void ZeroFunction::vector_gradient_list (const typename std::vector > &points, + typename std::vector > > &gradients) const { Assert (gradients.size() == points.size(), ExcDimensionMismatch(gradients.size(), points.size())); @@ -328,7 +333,7 @@ void ConstantFunction::vector_value (const Point &, template -void ConstantFunction::value_list (const std::vector > &points, +void ConstantFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int /*component*/) const { @@ -340,7 +345,7 @@ void ConstantFunction::value_list (const std::vector > &points, template -void ConstantFunction::vector_value_list (const std::vector > &points, +void ConstantFunction::vector_value_list (const typename std::vector > &points, std::vector > &values) const { Assert (values.size() == points.size(), @@ -391,7 +396,7 @@ void ComponentSelectFunction::vector_value (const Point &, template -void ComponentSelectFunction::vector_value_list (const std::vector > &points, +void ComponentSelectFunction::vector_value_list (const typename std::vector > &points, std::vector > &values) const { Assert (values.size() == points.size(), diff --git a/deal.II/base/source/function_derivative.cc b/deal.II/base/source/function_derivative.cc index cf1f624cc6..be2607c6f4 100644 --- a/deal.II/base/source/function_derivative.cc +++ b/deal.II/base/source/function_derivative.cc @@ -72,9 +72,15 @@ FunctionDerivative::value (const Point &p, +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template void -FunctionDerivative::value_list (const std::vector > &points, +FunctionDerivative::value_list (const typename std::vector > &points, std::vector &values, const unsigned int component) const { @@ -158,6 +164,6 @@ FunctionDerivative::memory_consumption () const }; -template FunctionDerivative<1>; -template FunctionDerivative<2>; -template FunctionDerivative<3>; +template class FunctionDerivative<1>; +template class FunctionDerivative<2>; +template class FunctionDerivative<3>; diff --git a/deal.II/base/source/function_lib.cc b/deal.II/base/source/function_lib.cc index 6f860abf6e..afe6e5ca2d 100644 --- a/deal.II/base/source/function_lib.cc +++ b/deal.II/base/source/function_lib.cc @@ -39,10 +39,14 @@ SquareFunction::value (const Point &p, } +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif template void -SquareFunction::value_list (const std::vector > &points, +SquareFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -68,7 +72,7 @@ SquareFunction::laplacian (const Point &, template void -SquareFunction::laplacian_list (const std::vector > &points, +SquareFunction::laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -93,8 +97,8 @@ SquareFunction::gradient (const Point &p, template void -SquareFunction::gradient_list (const std::vector > &points, - std::vector > &gradients, +SquareFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int) const { Assert (gradients.size() == points.size(), @@ -120,7 +124,7 @@ Q1WedgeFunction::value (const Point &p, template void -Q1WedgeFunction::value_list (const std::vector > &points, +Q1WedgeFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -146,7 +150,7 @@ Q1WedgeFunction::laplacian (const Point &, template void -Q1WedgeFunction::laplacian_list (const std::vector > &points, +Q1WedgeFunction::laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -174,8 +178,8 @@ Q1WedgeFunction::gradient (const Point &p, template void -Q1WedgeFunction::gradient_list (const std::vector > &points, - std::vector > &gradients, +Q1WedgeFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int) const { Assert (gradients.size() == points.size(), @@ -220,7 +224,7 @@ PillowFunction::value (const Point &p, template void -PillowFunction::value_list (const std::vector > &points, +PillowFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -272,7 +276,7 @@ PillowFunction::laplacian (const Point &p, template void -PillowFunction::laplacian_list (const std::vector > &points, +PillowFunction::laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -329,8 +333,8 @@ PillowFunction::gradient (const Point &p, template void -PillowFunction::gradient_list (const std::vector > &points, - std::vector > &gradients, +PillowFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int) const { Assert (gradients.size() == points.size(), @@ -382,7 +386,7 @@ CosineFunction::value (const Point &p, template void -CosineFunction::value_list (const std::vector > &points, +CosineFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -430,7 +434,7 @@ CosineFunction::laplacian (const Point &p, template void -CosineFunction::laplacian_list (const std::vector > &points, +CosineFunction::laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -485,8 +489,8 @@ CosineFunction::gradient (const Point &p, template void -CosineFunction::gradient_list (const std::vector > &points, - std::vector > &gradients, +CosineFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int) const { Assert (gradients.size() == points.size(), @@ -538,7 +542,7 @@ ExpFunction::value (const Point &p, template void -ExpFunction::value_list (const std::vector > &points, +ExpFunction::value_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -586,7 +590,7 @@ ExpFunction::laplacian (const Point &p, template void -ExpFunction::laplacian_list (const std::vector > &points, +ExpFunction::laplacian_list (const typename std::vector > &points, std::vector &values, const unsigned int) const { @@ -641,8 +645,8 @@ ExpFunction::gradient (const Point &p, template void -ExpFunction::gradient_list (const std::vector > &points, - std::vector > &gradients, +ExpFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients, const unsigned int) const { Assert (gradients.size() == points.size(), @@ -891,7 +895,7 @@ JumpFunction::value (const Point &p, template void -JumpFunction::value_list (const std::vector > &p, +JumpFunction::value_list (const typename std::vector > &p, std::vector &values, const unsigned int) const { @@ -919,7 +923,7 @@ JumpFunction::laplacian (const Point &p, template void -JumpFunction::laplacian_list (const std::vector > &p, +JumpFunction::laplacian_list (const typename std::vector > &p, std::vector &values, const unsigned int) const { @@ -955,8 +959,8 @@ JumpFunction::gradient (const Point &p, template void -JumpFunction::gradient_list (const std::vector > &p, - std::vector > &gradients, +JumpFunction::gradient_list (const typename std::vector > &p, + typename std::vector > &gradients, const unsigned int) const { Assert (gradients.size() == p.size(), @@ -983,21 +987,21 @@ JumpFunction::memory_consumption () const }; -template SquareFunction<1>; -template SquareFunction<2>; -template SquareFunction<3>; -template Q1WedgeFunction<1>; -template Q1WedgeFunction<2>; -template Q1WedgeFunction<3>; -template PillowFunction<1>; -template PillowFunction<2>; -template PillowFunction<3>; -template CosineFunction<1>; -template CosineFunction<2>; -template CosineFunction<3>; -template ExpFunction<1>; -template ExpFunction<2>; -template ExpFunction<3>; -template JumpFunction<1>; -template JumpFunction<2>; -template JumpFunction<3>; +template class SquareFunction<1>; +template class SquareFunction<2>; +template class SquareFunction<3>; +template class Q1WedgeFunction<1>; +template class Q1WedgeFunction<2>; +template class Q1WedgeFunction<3>; +template class PillowFunction<1>; +template class PillowFunction<2>; +template class PillowFunction<3>; +template class CosineFunction<1>; +template class CosineFunction<2>; +template class CosineFunction<3>; +template class ExpFunction<1>; +template class ExpFunction<2>; +template class ExpFunction<3>; +template class JumpFunction<1>; +template class JumpFunction<2>; +template class JumpFunction<3>; diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index 6c208e380e..d981557b16 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -1165,13 +1165,13 @@ void MultipleParameterLoop::init_branches () // finally calculate number of branches n_branches = 1; for (unsigned int i=0; idifferent_values.size(); std::string entry_value; - if (choice->type == variant) + if (choice->type == Entry::variant) entry_value = choice->different_values[selection]; else { @@ -1278,7 +1278,7 @@ void MultipleParameterLoop::fill_entry_values (const unsigned int run_no) subsection_path.swap (choice->subsection_path); // move ahead if it was a variant entry - if (choice->type == variant) + if (choice->type == Entry::variant) possibilities *= choice->different_values.size(); }; @@ -1348,9 +1348,9 @@ void MultipleParameterLoop::Entry::split_different_values () // entry ({...}) or an array ({{...}}) if ((entry_value.find("{{") != std::string::npos) && (entry_value.find("}}") != std::string::npos)) - type = array; + type = Entry::array; else - type = variant; + type = Entry::variant; }; diff --git a/deal.II/base/source/quadrature.cc b/deal.II/base/source/quadrature.cc index cf20d6a7a7..1fa2b32176 100644 --- a/deal.II/base/source/quadrature.cc +++ b/deal.II/base/source/quadrature.cc @@ -20,6 +20,7 @@ template <> Quadrature<0>::Quadrature (const unsigned int) + : n_quadrature_points(0) {}; @@ -33,8 +34,14 @@ Quadrature::Quadrature (const unsigned int n_q) : +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template -Quadrature::Quadrature (const std::vector > &points, +Quadrature::Quadrature (const typename std::vector > &points, const std::vector &weights) : n_quadrature_points(points.size()), quadrature_points(points), @@ -58,7 +65,8 @@ Quadrature<0>::Quadrature (const Quadrature<-1> &, template <> Quadrature<1>::Quadrature (const Quadrature<0> &, - const Quadrature<1> &) + const Quadrature<1> &) : + n_quadrature_points (0) { Assert (false, ExcInternalError()); }; @@ -139,7 +147,7 @@ const std::vector > & Quadrature<0>::get_points () const template -const std::vector > & Quadrature::get_points () const +const typename std::vector > & Quadrature::get_points () const { return quadrature_points; }; @@ -524,8 +532,8 @@ void QProjector<3>::project_to_subface (const Quadrature<2> &quadrature, template void -QProjector::project_to_faces (const Quadrature &quadrature, - std::vector > &q_points) +QProjector::project_to_faces (const Quadrature &quadrature, + typename std::vector > &q_points) { unsigned int npt = quadrature.n_quadrature_points; unsigned int nf = GeometryInfo::faces_per_cell; @@ -547,8 +555,8 @@ QProjector::project_to_faces (const Quadrature &quadrature, template void -QProjector::project_to_subfaces (const Quadrature &quadrature, - std::vector > &q_points) +QProjector::project_to_subfaces (const Quadrature &quadrature, + typename std::vector > &q_points) { unsigned int npt = quadrature.n_quadrature_points; unsigned int nf = GeometryInfo::faces_per_cell; diff --git a/deal.II/base/source/tensor_function.cc b/deal.II/base/source/tensor_function.cc index 68c111ec72..d58695c7af 100644 --- a/deal.II/base/source/tensor_function.cc +++ b/deal.II/base/source/tensor_function.cc @@ -44,10 +44,16 @@ TensorFunction::value (const Point &) const }; +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template void -TensorFunction::value_list (const std::vector > &points, - std::vector > &values) const +TensorFunction::value_list (const typename std::vector > &points, + typename std::vector > &values) const { Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size())); @@ -68,8 +74,8 @@ TensorFunction::gradient (const Point &) const template void -TensorFunction::gradient_list (const std::vector > &points, - std::vector > &gradients) const +TensorFunction::gradient_list (const typename std::vector > &points, + typename std::vector > &gradients) const { Assert (gradients.size() == points.size(), ExcDimensionMismatch(gradients.size(), points.size())); diff --git a/deal.II/configure.in b/deal.II/configure.in index 4eaca280f6..f8fe015596 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -105,10 +105,11 @@ AC_PATH_PROG(CC,$CC) -dnl Find the right C++ compiler. This modifies the following -dnl variables: CXX, GXX, CXXFLAGS +dnl Find the right C++ compiler. Note that for historical reasons, the +dnl compiler name and version is in the name GXX_VERSION, even if the +dnl compiler is not GCC. AC_PROG_CXX -AC_PATH_PROG(CXX,$CXX) +AC_PATH_PROG(CXX,$CXX) if test "$GXX" = yes ; then # find out the right version GXX_VERSION_STRING=`($CXX -v 2>&1) | grep "gcc version"` @@ -141,9 +142,22 @@ if test "$GXX" = yes ; then ;; esac else - AC_MSG_ERROR(No configuration options for this C++ compiler - supported at present) - exit 1 + + dnl Check for IBM xlC. For some reasons, depending on some environment variables, + dnl moon position, and other reasons unknown to me, the compiler displays + dnl different names in the first line of output, so check various possibilities + is_ibm_xlc="`($CXX 2>&1) | egrep 'VisualAge C++|C Set ++|C for AIX Compiler'`" + if test "x$is_ibm_xlc" != "x" ; then + dnl Ah, this is IBM's C++ compiler. Unfortunately, we don't presently + dnl know how to check the version number, so assume that is sufficiently + dnl high... + AC_MSG_RESULT(compiler is IBM xlC) + GXX_VERSION=ibm_xlc + else + AC_MSG_ERROR(No configuration options for this C++ compiler + supported at present) + exit 1 + fi fi AC_SUBST(GXX_VERSION) @@ -203,7 +217,7 @@ if test "$GXX" = yes ; then case "$GXX_VERSION" in egcs1.1 | gcc2.95) - CXXFLAGSG="$CXXFLAGSG -Wmissing-declarations -Wbad-function-cast -Wtraditional -Wnested-externs" + CXXFLAGSG="$CXXFLAGSG -DDEBUG -Wmissing-declarations -Wbad-function-cast -Wtraditional -Wnested-externs" CXXFLAGSO="$CXXFLAGSO -fnonnull-objects" ;; @@ -212,10 +226,17 @@ if test "$GXX" = yes ; then esac else - dnl Other compiler - AC_MSG_ERROR(No compiler options for this C++ compiler - specified at present) - exit 1 + + if test "x$GXX_VERSION" = "xibm_xlc" ; then + CXXFLAGSG="$CXXFLAGS -g -check=bounds -info=all -qrtti=all" + CXXFLAGSO="$CXXFLAGS -O2 -w -qansialias -qrtti=all" + else + + dnl Other compiler + AC_MSG_ERROR(No compiler options for this C++ compiler + specified at present) + exit 1 + fi fi AC_SUBST(CXXFLAGSG) @@ -290,7 +311,12 @@ dnl compiler flags, and define `DISABLE_ASSERT_THROW' if necessary. DEAL_II_CHECK_ASSERT_THROW(debug, $CXXFLAGSG, CXXFLAGSG="-DDISABLE_ASSERT_THROW $CXXFLAGSG") DEAL_II_CHECK_ASSERT_THROW(optimized, $CXXFLAGSO, CXXFLAGSO="-DDISABLE_ASSERT_THROW $CXXFLAGSO") +dnl IBM's xlC compiler has a problem with some kind of code that does not +dnl "using namespace std;" Try to work around if necessary +DEAL_II_CHECK_IBM_XLC_ERROR +dnl See whether we can use the std::iterator class +DEAL_II_HAVE_STD_ITERATOR dnl ------------------------------------------------------------- @@ -316,13 +342,25 @@ dnl headers to make reentrant functions (with suffix _r) declared dnl - remove -ansi from compiler flags again, since ACE yields hundreds of dnl error messages with this flag if test "$enablemultithreading" = yes ; then - DEAL_II_GET_THREAD_FLAGS - DEAL_II_THREAD_CPPFLAGS + if test "$GXX" = yes ; then + DEAL_II_GET_THREAD_FLAGS + DEAL_II_THREAD_CPPFLAGS - AC_DEFINE(__USE_MALLOC) - AC_DEFINE(_REENTRANT) + AC_DEFINE(__USE_MALLOC) + AC_DEFINE(_REENTRANT) - CXXFLAGSG="`echo $CXXFLAGSG | perl -pi -e 's/-ansi//g;'`" + CXXFLAGSG="`echo $CXXFLAGSG | perl -pi -e 's/-ansi//g;'`" + else + if test "x$GXX_VERSION" = "xibm_xlc" ; then + CXXFLAGSG = "$CXXFLAGSG -threaded" + CXXFLAGSO = "$CXXFLAGSO -threaded" + else + dnl Other compiler + AC_MSG_ERROR(No threading compiler options for this C++ compiler + specified at present) + exit 1 + fi + fi fi diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index bbf48cc499..f78a197171 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -145,6 +145,7 @@ class DoFAccessor template class DoFObjectAccessor_Inheritance { + public: /** * Declaration of the @p{typedef}. * See the full documentation for @@ -170,6 +171,7 @@ class DoFObjectAccessor_Inheritance template class DoFObjectAccessor_Inheritance { + public: /** * Declaration of the @p{typedef}. * See the full documentation for @@ -222,7 +224,8 @@ class DoFObjectAccessor_Inheritance template class DoFObjectAccessor : public DoFAccessor, public TriaObjectAccessor -{ public: +{ + public: /** * Data type passed by the iterator class. */ diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index 3c351e95ca..d46bfc1e61 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -237,6 +237,12 @@ DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex, }; +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template inline void diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index 2dab1ce981..eab1a27c02 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -257,7 +257,7 @@ class DoFHandler : public Subscriptor, * for each boundary indicator, which is * guaranteed by the @p{map} data type. */ - typedef std::map*> FunctionMap; + typedef typename std::map*> FunctionMap; /** * When the arrays holding the @@ -1137,7 +1137,7 @@ class DoFHandler : public Subscriptor, * @p{levels[]} tree of the @ref{Triangulation} * objects. */ - std::vector*> levels; + typename std::vector*> levels; /** * Store the number of dofs created last diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index 3965d2568b..a0600eb0c6 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -1098,8 +1098,10 @@ class FiniteElement : public FiniteElementBase * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, - const Point &p) const = 0; + virtual + Point + transform_unit_to_real_cell (const typename DoFHandler::cell_iterator &cell, + const Point &p) const = 0; /** * Transforms the point @p{p} on @@ -1107,8 +1109,10 @@ class FiniteElement : public FiniteElementBase * @p{p_unit} on the unit cell * @p{cell} and returns @p{p_unit}. */ - virtual Point transform_real_to_unit_cell (const DoFHandler::cell_iterator cell, - const Point &p) const = 0; + virtual + Point + transform_real_to_unit_cell (const typename DoFHandler::cell_iterator &cell, + const Point &p) const = 0; /** * Return the value of the @@ -1214,18 +1218,18 @@ class FiniteElement : public FiniteElementBase * not be used by users unless * absolutely needed. */ - virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, + virtual void fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grads_transform) const; + const typename std::vector > > &shape_grads_transform) const; /** * Do the same thing that the @@ -1357,24 +1361,24 @@ class FiniteElement : public FiniteElementBase * and should not be used by users unless * absolutely needed. */ - virtual void fill_fe_face_values (const DoFHandler::cell_iterator &cell, + virtual void fill_fe_face_values (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - const std::vector > &global_unit_points, - std::vector > &jacobians, + const typename std::vector > &unit_points, + const typename std::vector > &global_unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, std::vector &face_jacobi_determinants, const bool compute_face_jacobians, - std::vector > &normal_vectors, + typename std::vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grads_transform) const; + const typename std::vector > > &shape_grads_transform) const; /** * This function does almost the @@ -1415,23 +1419,23 @@ class FiniteElement : public FiniteElementBase * should not be used by users * unless absolutely needed. */ - virtual void fill_fe_subface_values (const DoFHandler::cell_iterator &cell, + virtual void fill_fe_subface_values (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - const std::vector > &global_unit_points, - std::vector > &jacobians, + const typename std::vector > &unit_points, + const typename std::vector > &global_unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, std::vector &face_jacobi_determinants, const bool compute_face_jacobians, - std::vector > &normal_vectors, + typename std::vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grads_transform) const; + const typename std::vector > > &shape_grads_transform) const; /** * Return the support points of @@ -1454,7 +1458,7 @@ class FiniteElement : public FiniteElementBase * dimensions, an overwritten * function has to be provided. */ - virtual void get_unit_support_points (std::vector > &unit_points) const; + virtual void get_unit_support_points (typename std::vector > &unit_points) const; /** * Compute the off-points of the @@ -1505,8 +1509,8 @@ class FiniteElement : public FiniteElementBase * object of which a pointer is * stored by the triangulation. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Compute the off-points of the @@ -1571,8 +1575,8 @@ class FiniteElement : public FiniteElementBase * to the @p{get_support_points} * function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const =0; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const =0; /** * This is the second separated function @@ -1594,8 +1598,8 @@ class FiniteElement : public FiniteElementBase * refer to the @p{get_support_points} * function. */ - virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const std::vector > &unit_points, + virtual void get_face_jacobians (const typename DoFHandler::face_iterator &face, + const typename std::vector > &unit_points, std::vector &face_jacobi_determinants) const =0; /** @@ -1614,9 +1618,9 @@ class FiniteElement : public FiniteElementBase * not be called for faces at the * boundary. */ - virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + virtual void get_subface_jacobians (const typename DoFHandler::face_iterator &face, const unsigned int subface_no, - const std::vector > &unit_points, + const typename std::vector > &unit_points, std::vector &face_jacobi_determinants) const =0; /** @@ -1644,10 +1648,10 @@ class FiniteElement : public FiniteElementBase * to the @p{get_support_points} * function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const =0; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const =0; /** * Does the same as the above function, @@ -1659,11 +1663,11 @@ class FiniteElement : public FiniteElementBase * must not be called for faces at the * boundary. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const =0; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const =0; /** * Fill in the given matrix with @@ -1799,7 +1803,7 @@ class FiniteElement : public FiniteElementBase * to the @p{get_support_points} * function. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const =0; /** diff --git a/deal.II/deal.II/include/fe/fe_lib.criss_cross.h b/deal.II/deal.II/include/fe/fe_lib.criss_cross.h index ca95058de4..182f05aa13 100644 --- a/deal.II/deal.II/include/fe/fe_lib.criss_cross.h +++ b/deal.II/deal.II/include/fe/fe_lib.criss_cross.h @@ -186,7 +186,7 @@ class FECrissCross : public FiniteElement * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, + virtual Point transform_unit_to_real_cell (const typename DoFHandler::cell_iterator &cell, const Point &p) const; /** @@ -195,7 +195,7 @@ class FECrissCross : public FiniteElement * @p{p_unit} on the unit cell * @p{cell} and returns @p{p_unit}. */ - virtual Point transform_real_to_unit_cell (const DoFHandler::cell_iterator cell, + virtual Point transform_real_to_unit_cell (const typename DoFHandler::cell_iterator &cell, const Point &p) const; /** @@ -231,27 +231,27 @@ class FECrissCross : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; /** @@ -283,9 +283,9 @@ class FECrissCross : public FiniteElement * In two spatial dimensions, this function * simply returns the length of the face. */ - virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const; + virtual void get_face_jacobians (const typename DoFHandler::face_iterator &face, + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const; /** * Refer to the base class for detailed @@ -295,10 +295,10 @@ class FECrissCross : public FiniteElement * simply returns half the length of the * whole face. */ - virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + virtual void get_subface_jacobians (const typename DoFHandler::face_iterator &face, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const; + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const; /** * Return the normal vectors to the @@ -314,10 +314,10 @@ class FECrissCross : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const; /** * Return the normal vectors to the @@ -334,11 +334,11 @@ class FECrissCross : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const; /** * Refer to the base class for detailed @@ -350,18 +350,18 @@ class FECrissCross : public FiniteElement * For higher dimensional finite elements * we use multilinear mappings. */ - virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, + virtual void fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grad_transform) const; + const typename std::vector > > &shape_grad_transform) const; DeclException0 (ExcNotUseful); }; diff --git a/deal.II/deal.II/include/fe/fe_lib.dg.h b/deal.II/deal.II/include/fe/fe_lib.dg.h index 751470a45b..fec18977e2 100644 --- a/deal.II/deal.II/include/fe/fe_lib.dg.h +++ b/deal.II/deal.II/include/fe/fe_lib.dg.h @@ -66,27 +66,27 @@ class FEDG_Q0 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; }; @@ -124,8 +124,8 @@ class FEDG_Q1 : public FEQ1 * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; }; @@ -161,8 +161,8 @@ class FEDG_Q2 : public FEQ2 * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; }; @@ -198,8 +198,8 @@ class FEDG_Q3 : public FEQ3 * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; }; @@ -235,8 +235,8 @@ class FEDG_Q4 : public FEQ4 * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; }; diff --git a/deal.II/deal.II/include/fe/fe_lib.dgp.h b/deal.II/deal.II/include/fe/fe_lib.dgp.h index 10978b6474..a01f3fcbbc 100644 --- a/deal.II/deal.II/include/fe/fe_lib.dgp.h +++ b/deal.II/deal.II/include/fe/fe_lib.dgp.h @@ -68,21 +68,21 @@ class FEDG_P1 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -97,7 +97,7 @@ class FEDG_P1 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: @@ -162,21 +162,21 @@ class FEDG_P2 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -191,7 +191,7 @@ class FEDG_P2 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: @@ -256,21 +256,21 @@ class FEDG_P3 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -285,7 +285,7 @@ class FEDG_P3 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: @@ -350,21 +350,21 @@ class FEDG_P4 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -379,7 +379,7 @@ class FEDG_P4 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: diff --git a/deal.II/deal.II/include/fe/fe_lib.lagrange.h b/deal.II/deal.II/include/fe/fe_lib.lagrange.h index 22c6a85e62..47292a7a77 100644 --- a/deal.II/deal.II/include/fe/fe_lib.lagrange.h +++ b/deal.II/deal.II/include/fe/fe_lib.lagrange.h @@ -85,21 +85,21 @@ class FEQ1 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -114,7 +114,7 @@ class FEQ1 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: @@ -262,21 +262,21 @@ class FEQ2 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -291,7 +291,7 @@ class FEQ2 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: @@ -383,21 +383,21 @@ class FEQ3 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -412,7 +412,7 @@ class FEQ3 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: @@ -506,21 +506,21 @@ class FEQ4 : public FEQ1Mapping * Refer to the base class for detailed * information on this function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -535,7 +535,7 @@ class FEQ4 : public FEQ1Mapping * costs. The specified exception * is thrown instead. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; private: diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index 123ce93ec0..0d749208a5 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -185,7 +185,7 @@ class FESystem : public FiniteElement * For the ordering of shape functions * refer to the @p{shape_value} function. */ - virtual void get_unit_support_points (std::vector > &support_points) const; + virtual void get_unit_support_points (typename std::vector > &support_points) const; /** * Refer to the base class for detailed @@ -194,15 +194,15 @@ class FESystem : public FiniteElement * For the ordering of shape functions * refer to the @p{shape_value} function. */ - virtual void get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const; + virtual void get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ - virtual void get_face_support_points (const DoFHandler::face_iterator &face, - std::vector > &support_points) const; + virtual void get_face_support_points (const typename DoFHandler::face_iterator &face, + typename std::vector > &support_points) const; /** * Fill the local mass matrix. The elements @@ -248,7 +248,7 @@ class FESystem : public FiniteElement * Refer to the base class for more * information on this function. */ - virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, + virtual void get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const; /** @@ -264,7 +264,7 @@ class FESystem : public FiniteElement * the @p{transform} function of * @p{base_element(0)}. */ - virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, + virtual Point transform_unit_to_real_cell (const typename DoFHandler::cell_iterator &cell, const Point &p) const; /** @@ -280,7 +280,7 @@ class FESystem : public FiniteElement * the @p{transform} function of * @p{base_element(0)}. */ - virtual Point transform_real_to_unit_cell (const DoFHandler::cell_iterator cell, + virtual Point transform_real_to_unit_cell (const typename DoFHandler::cell_iterator &cell, const Point &p) const; /** @@ -316,9 +316,9 @@ class FESystem : public FiniteElement * function simply passes down to the * underlying object. */ - virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const; + virtual void get_face_jacobians (const typename DoFHandler::face_iterator &face, + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const; /** * Refer to the base class for detailed @@ -331,10 +331,10 @@ class FESystem : public FiniteElement * function simply passes down to the * underlying object. */ - virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + virtual void get_subface_jacobians (const typename DoFHandler::face_iterator &face, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const; + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const; /** * Return the normal vectors to the @@ -350,10 +350,10 @@ class FESystem : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const; /** * Return the normal vectors to the @@ -370,29 +370,29 @@ class FESystem : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const; /** * Implementation of the * corresponding function of * @p{FiniteElement}. */ - virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, + virtual void fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grad_transform) const; + const typename std::vector > > &shape_grad_transform) const; /** * Number of different base @@ -449,7 +449,7 @@ class FESystem : public FiniteElement * Pairs of multiplicity and * element type. */ - typedef std::pair *, unsigned int> ElementPair; + typedef typename std::pair *, unsigned int> ElementPair; /** * Pointer to underlying finite @@ -462,7 +462,7 @@ class FESystem : public FiniteElement * created by the constructor and * constant afterwards. */ - std::vector base_elements; + typename std::vector base_elements; /** diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 5489a9011c..58e95d1e26 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -315,7 +315,7 @@ class FEValuesBase */ template void get_function_values (const InputVector &fe_function, - std::vector &values) const; + typename std::vector &values) const; /** * Access to vector valued finite @@ -334,7 +334,7 @@ class FEValuesBase */ template void get_function_values (const InputVector &fe_function, - std::vector > &values) const; + typename std::vector > &values) const; /** * Return the gradient of the @p{i}th shape @@ -359,7 +359,7 @@ class FEValuesBase * For the format of this matrix, see the * documentation for the matrix itself. */ - const std::vector > > & get_shape_grads () const; + const typename std::vector > > & get_shape_grads () const; /** * Return the gradients of the finite @@ -383,7 +383,7 @@ class FEValuesBase */ template void get_function_grads (const InputVector &fe_function, - std::vector > &gradients) const; + typename std::vector > &gradients) const; /** * Return the gradients of the finite @@ -412,7 +412,7 @@ class FEValuesBase */ template void get_function_grads (const InputVector &fe_function, - std::vector > > &gradients) const; + typename std::vector > > &gradients) const; /** * Return the 2nd derivatives of @@ -445,7 +445,7 @@ class FEValuesBase * documentation for the matrix * itself. */ - const std::vector > > & get_shape_2nd_derivatives () const; + const typename std::vector > > & get_shape_2nd_derivatives () const; /** * Return the tensor of second @@ -466,7 +466,7 @@ class FEValuesBase */ template void get_function_2nd_derivatives (const InputVector &fe_function, - std::vector > &second_derivatives) const; + typename std::vector > &second_derivatives) const; /** @@ -493,7 +493,7 @@ class FEValuesBase */ template void get_function_2nd_derivatives (const InputVector &fe_function, - std::vector > > &second_derivatives) const; + typename std::vector > > &second_derivatives) const; /** * Return the position of the @p{i}th @@ -514,7 +514,7 @@ class FEValuesBase * Return a pointer to the vector of * quadrature points. */ - const std::vector > & get_quadrature_points () const; + const typename std::vector > & get_quadrature_points () const; /** * Return the point in real space where @@ -544,7 +544,7 @@ class FEValuesBase * denoting the location of the trial * functions. */ - const std::vector > & get_support_points () const; + const typename std::vector > & get_support_points () const; /** * Return the Jacobi determinant times @@ -582,7 +582,7 @@ class FEValuesBase /** * Return the present cell. */ - const DoFHandler::cell_iterator & get_cell() const; + const typename DoFHandler::cell_iterator & get_cell() const; /** * Determine an estimate for the @@ -657,7 +657,7 @@ class FEValuesBase * gradients on the real element, rather * than on the reference element. */ - std::vector > > shape_gradients; + typename std::vector > > shape_gradients; /** * Store the 2nd derivatives of the shape @@ -668,7 +668,7 @@ class FEValuesBase * gradients on the real element, rather * than on the reference element. */ - std::vector > > shape_2nd_derivatives; + typename std::vector > > shape_2nd_derivatives; /** * Store an array of the weights of the @@ -702,7 +702,7 @@ class FEValuesBase * real element, rather than on the * reference element. */ - std::vector > quadrature_points; + typename std::vector > quadrature_points; /** * Array of points denoting the off-point @@ -711,7 +711,7 @@ class FEValuesBase * on the unit cell, so no function is * provided for this). */ - std::vector > support_points; + typename std::vector > support_points; /** * Store the jacobi matrices at the @@ -726,7 +726,7 @@ class FEValuesBase * transformation of the gradients to the * real cell. */ - std::vector > jacobi_matrices; + typename std::vector > jacobi_matrices; /** * Store the derivatives of the jacobi @@ -739,7 +739,7 @@ class FEValuesBase * The same general remarks apply as for * @p{jacobi_matrices}. */ - std::vector > jacobi_matrices_grad; + typename std::vector > jacobi_matrices_grad; /** * Store the values of the basis functions @@ -785,7 +785,7 @@ class FEValuesBase * to the @p{get_function_*} functions * safer. */ - DoFHandler::cell_iterator present_cell; + typename DoFHandler::cell_iterator present_cell; /** * Store the finite element for later use. @@ -876,7 +876,7 @@ class FEValues : public FEValuesBase * of the object and contains the gradients * on the reference element. */ - std::vector > > unit_shape_gradients; + typename std::vector > > unit_shape_gradients; /** * Store the 2nd derivatives of the shape @@ -886,7 +886,7 @@ class FEValues : public FEValuesBase * of the object and contains the * derivatives on the reference element. */ - std::vector > > unit_shape_2nd_derivatives; + typename std::vector > > unit_shape_2nd_derivatives; /** * Gradients of the basis @@ -894,7 +894,7 @@ class FEValues : public FEValuesBase * Analogous to the @p{shape_values_transform} * array of the base class. */ - std::vector > > unit_shape_gradients_transform; + typename std::vector > > unit_shape_gradients_transform; /** * Array of quadrature points in the unit @@ -902,7 +902,7 @@ class FEValues : public FEValuesBase * construction and contains the quadrature * points on the reference element. */ - std::vector > unit_quadrature_points; + typename std::vector > unit_quadrature_points; }; @@ -1016,13 +1016,13 @@ class FEFaceValuesBase : public FEValuesBase * vectors to the cell at the * quadrature points. */ - const std::vector > & get_normal_vectors () const; + const typename std::vector > & get_normal_vectors () const; /** * Return the present * face. */ - DoFHandler::face_iterator get_face() const; + typename DoFHandler::face_iterator get_face() const; /** * Determine an estimate for the @@ -1045,7 +1045,7 @@ class FEFaceValuesBase : public FEValuesBase * subface, with indices like that: * @p{unit_shape_gradients[face][dof][q_point]} */ - std::vector > > > unit_shape_gradients; + typename std::vector > > > unit_shape_gradients; /** * Store the 2nd derivatives of the shape @@ -1055,7 +1055,7 @@ class FEFaceValuesBase : public FEValuesBase * of the object and contains the * derivatives on the reference element. */ - std::vector > > > unit_shape_2nd_derivatives; + typename std::vector > > > unit_shape_2nd_derivatives; /** * Gradients of the basis @@ -1063,7 +1063,7 @@ class FEFaceValuesBase : public FEValuesBase * Analogous to the @p{shape_values_transform} * array of the base class. */ - std::vector > > > unit_shape_gradients_transform; + typename std::vector > > > unit_shape_gradients_transform; /** * Array of quadrature points on the @@ -1071,7 +1071,7 @@ class FEFaceValuesBase : public FEValuesBase * alike field of the quadrature formula * passed upon construction. */ - std::vector > unit_face_quadrature_points; + typename std::vector > unit_face_quadrature_points; /** * Array of quadrature points in the unit @@ -1084,7 +1084,7 @@ class FEFaceValuesBase : public FEValuesBase * those on the unit face, but are stored * as coordinates on the unit cell. */ - std::vector > > unit_quadrature_points; + typename std::vector > > unit_quadrature_points; /** * List of values denoting the determinant @@ -1099,7 +1099,7 @@ class FEFaceValuesBase : public FEValuesBase * quadrature points. This field is filled * in by the finite element class. */ - std::vector > normal_vectors; + typename std::vector > normal_vectors; /** * Stores the face or subface, @@ -1108,7 +1108,7 @@ class FEFaceValuesBase : public FEValuesBase * function was called. Is used * by the @p{get_face} function. */ - DoFHandler::face_iterator present_face; + typename DoFHandler::face_iterator present_face; }; @@ -1348,7 +1348,7 @@ const FullMatrix & FEValuesBase::get_shape_values () const template inline -const std::vector > > & +const typename std::vector > > & FEValuesBase::get_shape_grads () const { Assert (update_flags & update_gradients, ExcAccessToUninitializedField()); @@ -1359,7 +1359,7 @@ FEValuesBase::get_shape_grads () const template inline -const std::vector > > & +const typename std::vector > > & FEValuesBase::get_shape_2nd_derivatives () const { Assert (update_flags & update_second_derivatives, ExcAccessToUninitializedField()); @@ -1370,7 +1370,7 @@ FEValuesBase::get_shape_2nd_derivatives () const template inline -const std::vector > & +const typename std::vector > & FEValuesBase::get_quadrature_points () const { Assert (update_flags & update_q_points, ExcAccessToUninitializedField()); @@ -1381,7 +1381,7 @@ FEValuesBase::get_quadrature_points () const template inline -const std::vector > & +const typename std::vector > & FEValuesBase::get_support_points () const { Assert (update_flags & update_support_points, ExcAccessToUninitializedField()); @@ -1413,7 +1413,7 @@ FEValuesBase::get_fe () const template inline -const DoFHandler::cell_iterator & +const typename DoFHandler::cell_iterator & FEValuesBase::get_cell() const { return present_cell; @@ -1423,7 +1423,7 @@ FEValuesBase::get_cell() const template inline -const std::vector > & +const typename std::vector > & FEFaceValuesBase::get_normal_vectors () const { Assert (update_flags & update_normal_vectors, @@ -1432,10 +1432,12 @@ FEFaceValuesBase::get_normal_vectors () const }; + template inline -DoFHandler::face_iterator -FEFaceValuesBase::get_face() const { +typename DoFHandler::face_iterator +FEFaceValuesBase::get_face() const +{ return present_face; }; diff --git a/deal.II/deal.II/include/fe/q1_mapping.h b/deal.II/deal.II/include/fe/q1_mapping.h index 6df25029e8..0951a64ca8 100644 --- a/deal.II/deal.II/include/fe/q1_mapping.h +++ b/deal.II/deal.II/include/fe/q1_mapping.h @@ -53,7 +53,7 @@ class FEQ1Mapping : public FiniteElement * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell (const DoFHandler::cell_iterator cell, + virtual Point transform_unit_to_real_cell (const typename DoFHandler::cell_iterator &cell, const Point &p) const; /** @@ -62,7 +62,7 @@ class FEQ1Mapping : public FiniteElement * @p{p_unit} on the unit cell * @p{cell} and returns @p{p_unit}. */ - virtual Point transform_real_to_unit_cell (const DoFHandler::cell_iterator cell, + virtual Point transform_real_to_unit_cell (const typename DoFHandler::cell_iterator &cell, const Point &p) const; /** @@ -94,8 +94,8 @@ class FEQ1Mapping : public FiniteElement * In two spatial dimensions, this function * simply returns the length of the face. */ - virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const std::vector > &unit_points, + virtual void get_face_jacobians (const typename DoFHandler::face_iterator &face, + const typename std::vector > &unit_points, std::vector &face_jacobi_determinants) const; /** @@ -106,10 +106,10 @@ class FEQ1Mapping : public FiniteElement * simply returns half the length of the * whole face. */ - virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + virtual void get_subface_jacobians (const typename DoFHandler::face_iterator &face, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const; + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const; /** * Return the normal vectors to the @@ -125,10 +125,10 @@ class FEQ1Mapping : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const; /** * Return the normal vectors to the @@ -145,11 +145,11 @@ class FEQ1Mapping : public FiniteElement * Refer to the base class for detailed * information on this function. */ - virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + virtual void get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const; + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const; /** * Refer to the base class for detailed @@ -161,18 +161,18 @@ class FEQ1Mapping : public FiniteElement * For higher dimensional finite elements * we use multilinear mappings. */ - virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, + virtual void fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grad_transform) const; + const typename std::vector > > &shape_grad_transform) const; /** * Compute the gradients of the jacobian @@ -180,9 +180,9 @@ class FEQ1Mapping : public FiniteElement * and real cell at the given * points on the unit cell. */ - static void compute_jacobian_gradients (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians); + static void compute_jacobian_gradients (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians); /** diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index c5f7031b74..afc3c34007 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -33,35 +33,35 @@ * * @author Wolfgang Bangerth, Guido Kanschat, 1998, 1999 */ -template +template struct GeometryInfo { /** * Present dimension. Does not * look useful, but might be. */ - static const unsigned int dim = _dim; + static const unsigned int dim = dim_; /** * Number of children a cell has. */ - static const unsigned int children_per_cell = (1<<_dim); + static const unsigned int children_per_cell = (1<::children_per_cell; + static const unsigned int subfaces_per_face = GeometryInfo::children_per_cell; /** * Number of vertices a cell has. */ - static const unsigned int vertices_per_cell = (1<<_dim); + static const unsigned int vertices_per_cell = (1<::vertices_per_cell; + static const unsigned int vertices_per_face = GeometryInfo::vertices_per_cell; /** * Number of lines each face has. */ - static const unsigned int lines_per_face = GeometryInfo<_dim-1>::lines_per_cell; + static const unsigned int lines_per_face = GeometryInfo::lines_per_cell; /** * Number of quads on each face. */ - static const unsigned int quads_per_face = GeometryInfo<_dim-1>::quads_per_cell; + static const unsigned int quads_per_face = GeometryInfo::quads_per_cell; /** * Number of lines of a cell. @@ -101,16 +101,16 @@ struct GeometryInfo * hypercube and the copy by * lines. */ - static const unsigned int lines_per_cell = (2*GeometryInfo::lines_per_cell - + GeometryInfo::vertices_per_cell); + static const unsigned int lines_per_cell = (2*GeometryInfo::lines_per_cell + + GeometryInfo::vertices_per_cell); /** * Number of quadrilaterals of a cell. * * Computation is analogous to @p{lines_per_cell}. */ - static const unsigned int quads_per_cell = (2*GeometryInfo::quads_per_cell - + GeometryInfo::lines_per_cell); + static const unsigned int quads_per_cell = (2*GeometryInfo::quads_per_cell + + GeometryInfo::lines_per_cell); /** * Number of hexahedra of a cell. @@ -120,8 +120,8 @@ struct GeometryInfo * important for more than three * dimensions! */ - static const unsigned int hexes_per_cell = (2*GeometryInfo::hexes_per_cell - + GeometryInfo::quads_per_cell); + static const unsigned int hexes_per_cell = (2*GeometryInfo::hexes_per_cell + + GeometryInfo::quads_per_cell); /** * List of numbers which is @@ -174,7 +174,6 @@ struct GeometryInfo */ static unsigned int child_cell_on_face (unsigned int face, unsigned int subface); - }; diff --git a/deal.II/deal.II/include/grid/grid_in.h b/deal.II/deal.II/include/grid/grid_in.h index 8962f5fce9..10c42a6b13 100644 --- a/deal.II/deal.II/include/grid/grid_in.h +++ b/deal.II/deal.II/include/grid/grid_in.h @@ -256,9 +256,9 @@ class GridIn * have to eliminate unused * vertices beforehand. */ - static void delete_unused_vertices (std::vector > &vertices, - std::vector > &cells, - SubCellData &subcelldata); + static void delete_unused_vertices (typename std::vector > &vertices, + typename std::vector > &cells, + SubCellData &subcelldata); /** * This function can write the @@ -305,9 +305,9 @@ class GridIn * without further ado by the * user. */ - static void debug_output_grid (const std::vector > &cells, - const std::vector > &vertices, - std::ostream &out); + static void debug_output_grid (const typename std::vector > &cells, + const typename std::vector > &vertices, + std::ostream &out); }; diff --git a/deal.II/deal.II/include/grid/grid_reordering.h b/deal.II/deal.II/include/grid/grid_reordering.h index 5a3801701e..2d200b61b7 100644 --- a/deal.II/deal.II/include/grid/grid_reordering.h +++ b/deal.II/deal.II/include/grid/grid_reordering.h @@ -525,7 +525,7 @@ class GridReordering : private GridReorderingInfo * general documentation of this * class. */ - static void reorder_cells (std::vector > &original_cells); + static void reorder_cells (typename std::vector > &original_cells); private: @@ -681,7 +681,7 @@ class GridReordering : private GridReorderingInfo * @p{adjacent_cells} field * of the inserted faces. */ - void insert_faces (std::map &global_faces); + void insert_faces (typename std::map &global_faces); /** * Find out the neighbors of the @@ -754,9 +754,11 @@ class GridReordering : private GridReorderingInfo { /** * Indices of the vertices of - * this face. + * this face. The size of the array + * is equal to + * @p{GeometryInfo::vertices_per_face}. */ - unsigned int vertices[GeometryInfo::vertices_per_face]; + unsigned int vertices[1<<(dim-1)]; /** * Comparison operator. Use @@ -868,12 +870,12 @@ class GridReordering : private GridReorderingInfo * as recursive calls but rather * as eliminated tail-recursion. */ - static void track_back (std::vector &cells, - RotationStack &rotation_states, - const unsigned int track_back_to_cell); + static void track_back (typename std::vector &cells, + RotationStack &rotation_states, + const unsigned int track_back_to_cell); - static bool try_rotate_single_neighbors (std::vector &cells, - RotationStack &rotation_states); + static bool try_rotate_single_neighbors (typename std::vector &cells, + RotationStack &rotation_states); /** * This is the main function that @@ -892,9 +894,9 @@ class GridReordering : private GridReorderingInfo * between original cells and * presorted cells. */ - static void find_reordering (std::vector &cells, - std::vector > &original_cells, - const std::vector &new_cell_numbers); + static void find_reordering (typename std::vector &cells, + typename std::vector > &original_cells, + const std::vector &new_cell_numbers); /** * Preorder the incoming cells by @@ -909,8 +911,25 @@ class GridReordering : private GridReorderingInfo */ static std::vector - presort_cells (std::vector &cells, - std::map &faces); + presort_cells (typename std::vector &cells, + typename std::map &faces); + + /** + * By the resolution of Defect + * Report 45 to the ISO C++ 1998 + * standard, nested classes + * automatically have access to + * members of the enclosing + * class. Nevertheless, some + * compilers don't implement this + * resolution yet, so we have to + * make them @p{friend}, which + * doesn't hurt on the other + * compilers as well. + */ + friend class Cell; + friend class Face; + friend class FaceData; }; diff --git a/deal.II/deal.II/include/grid/intergrid_map.h b/deal.II/deal.II/include/grid/intergrid_map.h index 9e5d103808..1f8856da63 100644 --- a/deal.II/deal.II/include/grid/intergrid_map.h +++ b/deal.II/deal.II/include/grid/intergrid_map.h @@ -13,7 +13,8 @@ #ifndef __deal2__intergrid_map_h #define __deal2__intergrid_map_h -template class SmartPointer; +#include + /** * This class provides a map between two grids which are derived from @@ -200,7 +201,7 @@ class InterGridMap * The actual data. Hold one iterator * for each cell on each level. */ - std::vector > mapping; + typename std::vector > mapping; /** * Store a pointer to the source grid. diff --git a/deal.II/deal.II/include/grid/persistent_tria.h b/deal.II/deal.II/include/grid/persistent_tria.h index 08fe0b2fb3..93fc28e7c1 100644 --- a/deal.II/deal.II/include/grid/persistent_tria.h +++ b/deal.II/deal.II/include/grid/persistent_tria.h @@ -180,9 +180,9 @@ class PersistentTriangulation : public Triangulation * is not useful in the context of this * class. */ - virtual void create_triangulation (const std::vector > &vertices, - const std::vector > &cells, - const SubCellData &subcelldata); + virtual void create_triangulation (const typename std::vector > &vertices, + const typename std::vector > &cells, + const SubCellData &subcelldata); /** * Writes all refine and coarsen diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 758e6e5b91..a32a5b9ce2 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1818,9 +1818,9 @@ class Triangulation : public TriaDimensionInfo, * and the @ref{GridIn} and * @ref{GridReordering} class. */ - virtual void create_triangulation (const std::vector > &vertices, - const std::vector > &cells, - const SubCellData &subcelldata); + virtual void create_triangulation (const typename std::vector > &vertices, + const typename std::vector > &cells, + const SubCellData &subcelldata); /** * Distort the grid by randomly @@ -3109,13 +3109,13 @@ class Triangulation : public TriaDimensionInfo, * * Usage is like @p{levels[3]->quads}. */ - std::vector*> levels; + typename std::vector*> levels; /** * Array of the vertices of this * triangulation. */ - std::vector > vertices; + typename std::vector > vertices; /** * Array storing a bit-pattern which diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index 80423dc426..6553bfbe23 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -903,32 +903,39 @@ TriaObjectAccessor::operator -- () template <> inline TriaIterator<1,TriaObjectAccessor<0, 1> > -CellAccessor<1>::face (const unsigned int) const { - Assert (false, ExcNotUsefulForThisDimension()); +CellAccessor<1>::face (const unsigned int) const +{ + Assert (false, TriaAccessor<1>::ExcNotUsefulForThisDimension()); return TriaIterator<1,TriaObjectAccessor<0, 1> >(); }; + template <> inline Triangulation<2>::face_iterator -CellAccessor<2>::face (const unsigned int i) const { +CellAccessor<2>::face (const unsigned int i) const +{ return line(i); }; + template <> inline Triangulation<3>::face_iterator -CellAccessor<3>::face (const unsigned int i) const { - return quad(i); +CellAccessor<3>::face (const unsigned int i) const +{ + return this->quad(i); }; + template inline int -CellAccessor::neighbor_index (const unsigned int i) const { +CellAccessor::neighbor_index (const unsigned int i) const +{ Assert (i::faces_per_cell, typename TriaAccessor::ExcInvalidNeighbor(i)); return tria->levels[present_level]-> diff --git a/deal.II/deal.II/include/grid/tria_iterator.h b/deal.II/deal.II/include/grid/tria_iterator.h index ab4e3d27b2..517d08f1cb 100644 --- a/deal.II/deal.II/include/grid/tria_iterator.h +++ b/deal.II/deal.II/include/grid/tria_iterator.h @@ -222,7 +222,12 @@ template class Triangulation; * @author Wolfgang Bangerth, 1998 */ template -class TriaRawIterator : public std::bidirectional_iterator +class TriaRawIterator : +#ifdef HAVE_STD_ITERATOR_CLASS + public std::iterator +#else + bidirectional_iterator +#endif { public: /** diff --git a/deal.II/deal.II/include/multigrid/mg_base.h b/deal.II/deal.II/include/multigrid/mg_base.h index a20621390a..1112e64a99 100644 --- a/deal.II/deal.II/include/multigrid/mg_base.h +++ b/deal.II/deal.II/include/multigrid/mg_base.h @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -103,7 +104,7 @@ class MGLevelObject : public Subscriptor /** * Array of the objects to be held. */ - std::vector objects; + typename std::vector objects; }; diff --git a/deal.II/deal.II/include/multigrid/mg_dof_handler.h b/deal.II/deal.II/include/multigrid/mg_dof_handler.h index 00795b8217..a710a23182 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_handler.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_handler.h @@ -944,7 +944,7 @@ class MGDoFHandler : public DoFHandler * numbers which start from zero on each * level. */ - std::vector*> mg_levels; + typename std::vector*> mg_levels; /** * For each vertex there is a list of @@ -952,7 +952,7 @@ class MGDoFHandler : public DoFHandler * on the different levels it lives on and * which are these levels. */ - std::vector mg_vertex_dofs; + typename std::vector mg_vertex_dofs; /** * Vectors storing the number of degrees of diff --git a/deal.II/deal.II/include/numerics/assembler.h b/deal.II/deal.II/include/numerics/assembler.h index b9fc284527..b202085dba 100644 --- a/deal.II/deal.II/include/numerics/assembler.h +++ b/deal.II/deal.II/include/numerics/assembler.h @@ -17,6 +17,8 @@ /*---------------------------- problem_assembler.h ---------------------------*/ #include +#include +#include #include #include #include @@ -63,7 +65,7 @@ class Equation virtual void assemble (FullMatrix &cell_matrix, Vector &rhs, const FEValues &fe_values, - const DoFHandler::cell_iterator &cell) const; + const typename DoFHandler::cell_iterator &cell) const; /** * Virtual function which only assembles @@ -80,7 +82,7 @@ class Equation */ virtual void assemble (FullMatrix &cell_matrix, const FEValues &fe_values, - const DoFHandler::cell_iterator &cell) const; + const typename DoFHandler::cell_iterator &cell) const; /** * Virtual function which only assembles @@ -97,7 +99,7 @@ class Equation */ virtual void assemble (Vector &rhs, const FEValues &fe_values, - const DoFHandler::cell_iterator &cell) const; + const typename DoFHandler::cell_iterator &cell) const; /** * Return number of equations for this diff --git a/deal.II/deal.II/include/numerics/base.h b/deal.II/deal.II/include/numerics/base.h index d90acf9957..eb0749e23c 100644 --- a/deal.II/deal.II/include/numerics/base.h +++ b/deal.II/deal.II/include/numerics/base.h @@ -108,7 +108,7 @@ class ProblemBase * See the general documentation of this * class for more detail. */ - typedef std::map*> FunctionMap; + typedef typename std::map*> FunctionMap; /** * Typdedef an iterator which assembles * matrices and vectors. diff --git a/deal.II/deal.II/include/numerics/data_out.h b/deal.II/deal.II/include/numerics/data_out.h index 0d7de82896..19d749fa44 100644 --- a/deal.II/deal.II/include/numerics/data_out.h +++ b/deal.II/deal.II/include/numerics/data_out.h @@ -398,13 +398,13 @@ class DataOut_DoFData : public DataOutInterface * List of data elements with vectors of * values for each degree of freedom. */ - std::vector dof_data; + typename std::vector dof_data; /** * List of data elements with vectors of * values for each cell. */ - std::vector cell_data; + typename std::vector cell_data; /** * This is a list of patches that is @@ -413,7 +413,7 @@ class DataOut_DoFData : public DataOutInterface * in the output routines of the base * classes. */ - std::vector > patches; + typename std::vector > patches; /** * Function by which the base @@ -421,7 +421,7 @@ class DataOut_DoFData : public DataOutInterface * what patches they shall write * to a file. */ - virtual const std::vector > & + virtual const typename std::vector > & get_patches () const; /** diff --git a/deal.II/deal.II/include/numerics/data_out_faces.h b/deal.II/deal.II/include/numerics/data_out_faces.h index 7fe07ed438..41ef0f91c3 100644 --- a/deal.II/deal.II/include/numerics/data_out_faces.h +++ b/deal.II/deal.II/include/numerics/data_out_faces.h @@ -118,7 +118,7 @@ class DataOutFaces : public DataOut_DoFData * aliased to a name that is * better to type. */ - typedef std::pair::cell_iterator,unsigned int> FaceDescriptor; + typedef typename std::pair::cell_iterator,unsigned int> FaceDescriptor; /** diff --git a/deal.II/deal.II/include/numerics/data_out_stack.h b/deal.II/deal.II/include/numerics/data_out_stack.h index 2625161d09..96354376bb 100644 --- a/deal.II/deal.II/include/numerics/data_out_stack.h +++ b/deal.II/deal.II/include/numerics/data_out_stack.h @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -362,7 +363,7 @@ class DataOutStack : public DataOutInterface * List of patches of all past and * present parameter value data sets. */ - std::vector > patches; + typename std::vector > patches; /** * Structure holding data vectors @@ -393,12 +394,12 @@ class DataOutStack : public DataOutInterface /** * List of DoF data vectors. */ - std::vector dof_data; + typename std::vector dof_data; /** * List of cell data vectors. */ - std::vector cell_data; + typename std::vector cell_data; /** * This is the function through @@ -408,7 +409,7 @@ class DataOutStack : public DataOutInterface * the base class @ref{DataOutBase}) to * the actual output function. */ - virtual const std::vector > & get_patches () const; + virtual const typename std::vector > & get_patches () const; /** diff --git a/deal.II/deal.II/include/numerics/dof_renumbering.h b/deal.II/deal.II/include/numerics/dof_renumbering.h index eb54015e3f..76acef42f0 100644 --- a/deal.II/deal.II/include/numerics/dof_renumbering.h +++ b/deal.II/deal.II/include/numerics/dof_renumbering.h @@ -296,7 +296,7 @@ class DoFRenumbering template static void cell_wise_dg (DoFHandler &dof_handler, - const std::vector::cell_iterator> &cell_order); + const typename std::vector::cell_iterator> &cell_order); /** @@ -307,9 +307,9 @@ class DoFRenumbering */ template static void - cell_wise_dg (MGDoFHandler &dof_handler, - const unsigned int level, - const std::vector::cell_iterator> &cell_order); + cell_wise_dg (MGDoFHandler &dof_handler, + const unsigned int level, + const typename std::vector::cell_iterator> &cell_order); /** diff --git a/deal.II/deal.II/include/numerics/error_estimator.h b/deal.II/deal.II/include/numerics/error_estimator.h index ac602729d2..96f53add2f 100644 --- a/deal.II/deal.II/include/numerics/error_estimator.h +++ b/deal.II/deal.II/include/numerics/error_estimator.h @@ -216,7 +216,7 @@ class KellyErrorEstimator * for each boundary indicator, which is * guaranteed by the @p{map} data type. */ - typedef std::map*> FunctionMap; + typedef typename std::map*> FunctionMap; /** @@ -359,14 +359,14 @@ class KellyErrorEstimator * general documentation of this * class for more information. */ - typedef std::map::face_iterator,std::vector > FaceIntegrals; + typedef typename std::map::face_iterator,std::vector > FaceIntegrals; /** * Redeclare an active cell iterator. * This is simply for convenience. */ - typedef DoFHandler::active_cell_iterator active_cell_iterator; + typedef typename DoFHandler::active_cell_iterator active_cell_iterator; /** @@ -465,18 +465,18 @@ class KellyErrorEstimator * index of the solution * vector. */ - std::vector > > > psi; + typename std::vector > > > psi; /** * The same vector for a neighbor cell */ - std::vector > > > neighbor_psi; + typename std::vector > > > neighbor_psi; /** * The normal vectors of the finite * element function on one face */ - std::vector > normal_vectors; + typename std::vector > normal_vectors; /** * Two arrays needed for the @@ -571,6 +571,21 @@ class KellyErrorEstimator const unsigned int face_no, FEFaceValues &fe_face_values, FESubfaceValues &fe_subface_values); + + /** + * By the resolution of Defect + * Report 45 to the ISO C++ 1998 + * standard, nested classes + * automatically have access to + * members of the enclosing + * class. Nevertheless, some + * compilers don't implement this + * resolution yet, so we have to + * make them @p{friend}, which + * doesn't hurt on the other + * compilers as well. + */ + friend class Data; }; diff --git a/deal.II/deal.II/include/numerics/histogram.h b/deal.II/deal.II/include/numerics/histogram.h index ee4cf459e9..7938f59e0d 100644 --- a/deal.II/deal.II/include/numerics/histogram.h +++ b/deal.II/deal.II/include/numerics/histogram.h @@ -109,10 +109,10 @@ class Histogram * on this. */ template - void evaluate (const std::vector > &values, - const std::vector &y_values, - const unsigned int n_intervals, - const IntervalSpacing interval_spacing = linear); + void evaluate (const typename std::vector > &values, + const std::vector &y_values, + const unsigned int n_intervals, + const IntervalSpacing interval_spacing = linear); /** * This function is only a wrapper diff --git a/deal.II/deal.II/include/numerics/matrices.h b/deal.II/deal.II/include/numerics/matrices.h index 6ce4fecfbb..80d79f36c4 100644 --- a/deal.II/deal.II/include/numerics/matrices.h +++ b/deal.II/deal.II/include/numerics/matrices.h @@ -196,7 +196,7 @@ class MatrixCreator * See the general documentation of this * class for more detail. */ - typedef std::map*> FunctionMap; + typedef typename std::map*> FunctionMap; /** * Assemble the mass matrix. If no diff --git a/deal.II/deal.II/include/numerics/solution_transfer.h b/deal.II/deal.II/include/numerics/solution_transfer.h index fb5f381868..c687d6239d 100644 --- a/deal.II/deal.II/include/numerics/solution_transfer.h +++ b/deal.II/deal.II/include/numerics/solution_transfer.h @@ -202,7 +202,7 @@ class SolutionTransfer * onto the new (refined and/or * coarsenend) grid. */ - void prepare_for_coarsening_and_refinement (const std::vector > &all_in); + void prepare_for_coarsening_and_refinement (const typename std::vector > &all_in); /** * Same as previous function @@ -266,8 +266,8 @@ class SolutionTransfer * several functions can be * performed in one step. */ - void interpolate (const std::vector >&all_in, - std::vector > &all_out) const; + void interpolate (const typename std::vector >&all_in, + typename std::vector > &all_out) const; /** * Same as the previous function. @@ -394,7 +394,7 @@ class SolutionTransfer unsigned int memory_consumption () const; std::vector *indices_ptr; - std::vector > *dof_values_ptr; + typename std::vector > *dof_values_ptr; }; /** @@ -406,7 +406,7 @@ class SolutionTransfer * collecting all these structures in a vector * helps avoiding fraqmentation of the memory. */ - std::vector all_pointerstructs; + typename std::vector all_pointerstructs; /** * Is used for @@ -415,7 +415,7 @@ class SolutionTransfer * of all cells that'll be coarsened * will be stored in this vector. */ - std::vector > > dof_values_on_cell; + typename std::vector > > dof_values_on_cell; }; diff --git a/deal.II/deal.II/include/numerics/vectors.h b/deal.II/deal.II/include/numerics/vectors.h index 04607f1714..7044cca553 100644 --- a/deal.II/deal.II/include/numerics/vectors.h +++ b/deal.II/deal.II/include/numerics/vectors.h @@ -440,7 +440,7 @@ class VectorTools */ template static void project_boundary_values (const DoFHandler &dof, - const std::map*> &boundary_function, + const typename std::map*> &boundary_function, const Quadrature &q, std::map &boundary_values); diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index 419f253434..d7aa8ea17e 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -12,6 +12,10 @@ //---------------------------- dof_accessor.cc --------------------------- +#include +#include +#include + #include #include #include @@ -20,10 +24,6 @@ #include #include -#include -#include -#include - #include @@ -714,7 +714,7 @@ DoFCellAccessor::set_dof_values_by_interpolation (const Vector &loc DoFAccessor::ExcVectorDoesNotMatch()); if (!has_children()) - // if this cell has no children: simply + // if this cell has no children: simply // set the values on this cell set_dof_values (local_values, values); else diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index 2c3046c3b4..eb8b1fa606 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -27,6 +27,13 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template const unsigned int DoFHandler::invalid_dof_index; diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index 817c26896a..ae70b83041 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -30,6 +30,12 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, const bool reversed_numbering, @@ -545,7 +551,7 @@ DoFRenumbering::sort_selected_dofs_back (DoFHandler &dof_handler, template void DoFRenumbering::cell_wise_dg (DoFHandler& dof, - const std::vector::cell_iterator>& cells) + const typename std::vector::cell_iterator>& cells) { Assert(cells.size() == dof.get_tria().n_active_cells(), ExcDimensionMismatch(cells.size(), @@ -599,7 +605,7 @@ template void DoFRenumbering::cell_wise_dg (MGDoFHandler& dof, unsigned int level, - const std::vector::cell_iterator>& cells) + const typename std::vector::cell_iterator>& cells) { Assert(cells.size() == dof.get_tria().n_cells(level), ExcDimensionMismatch(cells.size(), @@ -719,13 +725,6 @@ DoFRenumbering::downstream_dg (MGDoFHandler& dof, } -// for whatever reason, the random_shuffle function used below needs -// lrand48 to be declared (rather than do so itself. however, -// inclusion of or does not help, so we declare -// that function ourselves -extern "C" long int lrand48 (void) throw(); - - template void DoFRenumbering::random (DoFHandler &dof_handler) diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 29f66c3c34..f285723bf1 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -32,6 +32,13 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template void DoFTools::make_sparsity_pattern (const DoFHandler &dof, @@ -174,7 +181,7 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, template void DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, - const DoFHandler::FunctionMap &boundary_indicators, + const typename DoFHandler::FunctionMap &boundary_indicators, const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity) { @@ -922,7 +929,6 @@ DoFTools::extract_hanging_node_dofs (const DoFHandler<1> &dof_handler, #endif - #if deal_II_dimension == 2 template <> diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc index 8c290ea738..9897095c18 100644 --- a/deal.II/deal.II/source/fe/fe.cc +++ b/deal.II/deal.II/source/fe/fe.cc @@ -20,11 +20,31 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + /*------------------------------- FiniteElementData ----------------------*/ template -FiniteElementData::FiniteElementData () +FiniteElementData::FiniteElementData () : + dofs_per_vertex(static_cast(-1)), + dofs_per_line(static_cast(-1)), + dofs_per_quad(static_cast(-1)), + dofs_per_hex(static_cast(-1)), + first_line_index(static_cast(-1)), + first_quad_index(static_cast(-1)), + first_hex_index(static_cast(-1)), + first_face_line_index(static_cast(-1)), + first_face_quad_index(static_cast(-1)), + dofs_per_face(static_cast(-1)), + dofs_per_cell(static_cast(-1)), + transform_functions(static_cast(-1)), + components(static_cast(-1)) { Assert (false, ExcNotImplemented()); }; @@ -143,6 +163,7 @@ bool FiniteElementData::operator== (const FiniteElementData &f) const /*------------------------------- FiniteElementBase ----------------------*/ + template FiniteElementBase::FiniteElementBase (const FiniteElementData &fe_data, const std::vector &restriction_is_additive_flags) : @@ -430,41 +451,41 @@ void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &c template -void FiniteElement::fill_fe_values (const DoFHandler::cell_iterator &, - const std::vector > &, - std::vector > &, +void FiniteElement::fill_fe_values (const typename DoFHandler::cell_iterator &, + const typename std::vector > &, + typename std::vector > &, const bool, - std::vector > &, + typename std::vector > &, const bool, - std::vector > &, + typename std::vector > &, const bool, - std::vector > &, + typename std::vector > &, const bool, const FullMatrix &, - const std::vector > > &) const { + const typename std::vector > > &) const { Assert (false, ExcPureFunctionCalled()); }; template -void FiniteElement::fill_fe_face_values (const DoFHandler::cell_iterator &cell, +void FiniteElement::fill_fe_face_values (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - const std::vector > &global_unit_points, - std::vector > &jacobians, + const typename std::vector > &unit_points, + const typename std::vector > &global_unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, std::vector &face_jacobi_determinants, const bool compute_face_jacobians, - std::vector > &normal_vectors, + typename std::vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const std::vector > > &shape_gradients_transform) const + const typename std::vector > > &shape_gradients_transform) const { Assert (jacobians.size() == unit_points.size(), typename FiniteElementBase::ExcWrongFieldDimension(jacobians.size(), @@ -502,23 +523,23 @@ void FiniteElement::fill_fe_face_values (const DoFHandler::cell_iterat template -void FiniteElement::fill_fe_subface_values (const DoFHandler::cell_iterator &cell, +void FiniteElement::fill_fe_subface_values (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - const std::vector > &global_unit_points, - std::vector > &jacobians, + const typename std::vector > &unit_points, + const typename std::vector > &global_unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, std::vector &face_jacobi_determinants, const bool compute_face_jacobians, - std::vector > &normal_vectors, + typename std::vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const std::vector > > &shape_gradients_transform) const + const typename std::vector > > &shape_gradients_transform) const { Assert (jacobians.size() == unit_points.size(), typename FiniteElementBase::ExcWrongFieldDimension(jacobians.size(), @@ -550,7 +571,7 @@ void FiniteElement::fill_fe_subface_values (const DoFHandler::cell_ite template void -FiniteElement::get_unit_support_points (std::vector > &) const +FiniteElement::get_unit_support_points (typename std::vector > &) const { Assert (false, ExcPureFunctionCalled()); }; @@ -558,8 +579,8 @@ FiniteElement::get_unit_support_points (std::vector > &) const template void -FiniteElement::get_support_points (const DoFHandler::cell_iterator &, - std::vector > &) const +FiniteElement::get_support_points (const typename DoFHandler::cell_iterator &, + typename std::vector > &) const { Assert (false, ExcPureFunctionCalled()); }; diff --git a/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc b/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc index 4198e4fc7f..e74dd30f44 100644 --- a/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc +++ b/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc @@ -13,12 +13,19 @@ #include +#include #include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + /*-----------------------------------2d------------------------------------ Maple script to automate some of the error-prone computations on @@ -568,6 +575,7 @@ FECrissCross<2>::shape_grad_grad (const unsigned int i, template <> void FECrissCross<2>::get_unit_support_points (std::vector > &unit_points) const { Assert(unit_points.size()==dofs_per_cell, + FiniteElementBase<2>:: ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); unit_points[0] = Point<2> (0,0); @@ -584,6 +592,7 @@ void FECrissCross<2>::get_support_points (const DoFHandler<2>::cell_iterator &ce const unsigned int dim = 2; Assert (support_points.size() == dofs_per_cell, + FiniteElementBase<2>:: ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); // copy vertices @@ -621,6 +630,7 @@ void FECrissCross<2>::get_face_support_points (const DoFHandler<2>::face_iterato Assert ((support_points.size() == dofs_per_face) && (support_points.size() == GeometryInfo::vertices_per_face), + FiniteElementBase<2>:: ExcWrongFieldDimension (support_points.size(), GeometryInfo::vertices_per_face)); @@ -633,8 +643,10 @@ template <> void FECrissCross<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &mass_matrix) const { Assert (mass_matrix.n() == dofs_per_cell, + FiniteElementBase<2>:: ExcWrongFieldDimension(mass_matrix.n(),dofs_per_cell)); Assert (mass_matrix.m() == dofs_per_cell, + FiniteElementBase<2>:: ExcWrongFieldDimension(mass_matrix.m(),dofs_per_cell)); const double x[4] = { cell->vertex(0)(0), @@ -794,6 +806,7 @@ void FECrissCross<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &fa // more or less copied from the linear // finite element Assert (unit_points.size() == face_jacobians.size(), + FiniteElementBase<2>:: ExcWrongFieldDimension (unit_points.size(), face_jacobians.size())); // a linear mapping for a single line @@ -815,9 +828,10 @@ void FECrissCross<2>::get_subface_jacobians (const DoFHandler<2>::face_iterator // more or less copied from the linear // finite element Assert (unit_points.size() == face_jacobians.size(), - ExcWrongFieldDimension (unit_points.size(), face_jacobians.size())); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + face_jacobians.size())); Assert (face->at_boundary() == false, - ExcBoundaryFaceUsed ()); + FiniteElement<2>::ExcBoundaryFaceUsed ()); // a linear mapping for a single line // produces particularly simple @@ -838,6 +852,7 @@ void FECrissCross<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &ce // more or less copied from the linear // finite element Assert (unit_points.size() == normal_vectors.size(), + FiniteElementBase<2>:: ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); const DoFHandler<2>::face_iterator face = cell->face(face_no); @@ -872,9 +887,9 @@ void FECrissCross<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &ce // subface have the same direction as that // for the face Assert (unit_points.size() == normal_vectors.size(), - ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); Assert (cell->face(face_no)->at_boundary() == false, - ExcBoundaryFaceUsed ()); + FiniteElement<2>::ExcBoundaryFaceUsed ()); const DoFHandler<2>::face_iterator face = cell->face(face_no); // compute direction of line @@ -897,18 +912,18 @@ void FECrissCross<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &ce template -void FECrissCross::fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, +void FECrissCross::fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &/*shape_grad_transform*/) const { + const typename std::vector > > &/*shape_grad_transform*/) const { Assert (jacobians.size() == unit_points.size(), typename FiniteElementBase::ExcWrongFieldDimension(jacobians.size(), unit_points.size())); @@ -1274,7 +1289,7 @@ Tensor<1,3> FECrissCross<3>::shape_grad_transform (const unsigned int, template Point -FECrissCross::transform_unit_to_real_cell (const typename DoFHandler::cell_iterator, +FECrissCross::transform_unit_to_real_cell (const typename DoFHandler::cell_iterator &, const Point &) const { Assert (false, ExcNotImplemented()); @@ -1285,7 +1300,7 @@ FECrissCross::transform_unit_to_real_cell (const typename DoFHandler:: template Point -FECrissCross::transform_real_to_unit_cell (const typename DoFHandler::cell_iterator, +FECrissCross::transform_real_to_unit_cell (const typename DoFHandler::cell_iterator &, const Point &) const { Assert (false, ExcNotImplemented()); diff --git a/deal.II/deal.II/source/fe/fe_lib.cubic.cc b/deal.II/deal.II/source/fe/fe_lib.cubic.cc index 9dcb745bf4..8563597fa1 100644 --- a/deal.II/deal.II/source/fe/fe_lib.cubic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.cubic.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -916,9 +917,9 @@ template <> void FEQ3<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); const double x[4] = { cell->vertex(0)(0), cell->vertex(1)(0), @@ -943,13 +944,13 @@ void FEQ3<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, which is sufficient since $det J$ is a bilinear function. */ Assert ((-x[0]+x[1])*(-y[0]+y[3])-(-x[0]+x[3])*(-y[0]+y[1]), // xi=eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[0]+y[3])-(-x[0]+x[3])*(y[2]-y[3]), // xi=0, eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[1]+y[2])-(-x[1]+x[2])*(y[2]-y[3]), // xi=eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((-x[0]+x[1])*(-y[1]+y[2])-(-x[1]+x[2])*(-y[0]+y[1]), // xi=1, eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); const double t1 = x[0]-x[1]+x[2]-x[3]; const double t2 = -y[0]+y[1]; @@ -1476,7 +1477,7 @@ void FEQ3<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ3<2>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); unit_points[0] = Point<2>(0,0); unit_points[1] = Point<2>(1,0); @@ -1501,7 +1502,7 @@ template <> void FEQ3<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, - ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); const double x[4] = { cell->vertex(0)(0), cell->vertex(1)(0), @@ -1574,7 +1575,7 @@ template <> void FEQ3<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_face, - ExcWrongFieldDimension (support_points.size(), dofs_per_face)); + FiniteElementBase<2>::ExcWrongFieldDimension (support_points.size(), dofs_per_face)); for (unsigned int vertex=0; vertex<2; ++vertex) support_points[vertex] = face->vertex(vertex); @@ -11384,9 +11385,9 @@ FEQ3<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); throw ExcComputationNotUseful(3); }; @@ -11396,7 +11397,7 @@ template <> void FEQ3<3>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); unit_points[0] = Point<3>(0, 0, 0); unit_points[1] = Point<3>(1, 0, 0); unit_points[2] = Point<3>(1, 0, 1); @@ -11469,7 +11470,7 @@ void FEQ3<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &c std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, - ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); const Point<3> vertices[8] = { cell->vertex(0), cell->vertex(1), @@ -11847,7 +11848,7 @@ void FEQ3<3>::get_face_support_points (const typename DoFHandler<3>::face_iterat std::vector > &support_points) const { Assert (support_points.size() == dofs_per_face, - ExcWrongFieldDimension (support_points.size(), dofs_per_face)); + FiniteElementBase<3>::ExcWrongFieldDimension (support_points.size(), dofs_per_face)); for (unsigned int vertex=0; vertex<2; ++vertex) support_points[vertex] = face->vertex(vertex); diff --git a/deal.II/deal.II/source/fe/fe_lib.dg.cc b/deal.II/deal.II/source/fe/fe_lib.dg.cc index 53a77a5983..eb99cbeed3 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dg.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dg.cc @@ -12,7 +12,15 @@ //---------------------------- fe_lib.dg.cc --------------------------- -#include +#include +#include + + +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + #if deal_II_dimension == 1 @@ -4428,7 +4436,7 @@ FEDG_Q4<3>::FEDG_Q4(): template void FEDG_Q1::get_face_support_points (const typename DoFHandler::face_iterator &, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == 0), FiniteElementBase::ExcWrongFieldDimension (support_points.size(),0)); @@ -4439,7 +4447,7 @@ FEDG_Q1::get_face_support_points (const typename DoFHandler::face_iter template void FEDG_Q2::get_face_support_points (const typename DoFHandler::face_iterator &, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == 0), FiniteElementBase::ExcWrongFieldDimension (support_points.size(),0)); @@ -4450,7 +4458,7 @@ FEDG_Q2::get_face_support_points (const typename DoFHandler::face_iter template void FEDG_Q3::get_face_support_points (const typename DoFHandler::face_iterator &, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == 0), FiniteElementBase::ExcWrongFieldDimension (support_points.size(),0)); @@ -4461,7 +4469,7 @@ FEDG_Q3::get_face_support_points (const typename DoFHandler::face_iter template void FEDG_Q4::get_face_support_points (const typename DoFHandler::face_iterator &, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == 0), FiniteElementBase::ExcWrongFieldDimension (support_points.size(),0)); diff --git a/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc b/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc index 2831962608..dd2484abde 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc @@ -13,11 +13,19 @@ #include +#include #include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template FEDG_Q0::FEDG_Q0 () : @@ -89,7 +97,7 @@ FEDG_Q0::shape_grad_grad (const unsigned int i, template -void FEDG_Q0::get_local_mass_matrix (const DoFHandler::cell_iterator &cell, +void FEDG_Q0::get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, @@ -106,7 +114,7 @@ void FEDG_Q0::get_local_mass_matrix (const DoFHandler::cell_iterator & template void -FEDG_Q0::get_unit_support_points (std::vector > &unit_points) const +FEDG_Q0::get_unit_support_points (typename std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, FiniteElementBase::ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); @@ -119,7 +127,7 @@ FEDG_Q0::get_unit_support_points (std::vector > &unit_points) co template void FEDG_Q0::get_support_points (const typename DoFHandler::cell_iterator &cell, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, FiniteElementBase::ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); @@ -132,7 +140,7 @@ FEDG_Q0::get_support_points (const typename DoFHandler::cell_iterator template void FEDG_Q0::get_face_support_points (const typename DoFHandler::face_iterator &, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == 0), FiniteElementBase::ExcWrongFieldDimension (support_points.size(),0)); diff --git a/deal.II/deal.II/source/fe/fe_lib.dgp1.cc b/deal.II/deal.II/source/fe/fe_lib.dgp1.cc index 736e509414..3dc7209579 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dgp1.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dgp1.cc @@ -13,12 +13,21 @@ #include +#include #include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + + // declare explicit specializations before use: template <> void FEDG_P1::initialize_matrices (); @@ -227,9 +236,11 @@ void FEDG_P1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &, { Assert(false, ExcNotImplemented ()); Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); }; @@ -237,7 +248,8 @@ template <> void FEDG_P1<2>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<2> (.5,.5); unit_points[1] = Point<2> (1,0); @@ -325,9 +337,11 @@ void FEDG_P1<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); throw ExcComputationNotUseful(3); }; @@ -337,7 +351,8 @@ template <> void FEDG_P1<3>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<3> (.5,.5,.5); unit_points[1] = Point<3> (1,0,0); @@ -352,7 +367,7 @@ void FEDG_P1<3>::get_unit_support_points (std::vector > &unit_points) c template void FEDG_P1::get_support_points (const typename DoFHandler::cell_iterator &cell, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, typename FiniteElementBase::ExcWrongFieldDimension (support_points.size(), @@ -366,7 +381,7 @@ FEDG_P1::get_support_points (const typename DoFHandler::cell_iterator template void FEDG_P1::get_face_support_points (const typename DoFHandler::face_iterator &face, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == dofs_per_face) && (support_points.size() == GeometryInfo::vertices_per_face), diff --git a/deal.II/deal.II/source/fe/fe_lib.dgp2.cc b/deal.II/deal.II/source/fe/fe_lib.dgp2.cc index ca22a2d0e5..0a88bb02d2 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dgp2.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dgp2.cc @@ -13,11 +13,19 @@ #include +#include #include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + // declare explicit specializations before use: template <> void FEDG_P2::initialize_matrices (); @@ -216,7 +224,8 @@ template <> void FEDG_P2<2>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<2> (.5,.5); unit_points[1] = Point<2> (1,0); @@ -303,23 +312,29 @@ FEDG_P2<3>::shape_grad_grad (const unsigned int i, }; + template <> void FEDG_P2<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); throw ExcComputationNotUseful(3); }; + template <> -void FEDG_P2<3>::get_unit_support_points (std::vector > &unit_points) const { +void FEDG_P2<3>::get_unit_support_points (std::vector > &unit_points) const +{ Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<3> (.5,.5,.5); unit_points[1] = Point<3> (1,0,0); @@ -334,7 +349,7 @@ void FEDG_P2<3>::get_unit_support_points (std::vector > &unit_points) c template void FEDG_P2::get_support_points (const typename DoFHandler::cell_iterator &cell, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, typename FiniteElementBase::ExcWrongFieldDimension (support_points.size(), @@ -348,7 +363,7 @@ FEDG_P2::get_support_points (const typename DoFHandler::cell_iterator template void FEDG_P2::get_face_support_points (const typename DoFHandler::face_iterator &face, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == dofs_per_face) && (support_points.size() == GeometryInfo::vertices_per_face), diff --git a/deal.II/deal.II/source/fe/fe_lib.dgp3.cc b/deal.II/deal.II/source/fe/fe_lib.dgp3.cc index 1b31baaf1b..ba31d9a3e0 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dgp3.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dgp3.cc @@ -13,11 +13,18 @@ #include +#include #include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + // declare explicit specializations before use: template <> void FEDG_P3::initialize_matrices (); @@ -227,7 +234,8 @@ void FEDG_P3<2>::get_unit_support_points (std::vector > &unit_points) c { Assert(false, ExcNotImplemented ()); Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<2> (.5,.5); unit_points[1] = Point<2> (1,0); @@ -319,18 +327,23 @@ void FEDG_P3<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); throw ExcComputationNotUseful(3); }; + template <> -void FEDG_P3<3>::get_unit_support_points (std::vector > &unit_points) const { +void FEDG_P3<3>::get_unit_support_points (std::vector > &unit_points) const +{ Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<3> (.5,.5,.5); unit_points[1] = Point<3> (1,0,0); @@ -345,7 +358,7 @@ void FEDG_P3<3>::get_unit_support_points (std::vector > &unit_points) c template void FEDG_P3::get_support_points (const typename DoFHandler::cell_iterator &cell, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, typename FiniteElementBase::ExcWrongFieldDimension (support_points.size(), @@ -359,7 +372,7 @@ FEDG_P3::get_support_points (const typename DoFHandler::cell_iterator template void FEDG_P3::get_face_support_points (const typename DoFHandler::face_iterator &face, - std::vector > &support_points) const + typename std::vector > &support_points) const { Assert ((support_points.size() == dofs_per_face) && (support_points.size() == GeometryInfo::vertices_per_face), diff --git a/deal.II/deal.II/source/fe/fe_lib.linear.cc b/deal.II/deal.II/source/fe/fe_lib.linear.cc index 912ac5fcf8..fe33af27b1 100644 --- a/deal.II/deal.II/source/fe/fe_lib.linear.cc +++ b/deal.II/deal.II/source/fe/fe_lib.linear.cc @@ -13,11 +13,19 @@ #include +#include #include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + // declare explicit specializations before use: template <> void FEQ1::initialize_matrices (); @@ -305,9 +313,11 @@ template <> void FEQ1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); /* Get the computation of the local mass matrix by these lines in maple: @@ -355,13 +365,13 @@ void FEQ1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, which is sufficient since $det J$ is a bilinear function. */ Assert ((-x[0]+x[1])*(-y[0]+y[3])-(-x[0]+x[3])*(-y[0]+y[1]), // xi=eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[0]+y[3])-(-x[0]+x[3])*(y[2]-y[3]), // xi=0, eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[1]+y[2])-(-x[1]+x[2])*(y[2]-y[3]), // xi=eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((-x[0]+x[1])*(-y[1]+y[2])-(-x[1]+x[2])*(-y[0]+y[1]), // xi=1, eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); const double t1 = x[1]*y[3], t2 = x[1]*y[2], @@ -409,7 +419,8 @@ void FEQ1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ1<2>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<2> (0,0); unit_points[1] = Point<2> (1,0); @@ -833,20 +844,26 @@ FEQ1<3>::shape_grad_grad (const unsigned int i, template <> void FEQ1<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, - FullMatrix &local_mass_matrix) const { + FullMatrix &local_mass_matrix) const +{ Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); throw ExcComputationNotUseful(3); }; + template <> -void FEQ1<3>::get_unit_support_points (std::vector > &unit_points) const { +void FEQ1<3>::get_unit_support_points (std::vector > &unit_points) const +{ Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<3> (0,0,0); unit_points[1] = Point<3> (1,0,0); @@ -865,7 +882,7 @@ void FEQ1<3>::get_unit_support_points (std::vector > &unit_points) cons template void FEQ1::get_support_points (const typename DoFHandler::cell_iterator &cell, - std::vector > &support_points) const { + typename std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, typename FiniteElementBase::ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); @@ -878,7 +895,7 @@ FEQ1::get_support_points (const typename DoFHandler::cell_iterator &ce template void FEQ1::get_face_support_points (const typename DoFHandler::face_iterator &face, - std::vector > &support_points) const { + typename std::vector > &support_points) const { Assert ((support_points.size() == dofs_per_face) && (support_points.size() == GeometryInfo::vertices_per_face), typename FiniteElementBase:: diff --git a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc index 0e90185a5a..1a9d53bd08 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -805,9 +806,11 @@ void FEQ2<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); /* Get the computation of the local mass matrix by these lines in maple. Note that tphi[i] are the basis function of the linear finite element, which @@ -867,13 +870,13 @@ void FEQ2<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, which is sufficient since $det J$ is a bilinear function. */ Assert ((-x[0]+x[1])*(-y[0]+y[3])-(-x[0]+x[3])*(-y[0]+y[1]), // xi=eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[0]+y[3])-(-x[0]+x[3])*(y[2]-y[3]), // xi=0, eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[1]+y[2])-(-x[1]+x[2])*(y[2]-y[3]), // xi=eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((-x[0]+x[1])*(-y[1]+y[2])-(-x[1]+x[2])*(-y[0]+y[1]), // xi=1, eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); const double t1 = (x[1]*y[0]); const double t2 = (x[1]*y[2]); @@ -1080,7 +1083,8 @@ template <> void FEQ2<2>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<2> (0,0); unit_points[1] = Point<2> (1,0); @@ -1100,7 +1104,8 @@ void FEQ2<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, - ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (support_points.size(), + dofs_per_cell)); for (unsigned int vertex=0; vertex<4; ++vertex) support_points[vertex] = cell->vertex(vertex); @@ -1129,7 +1134,8 @@ void FEQ2<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_face, - ExcWrongFieldDimension (support_points.size(), dofs_per_face)); + FiniteElementBase<2>::ExcWrongFieldDimension (support_points.size(), + dofs_per_face)); for (unsigned int vertex=0; vertex<2; ++vertex) support_points[vertex] = face->vertex(vertex); @@ -2798,9 +2804,11 @@ void FEQ2<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); throw ExcComputationNotUseful(3); }; @@ -2811,7 +2819,8 @@ template <> void FEQ2<3>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<3>(0, 0, 0); unit_points[1] = Point<3>(1, 0, 0); @@ -2849,7 +2858,8 @@ void FEQ2<3>::get_support_points (const DoFHandler<3>::cell_iterator &cell, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_cell, - ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); + FiniteElementBase<3>::ExcWrongFieldDimension (support_points.size(), + dofs_per_cell)); const Point<3> vertices[8] = { cell->vertex(0), cell->vertex(1), @@ -2950,7 +2960,8 @@ void FEQ2<3>::get_face_support_points (const DoFHandler<3>::face_iterator &face, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_face, - ExcWrongFieldDimension (support_points.size(), dofs_per_face)); + FiniteElementBase<3>::ExcWrongFieldDimension (support_points.size(), + dofs_per_face)); for (unsigned int vertex=0; vertex<4; ++vertex) support_points[vertex] = face->vertex(vertex); diff --git a/deal.II/deal.II/source/fe/fe_lib.quartic.cc b/deal.II/deal.II/source/fe/fe_lib.quartic.cc index a492010449..07f3799abc 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quartic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quartic.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -1339,9 +1340,11 @@ template <> void FEQ4<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.n(), + dofs_per_cell)); Assert (local_mass_matrix.m() == dofs_per_cell, - ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension(local_mass_matrix.m(), + dofs_per_cell)); const double x[4] = { cell->vertex(0)(0), cell->vertex(1)(0), @@ -1366,13 +1369,13 @@ void FEQ4<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, which is sufficient since $det J$ is a bilinear function. */ Assert ((-x[0]+x[1])*(-y[0]+y[3])-(-x[0]+x[3])*(-y[0]+y[1]), // xi=eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[0]+y[3])-(-x[0]+x[3])*(y[2]-y[3]), // xi=0, eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((x[2]-x[3])*(-y[1]+y[2])-(-x[1]+x[2])*(y[2]-y[3]), // xi=eta=1 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); Assert ((-x[0]+x[1])*(-y[1]+y[2])-(-x[1]+x[2])*(-y[0]+y[1]), // xi=1, eta=0 - ExcJacobiDeterminantHasWrongSign()); + FiniteElement<2>::ExcJacobiDeterminantHasWrongSign()); const double t1 = -x[0]+x[1]; const double t2 = y[0]-y[1]+y[2]-y[3]; @@ -2603,7 +2606,8 @@ void FEQ4<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ4<2>::get_unit_support_points (std::vector > &unit_points) const { Assert (unit_points.size() == dofs_per_cell, - ExcWrongFieldDimension (unit_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + dofs_per_cell)); unit_points[0] = Point<2>(0,0); unit_points[1] = Point<2>(1,0); @@ -2635,9 +2639,11 @@ void FEQ4<2>::get_unit_support_points (std::vector > &unit_points) cons template <> void FEQ4<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, - std::vector > &support_points) const { + std::vector > &support_points) const +{ Assert (support_points.size() == dofs_per_cell, - ExcWrongFieldDimension (support_points.size(), dofs_per_cell)); + FiniteElementBase<2>::ExcWrongFieldDimension (support_points.size(), + dofs_per_cell)); const double x[4] = { cell->vertex(0)(0), cell->vertex(1)(0), @@ -2745,7 +2751,8 @@ template <> void FEQ4<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face, std::vector > &support_points) const { Assert (support_points.size() == dofs_per_face, - ExcWrongFieldDimension (support_points.size(), dofs_per_face)); + FiniteElementBase<2>::ExcWrongFieldDimension (support_points.size(), + dofs_per_face)); for (unsigned int vertex=0; vertex<2; ++vertex) support_points[vertex] = face->vertex(vertex); diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 9018115f87..a04b42917e 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -14,9 +14,15 @@ #include #include +#include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template @@ -768,7 +774,7 @@ FESystem::shape_grad_grad (const unsigned int i, template void FESystem::get_unit_support_points ( - std::vector > &unit_support_points) const + typename std::vector > &unit_support_points) const { Assert(unit_support_points.size() == dofs_per_cell, typename FiniteElementBase:: @@ -820,8 +826,8 @@ void FESystem::get_unit_support_points ( template -void FESystem::get_support_points (const DoFHandler::cell_iterator &cell, - std::vector > &support_points) const +void FESystem::get_support_points (const typename DoFHandler::cell_iterator &cell, + typename std::vector > &support_points) const { Assert(support_points.size() == dofs_per_cell, typename FiniteElementBase:: @@ -851,8 +857,8 @@ void FESystem::get_support_points (const DoFHandler::cell_iterator &ce template -void FESystem::get_face_support_points (const DoFHandler::face_iterator & face, - std::vector > & support_points) const +void FESystem::get_face_support_points (const typename DoFHandler::face_iterator & face, + typename std::vector > & support_points) const { Assert (support_points.size() == dofs_per_face, typename FiniteElementBase:: @@ -880,7 +886,7 @@ void FESystem::get_face_support_points (const DoFHandler::face_iterato template -void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator &cell, +void FESystem::get_local_mass_matrix (const typename DoFHandler::cell_iterator &cell, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == dofs_per_cell, @@ -927,7 +933,7 @@ void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator template Point FESystem::transform_unit_to_real_cell ( - const DoFHandler::cell_iterator cell, + const typename DoFHandler::cell_iterator &cell, const Point &p) const { return base_elements[0].first->transform_unit_to_real_cell(cell, p); @@ -936,7 +942,7 @@ Point FESystem::transform_unit_to_real_cell ( template Point FESystem::transform_real_to_unit_cell ( - const DoFHandler::cell_iterator cell, + const typename DoFHandler::cell_iterator &cell, const Point &p) const { return base_elements[0].first->transform_real_to_unit_cell(cell, p); @@ -960,9 +966,9 @@ Tensor<1,dim> FESystem::shape_grad_transform (const unsigned int i, template -void FESystem::get_face_jacobians (const DoFHandler::face_iterator &face, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const +void FESystem::get_face_jacobians (const typename DoFHandler::face_iterator &face, + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const { base_elements[0].first->get_face_jacobians (face, unit_points, face_jacobi_determinants); @@ -970,10 +976,10 @@ void FESystem::get_face_jacobians (const DoFHandler::face_iterator &fa template -void FESystem::get_subface_jacobians (const DoFHandler::face_iterator &face, +void FESystem::get_subface_jacobians (const typename DoFHandler::face_iterator &face, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector &face_jacobi_determinants) const + const typename std::vector > &unit_points, + typename std::vector &face_jacobi_determinants) const { base_elements[0].first->get_subface_jacobians (face, subface_no, unit_points, face_jacobi_determinants); @@ -981,10 +987,10 @@ void FESystem::get_subface_jacobians (const DoFHandler::face_iterator template -void FESystem::get_normal_vectors (const DoFHandler::cell_iterator &cell, +void FESystem::get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const { base_elements[0].first->get_normal_vectors (cell, face_no, unit_points, normal_vectors); @@ -992,11 +998,11 @@ void FESystem::get_normal_vectors (const DoFHandler::cell_iterator &ce template -void FESystem::get_normal_vectors (const DoFHandler::cell_iterator &cell, +void FESystem::get_normal_vectors (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, - const std::vector > &unit_points, - std::vector > &normal_vectors) const + const typename std::vector > &unit_points, + typename std::vector > &normal_vectors) const { base_elements[0].first->get_normal_vectors (cell, face_no, subface_no, unit_points, normal_vectors); @@ -1005,18 +1011,18 @@ void FESystem::get_normal_vectors (const DoFHandler::cell_iterator &ce template void -FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, +FESystem::fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grad_transform) const + const typename std::vector > > &shape_grad_transform) const { // if we are to compute the support // points, then we need to get them diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index f72796dc7f..5bac6fe5e9 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -23,6 +23,11 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index c61e3d3966..b23ff72235 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -24,6 +24,12 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + /*------------------------------- FEValuesBase ---------------------------*/ @@ -78,7 +84,7 @@ double FEValuesBase::shape_value (const unsigned int i, template template void FEValuesBase::get_function_values (const InputVector &fe_function, - std::vector &values) const + typename std::vector &values) const { Assert (fe->n_components() == 1, ExcWrongNoOfComponents()); @@ -112,7 +118,7 @@ void FEValuesBase::get_function_values (const InputVector &fe_function, template template void FEValuesBase::get_function_values (const InputVector &fe_function, - std::vector > &values) const + typename std::vector > &values) const { Assert (n_quadrature_points == values.size(), ExcWrongVectorSize(values.size(), n_quadrature_points)); @@ -164,7 +170,7 @@ FEValuesBase::shape_grad (const unsigned int i, template template void FEValuesBase::get_function_grads (const InputVector &fe_function, - std::vector > &gradients) const + typename std::vector > &gradients) const { Assert (fe->n_components() == 1, ExcWrongNoOfComponents()); @@ -199,7 +205,7 @@ void FEValuesBase::get_function_grads (const InputVector &fe_function, template template void FEValuesBase::get_function_grads (const InputVector &fe_function, - std::vector > > &gradients) const + typename std::vector > > &gradients) const { Assert (n_quadrature_points == gradients.size(), ExcWrongNoOfComponents()); @@ -255,7 +261,7 @@ FEValuesBase::shape_2nd_derivative (const unsigned int i, template template void FEValuesBase::get_function_2nd_derivatives (const InputVector &fe_function, - std::vector > &second_derivatives) const + typename std::vector > &second_derivatives) const { Assert (fe->n_components() == 1, ExcWrongNoOfComponents()); @@ -292,7 +298,7 @@ template void FEValuesBase:: get_function_2nd_derivatives (const InputVector &fe_function, - std::vector > > &second_derivs) const + typename std::vector > > &second_derivs) const { Assert (n_quadrature_points == second_derivs.size(), ExcWrongNoOfComponents()); diff --git a/deal.II/deal.II/source/fe/q1_mapping.cc b/deal.II/deal.II/source/fe/q1_mapping.cc index d886e68c31..337a57bc1a 100644 --- a/deal.II/deal.II/source/fe/q1_mapping.cc +++ b/deal.II/deal.II/source/fe/q1_mapping.cc @@ -16,12 +16,20 @@ #include #include #include +#include #include #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + /*---------------------------- FEQ1Mapping ----------------------------------*/ @@ -199,7 +207,8 @@ void FEQ1Mapping<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &fac // more or less copied from the linear // finite element Assert (unit_points.size() == face_jacobians.size(), - ExcWrongFieldDimension (unit_points.size(), face_jacobians.size())); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + face_jacobians.size())); // a linear mapping for a single line // produces particularly simple @@ -220,9 +229,10 @@ void FEQ1Mapping<2>::get_subface_jacobians (const DoFHandler<2>::face_iterator & // more or less copied from the linear // finite element Assert (unit_points.size() == face_jacobians.size(), - ExcWrongFieldDimension (unit_points.size(), face_jacobians.size())); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + face_jacobians.size())); Assert (face->at_boundary() == false, - ExcBoundaryFaceUsed ()); + FiniteElement<2>::ExcBoundaryFaceUsed ()); // a linear mapping for a single line // produces particularly simple @@ -243,7 +253,8 @@ void FEQ1Mapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cel // more or less copied from the linear // finite element Assert (unit_points.size() == normal_vectors.size(), - ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + normal_vectors.size())); const DoFHandler<2>::face_iterator face = cell->face(face_no); // compute direction of line @@ -277,9 +288,10 @@ void FEQ1Mapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cel // subface have the same direction as that // for the face Assert (unit_points.size() == normal_vectors.size(), - ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); + FiniteElementBase<2>::ExcWrongFieldDimension (unit_points.size(), + normal_vectors.size())); Assert (cell->face(face_no)->at_boundary() == false, - ExcBoundaryFaceUsed ()); + FiniteElement<2>::ExcBoundaryFaceUsed ()); const DoFHandler<2>::face_iterator face = cell->face(face_no); // compute direction of line @@ -385,7 +397,8 @@ void FEQ1Mapping<3>::get_face_jacobians (const DoFHandler<3>::face_iterator &fac const std::vector > &unit_points, std::vector &face_jacobians) const { Assert (unit_points.size() == face_jacobians.size(), - ExcWrongFieldDimension (unit_points.size(), face_jacobians.size())); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + face_jacobians.size())); // the computation of the face jacobians is // along the following lines: let x_i be @@ -457,7 +470,8 @@ void FEQ1Mapping<3>::get_subface_jacobians (const DoFHandler<3>::face_iterator & const std::vector > &unit_points, std::vector &face_jacobians) const { Assert (false, - ExcWrongFieldDimension (unit_points.size(), face_jacobians.size())); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + face_jacobians.size())); }; @@ -467,7 +481,8 @@ void FEQ1Mapping<3>::get_normal_vectors (const DoFHandler<3>::cell_iterator &cel const std::vector > &unit_points, std::vector > &normal_vectors) const { Assert (unit_points.size() == normal_vectors.size(), - ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + normal_vectors.size())); // taken from the same script as is // the computation of the jacobian @@ -527,7 +542,8 @@ void FEQ1Mapping<3>::get_normal_vectors (const DoFHandler<3>::cell_iterator &/*c // subface have the same direction as that // for the face Assert (false, - ExcWrongFieldDimension (unit_points.size(), normal_vectors.size())); + FiniteElementBase<3>::ExcWrongFieldDimension (unit_points.size(), + normal_vectors.size())); }; #endif @@ -535,7 +551,7 @@ void FEQ1Mapping<3>::get_normal_vectors (const DoFHandler<3>::cell_iterator &/*c template Point FEQ1Mapping::transform_unit_to_real_cell ( - const DoFHandler::cell_iterator cell, + const typename DoFHandler::cell_iterator &cell, const Point &p) const { Point p_real; @@ -547,7 +563,7 @@ Point FEQ1Mapping::transform_unit_to_real_cell ( template Point FEQ1Mapping::transform_real_to_unit_cell ( - const DoFHandler::cell_iterator cell, + const typename DoFHandler::cell_iterator &cell, const Point &p) const { // Newton iteration to solve @@ -599,18 +615,18 @@ Point FEQ1Mapping::transform_real_to_unit_cell ( template -void FEQ1Mapping::fill_fe_values (const DoFHandler::cell_iterator &cell, - const std::vector > &unit_points, - std::vector > &jacobians, +void FEQ1Mapping::fill_fe_values (const typename DoFHandler::cell_iterator &cell, + const typename std::vector > &unit_points, + typename std::vector > &jacobians, const bool compute_jacobians, - std::vector > &jacobians_grad, + typename std::vector > &jacobians_grad, const bool compute_jacobians_grad, - std::vector > &support_points, + typename std::vector > &support_points, const bool compute_support_points, - std::vector > &q_points, + typename std::vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const std::vector > > &shape_grad_transform) const + const typename std::vector > > &shape_grad_transform) const { Assert ((!compute_jacobians) || (jacobians.size() == unit_points.size()), typename FiniteElementBase::ExcWrongFieldDimension(jacobians.size(), diff --git a/deal.II/deal.II/source/fe/q1_mapping.jacobians.cc b/deal.II/deal.II/source/fe/q1_mapping.jacobians.cc index 683332fee7..505838872d 100644 --- a/deal.II/deal.II/source/fe/q1_mapping.jacobians.cc +++ b/deal.II/deal.II/source/fe/q1_mapping.jacobians.cc @@ -13,6 +13,7 @@ #include +#include #include #include @@ -37,7 +38,8 @@ void FEQ1Mapping<1>::compute_jacobian_gradients (const DoFHandler<1>::cell_itera std::vector > &jacobians_grad) { Assert (unit_points.size() == jacobians_grad.size(), - ExcWrongFieldDimension(jacobians_grad.size(), unit_points.size())); + FiniteElementBase<3>::ExcWrongFieldDimension(jacobians_grad.size(), + unit_points.size())); // derivative of the // jacobian is always zero @@ -58,7 +60,8 @@ void FEQ1Mapping<2>::compute_jacobian_gradients (const DoFHandler<2>::cell_itera std::vector > &jacobians_grad) { Assert (unit_points.size() == jacobians_grad.size(), - ExcWrongFieldDimension(jacobians_grad.size(), unit_points.size())); + FiniteElementBase<2>::ExcWrongFieldDimension(jacobians_grad.size(), + unit_points.size())); const unsigned int dim = 2; @@ -141,7 +144,8 @@ void FEQ1Mapping<3>::compute_jacobian_gradients (const DoFHandler<3>::cell_itera std::vector > &jacobians_grad) { Assert (unit_points.size() == jacobians_grad.size(), - ExcWrongFieldDimension(jacobians_grad.size(), unit_points.size())); + FiniteElementBase<3>::ExcWrongFieldDimension(jacobians_grad.size(), + unit_points.size())); const unsigned int dim = 3; diff --git a/deal.II/deal.II/source/grid/geometry_info.cc b/deal.II/deal.II/source/grid/geometry_info.cc index f4b94fb80f..7b683a8513 100644 --- a/deal.II/deal.II/source/grid/geometry_info.cc +++ b/deal.II/deal.II/source/grid/geometry_info.cc @@ -15,18 +15,11 @@ #include -// egcs 1.1 does not need these definitions of static member -// variables, as later compilers should need. on the other hand, if we -// define them, then egcs1.1 wants initialization, which we would have -// to mirror from the .h file. rather, we omit it here - -#if ! ((__GNUC__==2) && (__GNUC_MINOR__ < 95)) -const unsigned int GeometryInfo::vertices_per_cell; -const unsigned int GeometryInfo::lines_per_cell; -const unsigned int GeometryInfo::quads_per_cell; -const unsigned int GeometryInfo::hexes_per_cell; -const unsigned int GeometryInfo::children_per_cell; -#endif +template <> const unsigned int GeometryInfo::vertices_per_cell; +template <> const unsigned int GeometryInfo::lines_per_cell; +template <> const unsigned int GeometryInfo::quads_per_cell; +template <> const unsigned int GeometryInfo::hexes_per_cell; +template <> const unsigned int GeometryInfo::children_per_cell; template <> diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index cbd0fe50e8..d27ede6514 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -214,17 +214,17 @@ template <> void GridGenerator::hyper_ball<> (Triangulation<2> &tria, const Point<2> &p, const double radius) { - const double a = 1./(1+sqrt(2)); // equilibrate cell sizes at transition + const double a = 1./(1+sqrt(2.0)); // equilibrate cell sizes at transition // from the inner part to the radial // cells - const Point<2> vertices[8] = { p+Point<2>(-1,-1)*(radius/sqrt(2)), - p+Point<2>(+1,-1)*(radius/sqrt(2)), - p+Point<2>(-1,-1)*(radius/sqrt(2)*a), - p+Point<2>(+1,-1)*(radius/sqrt(2)*a), - p+Point<2>(-1,+1)*(radius/sqrt(2)*a), - p+Point<2>(+1,+1)*(radius/sqrt(2)*a), - p+Point<2>(-1,+1)*(radius/sqrt(2)), - p+Point<2>(+1,+1)*(radius/sqrt(2)) }; + const Point<2> vertices[8] = { p+Point<2>(-1,-1)*(radius/sqrt(2.0)), + p+Point<2>(+1,-1)*(radius/sqrt(2.0)), + p+Point<2>(-1,-1)*(radius/sqrt(2.0)*a), + p+Point<2>(+1,-1)*(radius/sqrt(2.0)*a), + p+Point<2>(-1,+1)*(radius/sqrt(2.0)*a), + p+Point<2>(+1,+1)*(radius/sqrt(2.0)*a), + p+Point<2>(-1,+1)*(radius/sqrt(2.0)), + p+Point<2>(+1,+1)*(radius/sqrt(2.0)) }; const int cell_vertices[5][4] = {{0, 1, 3, 2}, {0, 2, 4, 6}, diff --git a/deal.II/deal.II/source/grid/grid_in.cc b/deal.II/deal.II/source/grid/grid_in.cc index 66a3b4d910..9d0f2891fe 100644 --- a/deal.II/deal.II/source/grid/grid_in.cc +++ b/deal.II/deal.II/source/grid/grid_in.cc @@ -20,6 +20,13 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template @@ -405,9 +412,9 @@ void GridIn::skip_comment_lines (std::istream &in, template void -GridIn::delete_unused_vertices (std::vector > &vertices, - std::vector > &cells, - SubCellData &subcelldata) +GridIn::delete_unused_vertices (typename std::vector > &vertices, + typename std::vector > &cells, + SubCellData &subcelldata) { // first check which vertices are // actually used @@ -460,9 +467,9 @@ GridIn::delete_unused_vertices (std::vector > &vertices, template -void GridIn::debug_output_grid (const std::vector > &/*cells*/, - const std::vector > &/*vertices*/, - std::ostream &/*out*/) +void GridIn::debug_output_grid (const typename std::vector > &/*cells*/, + const typename std::vector > &/*vertices*/, + std::ostream &/*out*/) { Assert (false, ExcNotImplemented()); }; diff --git a/deal.II/deal.II/source/grid/grid_refinement.cc b/deal.II/deal.II/source/grid/grid_refinement.cc index fd6ecdf281..9b401846bd 100644 --- a/deal.II/deal.II/source/grid/grid_refinement.cc +++ b/deal.II/deal.II/source/grid/grid_refinement.cc @@ -19,10 +19,11 @@ #include #include #include - -#include +#include #include + + template void GridRefinement::qsort_index(const Vector &a, std::vector &ind, @@ -249,6 +250,10 @@ GridRefinement::refine_and_coarsen_fixed_fraction (Triangulation &tria, +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif template diff --git a/deal.II/deal.II/source/grid/grid_reordering.cc b/deal.II/deal.II/source/grid/grid_reordering.cc index 220b69adfb..97f9034dee 100644 --- a/deal.II/deal.II/source/grid/grid_reordering.cc +++ b/deal.II/deal.II/source/grid/grid_reordering.cc @@ -17,6 +17,12 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + // static variables template <> @@ -77,7 +83,7 @@ unsigned int GridReordering::Cell::count_neighbors () const template void -GridReordering::Cell::insert_faces (std::map &/*global_faces*/) +GridReordering::Cell::insert_faces (typename std::map &/*global_faces*/) { Assert (false, ExcNotImplemented()); }; @@ -692,9 +698,9 @@ GridReordering::FaceData::FaceData () : template inline -void GridReordering::track_back (std::vector &cells, - RotationStack &rotation_states, - unsigned int track_back_to_cell) +void GridReordering::track_back (typename std::vector &cells, + RotationStack &rotation_states, + unsigned int track_back_to_cell) { top_of_function: @@ -766,8 +772,8 @@ void GridReordering::track_back (std::vector &cells, template -bool GridReordering::try_rotate_single_neighbors (std::vector &cells, - RotationStack &rotation_states) +bool GridReordering::try_rotate_single_neighbors (typename std::vector &cells, + RotationStack &rotation_states) { // the rotation state of the cell // which we try to add by rotating @@ -882,9 +888,9 @@ bool GridReordering::try_rotate_single_neighbors (std::vector &cells, template -void GridReordering::find_reordering (std::vector &cells, - std::vector > &original_cells, - const std::vector &new_cell_numbers) +void GridReordering::find_reordering (typename std::vector &cells, + typename std::vector > &original_cells, + const std::vector &new_cell_numbers) { // cout << "Starting..." << flush; @@ -1077,8 +1083,8 @@ void GridReordering::find_reordering (std::vector &cell template std::vector -GridReordering::presort_cells (std::vector &cells, - std::map &faces) +GridReordering::presort_cells (typename std::vector &cells, + typename std::map &faces) { // first find the cell with the // least neighbors @@ -1197,7 +1203,7 @@ GridReordering::presort_cells (std::vector &cells, template -void GridReordering::reorder_cells (std::vector > &original_cells) +void GridReordering::reorder_cells (typename std::vector > &original_cells) { // we need more information than // provided by the input parameter, diff --git a/deal.II/deal.II/source/grid/intergrid_map.cc b/deal.II/deal.II/source/grid/intergrid_map.cc index 6042dde590..b39b094a9d 100644 --- a/deal.II/deal.II/source/grid/intergrid_map.cc +++ b/deal.II/deal.II/source/grid/intergrid_map.cc @@ -13,8 +13,10 @@ #include +#include #include #include +#include #include #include #include diff --git a/deal.II/deal.II/source/grid/persistent_tria.cc b/deal.II/deal.II/source/grid/persistent_tria.cc index b16d233bd0..409f79def2 100644 --- a/deal.II/deal.II/source/grid/persistent_tria.cc +++ b/deal.II/deal.II/source/grid/persistent_tria.cc @@ -18,6 +18,13 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template PersistentTriangulation:: PersistentTriangulation (const Triangulation &coarse_grid) : @@ -95,8 +102,8 @@ PersistentTriangulation::copy_triangulation (const Triangulation &old_ template void -PersistentTriangulation::create_triangulation (const std::vector > &, - const std::vector > &, +PersistentTriangulation::create_triangulation (const typename std::vector > &, + const typename std::vector > &, const SubCellData &) { Assert (false, ExcFunctionNotUseful()); diff --git a/deal.II/deal.II/source/grid/tria.all_dimensions.cc b/deal.II/deal.II/source/grid/tria.all_dimensions.cc index fe4ab6e46b..b44f8ad663 100644 --- a/deal.II/deal.II/source/grid/tria.all_dimensions.cc +++ b/deal.II/deal.II/source/grid/tria.all_dimensions.cc @@ -18,6 +18,7 @@ #include #include +#include #include diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 3150679d4a..aada3a5140 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -1706,6 +1706,12 @@ void Triangulation::refine_global (const unsigned int times) { }; +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template void Triangulation::save_refine_flags (std::vector &v) const { v.resize (n_active_cells(), false); diff --git a/deal.II/deal.II/source/grid/tria_accessor.cc b/deal.II/deal.II/source/grid/tria_accessor.cc index 78e66076bb..05cc141127 100644 --- a/deal.II/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/deal.II/source/grid/tria_accessor.cc @@ -1591,7 +1591,7 @@ bool CellAccessor<2>::at_boundary () const template <> unsigned char CellAccessor<2>::material_id () const { - Assert (used(), ExcCellNotUsed()); + Assert (used(), TriaAccessor<2>::ExcCellNotUsed()); return tria->levels[present_level]->quads.material_id[present_index]; }; @@ -1600,7 +1600,7 @@ unsigned char CellAccessor<2>::material_id () const template <> void CellAccessor<2>::set_material_id (const unsigned char mat_id) const { - Assert (used(), ExcCellNotUsed()); + Assert (used(), TriaAccessor<2>::ExcCellNotUsed()); tria->levels[present_level]->quads.material_id[present_index] = mat_id; }; diff --git a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc index 634acfc8a5..7ed8fde11b 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc @@ -24,6 +24,13 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + /* ------------------------ MGDoFLineAccessor --------------------------- */ template diff --git a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc index de7420b2f4..137bac1ffb 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc @@ -1417,7 +1417,8 @@ void MGDoFHandler<1>::renumber_dofs (const unsigned int level, template <> void MGDoFHandler<2>::renumber_dofs (const unsigned int level, const std::vector &new_numbers) { - Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete()); + Assert (new_numbers.size() == n_dofs(level), + DoFHandler<2>::ExcRenumberingIncomplete()); for (std::vector::iterator i=mg_vertex_dofs.begin(); i!=mg_vertex_dofs.end(); ++i) @@ -1582,8 +1583,8 @@ template <> void MGDoFHandler<2>::reserve_space () { const unsigned int dim = 2; - Assert (selected_fe != 0, ExcNoFESelected()); - Assert (tria->n_levels() > 0, ExcInvalidTriangulation()); + Assert (selected_fe != 0, DoFHandler::ExcNoFESelected()); + Assert (tria->n_levels() > 0, DoFHandler<2>::ExcInvalidTriangulation()); //////////////////////////// // DESTRUCTION diff --git a/deal.II/deal.II/source/multigrid/mg_smoother.cc b/deal.II/deal.II/source/multigrid/mg_smoother.cc index fdc9f3fe19..ce12e5069a 100644 --- a/deal.II/deal.II/source/multigrid/mg_smoother.cc +++ b/deal.II/deal.II/source/multigrid/mg_smoother.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include diff --git a/deal.II/deal.II/source/multigrid/multigrid.cc b/deal.II/deal.II/source/multigrid/multigrid.cc index 140e4e0caf..d72e776c1d 100644 --- a/deal.II/deal.II/source/multigrid/multigrid.cc +++ b/deal.II/deal.II/source/multigrid/multigrid.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include diff --git a/deal.II/deal.II/source/numerics/assembler.cc b/deal.II/deal.II/source/numerics/assembler.cc index 0ef8efff8f..a1001adde3 100644 --- a/deal.II/deal.II/source/numerics/assembler.cc +++ b/deal.II/deal.II/source/numerics/assembler.cc @@ -20,6 +20,11 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template Assembler::AssemblerData::AssemblerData (const DoFHandler &dof, diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc index 83edf66f8e..0c6e160f7d 100644 --- a/deal.II/deal.II/source/numerics/base.cc +++ b/deal.II/deal.II/source/numerics/base.cc @@ -33,6 +33,11 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template ProblemBase::ProblemBase () : diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index 9d8fbdb7a1..aff5d97d6f 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -30,6 +30,13 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + + template DataOut_DoFData::DataEntry:: DataEntry (const Vector *data, @@ -237,7 +244,7 @@ DataOut_DoFData::get_dataset_names () template -const std::vector > & +const typename std::vector > & DataOut_DoFData::get_patches () const { return patches; diff --git a/deal.II/deal.II/source/numerics/data_out_rotation.cc b/deal.II/deal.II/source/numerics/data_out_rotation.cc index a48679065a..2709ad609b 100644 --- a/deal.II/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/deal.II/source/numerics/data_out_rotation.cc @@ -29,6 +29,12 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template diff --git a/deal.II/deal.II/source/numerics/data_out_stack.cc b/deal.II/deal.II/source/numerics/data_out_stack.cc index 84a2f22b55..0bfbd64875 100644 --- a/deal.II/deal.II/source/numerics/data_out_stack.cc +++ b/deal.II/deal.II/source/numerics/data_out_stack.cc @@ -23,6 +23,12 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + template unsigned int @@ -336,7 +342,7 @@ DataOutStack::memory_consumption () const template -const std::vector > & +const typename std::vector > & DataOutStack::get_patches () const { return patches; diff --git a/deal.II/deal.II/source/numerics/derivative_approximation.cc b/deal.II/deal.II/source/numerics/derivative_approximation.cc index 753fc954e9..d8f400fe11 100644 --- a/deal.II/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/deal.II/source/numerics/derivative_approximation.cc @@ -135,7 +135,7 @@ derivative_norm (const Derivative &d) // // if the d_11=a, d_22=b, // d_12=d_21=c - const double radicand = sqr(d[0][0] - d[1][1]) + 4*sqr(d[0][1]); + const double radicand = ::sqr(d[0][0] - d[1][1]) + 4*::sqr(d[0][1]); const double eigenvalues[2] = { 0.5*(d[0][0] + d[1][1] + sqrt(radicand)), 0.5*(d[0][0] + d[1][1] - sqrt(radicand)) }; diff --git a/deal.II/deal.II/source/numerics/error_estimator.cc b/deal.II/deal.II/source/numerics/error_estimator.cc index 6a00f1adcd..a026e12f07 100644 --- a/deal.II/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/deal.II/source/numerics/error_estimator.cc @@ -32,6 +32,11 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + static inline @@ -808,7 +813,7 @@ integrate_over_regular_face (Data &data, for (unsigned int component=0; componentface(neighbor_neighbor)] = face_integral; diff --git a/deal.II/deal.II/source/numerics/histogram.cc b/deal.II/deal.II/source/numerics/histogram.cc index edd6d3a407..47a097d96c 100644 --- a/deal.II/deal.II/source/numerics/histogram.cc +++ b/deal.II/deal.II/source/numerics/histogram.cc @@ -49,10 +49,10 @@ Histogram::Interval::memory_consumption () const template -void Histogram::evaluate (const std::vector > &values, - const std::vector &_y_values, - const unsigned int n_intervals, - const IntervalSpacing interval_spacing) +void Histogram::evaluate (const typename std::vector > &values, + const std::vector &_y_values, + const unsigned int n_intervals, + const IntervalSpacing interval_spacing) { Assert (values.size() > 0, ExcEmptyData()); Assert (n_intervals > 0, ExcInvalidIntervals()); @@ -344,10 +344,10 @@ Histogram::memory_consumption () const // explicit instantiations for float template -void Histogram::evaluate (const std::vector > &values, - const std::vector &y_values, - const unsigned int n_intervals, - const IntervalSpacing interval_spacing); +void Histogram::evaluate (const std::vector > &values, + const std::vector &y_values, + const unsigned int n_intervals, + const IntervalSpacing interval_spacing); template void Histogram::evaluate (const Vector &values, const unsigned int n_intervals, @@ -357,9 +357,9 @@ void Histogram::evaluate (const Vector &values, // explicit instantiations for double template void Histogram::evaluate (const std::vector > &values, - const std::vector &y_values, - const unsigned int n_intervals, - const IntervalSpacing interval_spacing); + const std::vector &y_values, + const unsigned int n_intervals, + const IntervalSpacing interval_spacing); template void Histogram::evaluate (const Vector &values, const unsigned int n_intervals, diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index 448f6bee2b..89092a6808 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -31,6 +31,11 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template void MatrixCreator::create_mass_matrix (const DoFHandler &dof, @@ -1102,7 +1107,7 @@ template void MassMatrix::assemble (FullMatrix &cell_matrix, Vector &rhs, const FEValues &fe_values, - const DoFHandler::cell_iterator &) const + const typename DoFHandler::cell_iterator &) const { Assert (right_hand_side != 0, ExcNoRHSSelected()); @@ -1168,7 +1173,7 @@ void MassMatrix::assemble (FullMatrix &cell_matrix, template void MassMatrix::assemble (Vector &rhs, const FEValues &fe_values, - const DoFHandler::cell_iterator &) const + const typename DoFHandler::cell_iterator &) const { Assert (right_hand_side != 0, ExcNoRHSSelected()); @@ -1213,7 +1218,7 @@ template void LaplaceMatrix::assemble (FullMatrix &cell_matrix, Vector &rhs, const FEValues &fe_values, - const DoFHandler::cell_iterator &) const + const typename DoFHandler::cell_iterator &) const { Assert (right_hand_side != 0, ExcNoRHSSelected()); @@ -1282,7 +1287,7 @@ void LaplaceMatrix::assemble (FullMatrix &cell_matrix, template void LaplaceMatrix::assemble (FullMatrix &cell_matrix, const FEValues &fe_values, - const DoFHandler::cell_iterator &) const + const typename DoFHandler::cell_iterator &) const { const unsigned int dofs_per_cell = fe_values.dofs_per_cell, n_q_points = fe_values.n_quadrature_points; @@ -1338,7 +1343,7 @@ void LaplaceMatrix::assemble (FullMatrix &cell_matrix, template void LaplaceMatrix::assemble (Vector &rhs, const FEValues &fe_values, - const DoFHandler::cell_iterator &) const + const typename DoFHandler::cell_iterator &) const { Assert (right_hand_side != 0, ExcNoRHSSelected()); diff --git a/deal.II/deal.II/source/numerics/solution_transfer.cc b/deal.II/deal.II/source/numerics/solution_transfer.cc index d2ece8e5a8..7e217776bb 100644 --- a/deal.II/deal.II/source/numerics/solution_transfer.cc +++ b/deal.II/deal.II/source/numerics/solution_transfer.cc @@ -22,6 +22,11 @@ #include #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + template SolutionTransfer::SolutionTransfer(const DoFHandler &dof): @@ -146,7 +151,7 @@ void SolutionTransfer::refine_interpolate (Vector &vec) con template void SolutionTransfer:: -prepare_for_coarsening_and_refinement(const std::vector > &all_in) +prepare_for_coarsening_and_refinement(const typename std::vector > &all_in) { Assert(prepared_for!=pure_refinement, ExcAlreadyPrepForRef()); Assert(!prepared_for!=coarsening_and_refinement, @@ -271,8 +276,8 @@ SolutionTransfer::prepare_for_coarsening_and_refinement(const Vecto template void SolutionTransfer:: -interpolate (const std::vector > &all_in, - std::vector > &all_out) const +interpolate (const typename std::vector > &all_in, + typename std::vector > &all_out) const { Assert(prepared_for==coarsening_and_refinement, ExcNotPrepared()); for (unsigned int i=0; i::restore_grid () template static void -mirror_refinement_flags (const Triangulation::cell_iterator &new_cell, - const Triangulation::cell_iterator &old_cell) +mirror_refinement_flags (const typename Triangulation::cell_iterator &new_cell, + const typename Triangulation::cell_iterator &old_cell) { // mirror the refinement // flags from the present time level to @@ -589,8 +589,8 @@ mirror_refinement_flags (const Triangulation::cell_iterator &new_cell, template static bool -adapt_grids (const Triangulation::cell_iterator &cell1, - const Triangulation::cell_iterator &cell2) +adapt_grids (const typename Triangulation::cell_iterator &cell1, + const typename Triangulation::cell_iterator &cell2) { if (cell2->has_children() && cell1->has_children()) diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index ded806891a..e4eafb87f2 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -36,6 +36,12 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG +using namespace std; +#endif + + static inline double sqr (const double x) { return x*x; @@ -711,7 +717,7 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, template void VectorTools::project_boundary_values (const DoFHandler &dof, - const std::map*> &boundary_functions, + const typename std::map*> &boundary_functions, const Quadrature &q, std::map &boundary_values) { diff --git a/deal.II/doc/platforms/ibm_aix_xlc.html b/deal.II/doc/platforms/ibm_aix_xlc.html index e69de29bb2..c5b811bfc2 100644 --- a/deal.II/doc/platforms/ibm_aix_xlc.html +++ b/deal.II/doc/platforms/ibm_aix_xlc.html @@ -0,0 +1,137 @@ + + + + + + The deal.II Readme -- Installation Instructions + + + + + + + +

Installation instructions for IBM AIX using the xlC compiler

+ +

+ First note that deal.II does not yet work with + IBM xlC compiler version 5.0, i.e. the compiler from the Visual + Age for C++ package. We have tried to make it run and have fixed + as many places as possible in order to reduce the number of + errors, but have not been able to work around some problems. +

+ +

+ xlC 5.0 has large problems mainly in the following areas: +

    +
  • + Templatized member functions of classes. We have not been + able to explicitely instantiate them, nor to take the address + of such functions. For example, the following program fails: +

    + +

    + +

    +	 aixterm7:/u/sfb359/q71> cat t.cc
    +	     class X {
    +	       template  void f() {};
    +	       template  void g();
    +	     };
    +
    +	     template  
    +	     void X::g () {
    +	       void (X::*p) () = &X::template f;
    +	     };
    +
    +	     // explicit instantiation
    +	     template void X::g<1> ();
    +	 aixterm7:/u/sfb359/q71> /usr/vacpp/bin/xlC -c t.cc -o /dev/null
    +	     "t.cc", line 8.22: 1540-0130 (S) "X::f" is not declared.
    +	     "t.cc", line 7.6: 1540-0700 (I) The previous message was produced while processing "X::g<1>()".
    +	 
    + +

    + +
  • + A compiler bug prevented us from compiling this snippet: + +

    +	 aixterm7:/u/sfb359/q71> cat t.cc
    +             namespace std {
    +               template                              class allocator {};
    +               template > class vector{};
    +             }
    +
    +             struct X {};
    +             template  void g (const std::vector &x);
    +
    +             void f ()  {
    +               std::vector x;
    +               g<1> (x);
    +             };
    +         aixterm7:/u/sfb359/q71> /usr/vacpp/bin/xlC -c t.cc -o /dev/null
    +             "t.cc", line 11.9: 1540-0130 (S) "allocator" is not declared.
    +             "t.cc", line 11.9: 1540-0700 (I) The previous message was produced while processing "g".
    +	 
    + + This also happens when the first four lines declaring the + namespace std:: are replaced by + #include <vector>. +

    + +
  • + There's another nasty bug that does not allow such code: + +

    +	 aixterm7:/u/sfb359/q71> cat t.cc
    +             #include 
    +             class X{};
    +
    +             void f() {
    +               std::vector v;
    +               std::vector::iterator       i1=v.begin();
    +               std::vector::const_iterator i2=v.begin();
    +               bool x = (i1 != i2);
    +             };
    +         aixterm7:/u/sfb359/q71> /usr/vacpp/bin/xlC -c t.cc -o /dev/null
    +             "t.cc", line 8.16: 1540-0218 (S) The call does not match any parameter list for "operator!=".
    +             "/usr/vacpp/include/xutility", line 247.14: 1540-1283 (I) "std::_Ptrit::operator!=(const _Myt &) const" is not a viable candidate.
    +             "t.cc", line 8.19: 1540-0256 (I) A parameter of type "const std::_Ptrit &" cannot be initialized with an expression of type "std::vector >::const_iterator".
    +             "/usr/vacpp/include/utility", line 59.14: 1540-1283 (I) "template  std::operator!=(const pair<_T1,_T2> &, const pair<_T1,_T2> &)" is not a viable candidate.
    +             "/usr/vacpp/include/xutility", line 362.14: 1540-1283 (I) "template  std::operator!=(const reverse_iterator<_RI> &, const reverse_iterator<_RI> &)" is not a viable candidate.
    +             "/usr/vacpp/include/xutility", line 477.14: 1540-1283 (I) "template  std::operator!=(const istreambuf_iterator<_E,_Tr> &, const istreambuf_iterator<_E,_Tr> &)" is not a viable candidate.
    +             "/usr/vacpp/include/iterator", line 167.14: 1540-1283 (I) "template  std::operator!=(const istream_iterator<_Ty,_E,_Tr,_Dist> &, const istream_iterator<_Ty,_E,_Tr,_Dist> &)" is not a viable candidate.
    +             "/usr/vacpp/include/xmemory", line 127.14: 1540-1283 (I) "template  std::operator!=(const allocator<_Ty> &, const allocator<_U> &)" is not a viable candidate.
    +             "/usr/vacpp/include/vector", line 293.14: 1540-1283 (I) "template  std::operator!=(const vector<_Ty,_A> &, const vector<_Ty,_A> &)" is not a viable candidate.
    +	 
    + +

    + +
  • + Finally, there was a bug (sorry, I can't reproduce it + presently in a small code snippet) which yielded this funny + error message: +

    +	 
    +             "source/dofs/dof_accessor.cc", line 720.80: 1540-0216 (S) An
    +             expression of type "const Vector" cannot be converted to
    +             "const Vector". 
    +	 
    + +

    +
+

+ +

+ At this point, I gave up. In summary, there may have only be half + a dozen bugs in the compiler that were triggered several hundred + times, but as long as these are not fixed in the compiler itself, + I see no way to use xlC for deal.II. Nevertheless, as gcc also + runs on this platform, there is an alternative which you can fall + back on. +

+ + + diff --git a/deal.II/doc/readme.html b/deal.II/doc/readme.html index 7c22ae9516..6d26bb8667 100644 --- a/deal.II/doc/readme.html +++ b/deal.II/doc/readme.html @@ -49,6 +49,9 @@ to Linux on DEC Alpha) and using DEC's cxx compiler version 6.0; +
  • IBM AIX + with IBM'x xlC 5.0 compiler. +
  • Microsoft Windows 95/98/2000/NT. diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index c18e070be7..96de3ac9c2 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -511,7 +511,7 @@ class BlockSparseMatrix : public Subscriptor /** * Array of sub-matrices. */ - std::vector > > > sub_objects; + typename std::vector > > > sub_objects; }; diff --git a/deal.II/lac/include/lac/block_sparse_matrix.templates.h b/deal.II/lac/include/lac/block_sparse_matrix.templates.h index 728e992844..2c0daefb76 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.templates.h @@ -163,7 +163,6 @@ BlockSparseMatrix::get_sparsity_pattern () const }; - template unsigned int BlockSparseMatrix::memory_consumption () const diff --git a/deal.II/lac/include/lac/block_vector.h b/deal.II/lac/include/lac/block_vector.h index 962c99b34a..91019eea36 100644 --- a/deal.II/lac/include/lac/block_vector.h +++ b/deal.II/lac/include/lac/block_vector.h @@ -495,7 +495,7 @@ class BlockVector /** * Pointer to the array of components. */ - std::vector > components; + typename std::vector > components; /** * Object managing the diff --git a/deal.II/lac/include/lac/block_vector.templates.h b/deal.II/lac/include/lac/block_vector.templates.h index 53addc50c7..1c6b6144c7 100644 --- a/deal.II/lac/include/lac/block_vector.templates.h +++ b/deal.II/lac/include/lac/block_vector.templates.h @@ -29,6 +29,11 @@ BlockVector::BlockVector (unsigned int n_blocks, +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG + using namespace std; +#endif + template BlockVector::BlockVector (const std::vector &n) { diff --git a/deal.II/lac/include/lac/precondition_block.h b/deal.II/lac/include/lac/precondition_block.h index a82a4b4a32..27a6b05c47 100644 --- a/deal.II/lac/include/lac/precondition_block.h +++ b/deal.II/lac/include/lac/precondition_block.h @@ -267,7 +267,7 @@ class PreconditionBlock * memory in comparison with * @p{inverse_type=double}. */ - std::vector > var_inverse; + typename std::vector > var_inverse; /** * Storage of the original diagonal blocks. @@ -276,7 +276,7 @@ class PreconditionBlock * * Used by the blocked SSOR method. */ - std::vector > var_diagonal; + typename std::vector > var_diagonal; /** * Flag for diagonal compression. diff --git a/deal.II/lac/include/lac/solver.h b/deal.II/lac/include/lac/solver.h index 0a48074bad..f00ae97489 100644 --- a/deal.II/lac/include/lac/solver.h +++ b/deal.II/lac/include/lac/solver.h @@ -130,7 +130,7 @@ class SolverControl; * * @author Wolfgang Bangerth, Guido Kanschat, Ralf Hartmann, 1997, 1998, 1999 */ -template > +template > class Solver { public: diff --git a/deal.II/lac/include/lac/sparse_vanka.templates.h b/deal.II/lac/include/lac/sparse_vanka.templates.h index d262748974..5f7e58e54d 100644 --- a/deal.II/lac/include/lac/sparse_vanka.templates.h +++ b/deal.II/lac/include/lac/sparse_vanka.templates.h @@ -28,6 +28,12 @@ #include +// if necessary try to work around a bug in the IBM xlC compiler +#ifdef XLC_WORK_AROUND_STD_BUG + using namespace std; +#endif + + template SparseVanka::SparseVanka(const SparseMatrix &M, const std::vector &selected, diff --git a/deal.II/lac/include/lac/vector.h b/deal.II/lac/include/lac/vector.h index b168a51b40..10e2decd66 100644 --- a/deal.II/lac/include/lac/vector.h +++ b/deal.II/lac/include/lac/vector.h @@ -504,28 +504,36 @@ unsigned int Vector::size () const template inline -Vector::iterator Vector::begin () { +typename Vector::iterator +Vector::begin () +{ return &val[0]; }; template inline -Vector::const_iterator Vector::begin () const { +typename Vector::const_iterator +Vector::begin () const +{ return &val[0]; }; template inline -Vector::iterator Vector::end () { +typename Vector::iterator +Vector::end () +{ return &val[dim]; }; template inline -Vector::const_iterator Vector::end () const { +typename Vector::const_iterator +Vector::end () const +{ return &val[dim]; }; diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index 86ea6db1bf..bc3d4d368e 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -203,14 +203,14 @@ Number Vector::norm_sqr () const eptr = ptr + (dim/4)*4; while (ptr!=eptr) { - sum0 += sqr(*ptr++); - sum1 += sqr(*ptr++); - sum2 += sqr(*ptr++); - sum3 += sqr(*ptr++); + sum0 += ::sqr(*ptr++); + sum1 += ::sqr(*ptr++); + sum2 += ::sqr(*ptr++); + sum3 += ::sqr(*ptr++); }; // add up remaining elements while (ptr != end()) - sum0 += sqr(*ptr++); + sum0 += ::sqr(*ptr++); return sum0+sum1+sum2+sum3; }; diff --git a/deal.II/lac/include/lac/vector_memory.h b/deal.II/lac/include/lac/vector_memory.h index 896ea37713..aa7c21f77d 100644 --- a/deal.II/lac/include/lac/vector_memory.h +++ b/deal.II/lac/include/lac/vector_memory.h @@ -16,6 +16,7 @@ #include #include +#include #include @@ -32,7 +33,7 @@ * sophisticated management of vectors. One of these has to be * applied by the user according to his needs. */ -template > +template > class VectorMemory : public Subscriptor { public: @@ -72,7 +73,7 @@ class VectorMemory : public Subscriptor * vectors as needed from the global heap, i.e. performs no * specially adapted actions to the purpose of this class. */ -template > +template > class PrimitiveVectorMemory : public VectorMemory { public: @@ -108,7 +109,7 @@ class PrimitiveVectorMemory : public VectorMemory * * @author Guido Kanschat, 1999 */ -template > +template > class GrowingVectorMemory : public VectorMemory { public: @@ -151,12 +152,12 @@ class GrowingVectorMemory : public VectorMemory * vector is used, second the * vector itself. */ - typedef std::pair entry_type; + typedef typename std::pair entry_type; /** * Array of allocated vectors. */ - std::vector pool; + typename std::vector pool; /** * Overall number of allocations. @@ -168,7 +169,7 @@ class GrowingVectorMemory : public VectorMemory /* --------------------- inline functions ---------------------- */ -template +template GrowingVectorMemory::GrowingVectorMemory(const unsigned int initial_size) : pool(initial_size) { diff --git a/deal.II/lac/source/full_matrix.double.cc b/deal.II/lac/source/full_matrix.double.cc index 199a68311a..af01bed87e 100644 --- a/deal.II/lac/source/full_matrix.double.cc +++ b/deal.II/lac/source/full_matrix.double.cc @@ -107,7 +107,7 @@ FullMatrix::invert (const FullMatrix &M) double* s = new double[dim_range]; double* matrix = new double[dim_range*dim_range]; - copy (&M.val[0], &M.val[dim_image*dim_range], matrix); + std::copy (&M.val[0], &M.val[dim_image*dim_range], matrix); int erg = dgelss_ (&dim_range, &dim_range, &dim_range, @@ -125,9 +125,9 @@ FullMatrix::invert (const FullMatrix &M) // double condition = s[0]/s[dim_range-1]; if (info!=0) - deallog << "inverting error " << info << ' ' << erg << std::endl; + deallog << "inverting error " << info << ' ' << erg << endl; if (rank<(int)dim_range) - deallog << "rank deficiency " << rank << std::endl; + deallog << "rank deficiency " << rank << endl; delete[] work; delete[] s; delete[] matrix; diff --git a/deal.II/lac/source/sparsity_pattern.cc b/deal.II/lac/source/sparsity_pattern.cc index cb90d28264..1d41dfa12f 100644 --- a/deal.II/lac/source/sparsity_pattern.cc +++ b/deal.II/lac/source/sparsity_pattern.cc @@ -19,7 +19,7 @@ #include #include #include - +#include const unsigned int SparsityPattern::invalid_entry; -- 2.39.5