From 6cc122e2222fd0e34f0cfbd8d5e2c6024a0814c6 Mon Sep 17 00:00:00 2001 From: Christian Engwer <christi@dune-project.org> Date: Fri, 12 Mar 2010 07:39:19 +0000 Subject: [PATCH] revert disable-documentation patch [[Imported from SVN: r5922]] --- doc/doxygen/concepts | 12 ++++++ dune/common/fvector.hh | 12 +++--- dune/common/geometrytype.hh | 75 +++++++++++++++++++-------------- dune/common/mpihelper.hh | 6 +-- dune/common/test/fassigntest.cc | 8 ++-- m4/dune_all.m4 | 2 + m4/dune_docu.m4 | 20 +++++++++ 7 files changed, 91 insertions(+), 44 deletions(-) create mode 100644 doc/doxygen/concepts create mode 100644 m4/dune_docu.m4 diff --git a/doc/doxygen/concepts b/doc/doxygen/concepts new file mode 100644 index 000000000..1e26b1c5f --- /dev/null +++ b/doc/doxygen/concepts @@ -0,0 +1,12 @@ +/** +\namespace STL +\brief <i>preudo namespace</i> for STL concepts +*/ + + +/** +\interface STL::RandomAccessContainer +\brief the STL random-access-container interface + +see http://www.sgi.com/tech/stl/RandomAccessContainer.html . +*/ diff --git a/dune/common/fvector.hh b/dune/common/fvector.hh index 72e5ea75c..759466acf 100644 --- a/dune/common/fvector.hh +++ b/dune/common/fvector.hh @@ -463,16 +463,16 @@ namespace Dune { /** \brief copy constructor */ FieldVector ( const FieldVector &other ) { - // for( size_type i = 0; i < SIZE; ++i ) - // p[ i ] = other[ i ]; - std::memcpy(p,other.p,SIZE*sizeof(K)); + for( size_type i = 0; i < SIZE; ++i ) + p[ i ] = other[ i ]; + // std::memcpy(p,other.p,SIZE*sizeof(K)); } /** \brief Assigment from other vector */ FieldVector& operator= (const FieldVector& other) { - std::memcpy(p,other.p,SIZE*sizeof(K)); - // for (size_type i=0; i<SIZE; i++) - // p[i] = other[i]; + // std::memcpy(p,other.p,SIZE*sizeof(K)); + for (size_type i=0; i<SIZE; i++) + p[i] = other[i]; return *this; } diff --git a/dune/common/geometrytype.hh b/dune/common/geometrytype.hh index b00ce6d14..c7c22974f 100644 --- a/dune/common/geometrytype.hh +++ b/dune/common/geometrytype.hh @@ -162,44 +162,55 @@ namespace Dune { return basicType_ < other.basicType_; } - /** \brief Prints the type to an output stream */ - friend std::ostream& operator<< (std::ostream& s, const GeometryType& a) - { - switch (a.basicType_) { - case simplex : - s << "(simplex, " << a.dim_ << ")"; - break; - case cube : - s << "(cube, " << a.dim_ << ")"; - break; - case pyramid : - s << "pyramid"; - break; - case prism : - s << "prism"; - break; - case none : - s << "(none, " << a.dim_ << ")"; - break; - default : - s << "invalid geometry type"; - } - - return s; - } - + friend inline std::ostream& operator<< (std::ostream& s, const GeometryType& a); }; + /** \brief Prints the type to an output stream */ + inline std::ostream& operator<< (std::ostream& s, const GeometryType& a) + { + switch (a.basicType_) { + case GeometryType::simplex : + s << "(simplex, " << a.dim_ << ")"; + break; + case GeometryType::cube : + s << "(cube, " << a.dim_ << ")"; + break; + case GeometryType::pyramid : + s << "pyramid"; + break; + case GeometryType::prism : + s << "prism"; + break; + case GeometryType::none : + s << "(none, " << a.dim_ << ")"; + break; + default : + s << "invalid geometry type"; + } + return s; + } + /** \brief Prints a GeometryType::BasicType to an output stream */ inline std::ostream& operator<< (std::ostream& s, GeometryType::BasicType type) { switch (type) { - case GeometryType::simplex : s << "simplex"; break; - case GeometryType::cube : s << "cube"; break; - case GeometryType::pyramid : s << "pyramid"; break; - case GeometryType::prism : s << "prism"; break; - case GeometryType::none : s << "none"; break; - default : s << "[unknown GeometryType::BasicType: " << int(type) << "]"; + case GeometryType::simplex : + s << "simplex"; + break; + case GeometryType::cube : + s << "cube"; + break; + case GeometryType::pyramid : + s << "pyramid"; + break; + case GeometryType::prism : + s << "prism"; + break; + case GeometryType::none : + s << "none"; + break; + default : + s << "[unknown GeometryType::BasicType: " << int(type) << "]"; } return s; } diff --git a/dune/common/mpihelper.hh b/dune/common/mpihelper.hh index 8d7d8e80e..a46dfea00 100644 --- a/dune/common/mpihelper.hh +++ b/dune/common/mpihelper.hh @@ -77,7 +77,7 @@ namespace Dune /** * @brief The type of the mpi communicator. */ - typedef int MPICommunicator; + struct MPICommunicator {}; /** * @brief Get the default communicator. @@ -86,7 +86,7 @@ namespace Dune */ static MPICommunicator getCommunicator() { - return -1; + return MPICommunicator(); } static CollectiveCommunication<MPICommunicator> @@ -208,7 +208,7 @@ namespace Dune { rank_ = -1; size_ = -1; - MPI_Init(&argc, &argv); + static int is_initialized = MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD,&rank_); MPI_Comm_size(MPI_COMM_WORLD,&size_); diff --git a/dune/common/test/fassigntest.cc b/dune/common/test/fassigntest.cc index f364558bb..23ab734bd 100644 --- a/dune/common/test/fassigntest.cc +++ b/dune/common/test/fassigntest.cc @@ -5,18 +5,20 @@ #include <iostream> #include <dune/common/fvector.hh> #include <dune/common/fassign.hh> +#include <dune/common/geometrytype.hh> using namespace Dune; int main(int argc, char** argv) try { - Dune::FieldVector<double,3> pos; + Dune::GeometryType t(Dune::GeometryType::cube, 4); + std::cout << t << "\n"; + Dune::FieldVector<double,3> pos; pos <<= 1, 0, 0; + return 0; } catch (Exception e) { - std::cout << e << std::endl; - } diff --git a/m4/dune_all.m4 b/m4/dune_all.m4 index 174aeb7e9..e3b9fd330 100644 --- a/m4/dune_all.m4 +++ b/m4/dune_all.m4 @@ -9,6 +9,8 @@ # dune-directory AC_DEFUN([DUNE_CHECK_ALL],[ + # doxygen and latex take a lot of time... + AC_REQUIRE([DUNE_DOCUMENTATION]) AC_REQUIRE([DUNE_WEB]) AC_ARG_ENABLE(enabledist, diff --git a/m4/dune_docu.m4 b/m4/dune_docu.m4 new file mode 100644 index 000000000..fcacd67fb --- /dev/null +++ b/m4/dune_docu.m4 @@ -0,0 +1,20 @@ +# searches for documentation +AC_DEFUN([DUNE_DOCUMENTATION],[ + + # if dist has been build without + # documentation then disable documentation + # option by default + DOCU_TAG_FILE="no-documentation.tag" + AS_IF([test -f "doc/$DOCU_TAG_FILE"],[ + HAS_DOCUMENTATION="no"],[ + # check whether option is chosen or not + AS_IF([test "x$enable_documentation" != "xno"],[ + HAS_DOCUMENTATION="yes"],[ + HAS_DOCUMENTATION="no" + ]) + ]) + AC_SUBST(DOCUMENTATION_TAG_FILE, $DOCU_TAG_FILE ) + AC_ARG_ENABLE(documentation, + AS_HELP_STRING([--disable-documentation],[don\'t generate docs, speeds up the build])) + AM_CONDITIONAL(BUILD_DOCS, [test "x$HAS_DOCUMENTATION" = "xyes"]) +]) -- GitLab