Skip to content
Snippets Groups Projects
Commit ea5891f1 authored by Christian Engwer's avatar Christian Engwer
Browse files

revert accidential commit... argh\!

[[Imported from SVN: r5923]]
parent 6cc122e2
No related branches found
No related tags found
No related merge requests found
/**
\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 .
*/
...@@ -463,16 +463,16 @@ namespace Dune { ...@@ -463,16 +463,16 @@ namespace Dune {
/** \brief copy constructor */ /** \brief copy constructor */
FieldVector ( const FieldVector &other ) FieldVector ( const FieldVector &other )
{ {
for( size_type i = 0; i < SIZE; ++i ) // for( size_type i = 0; i < SIZE; ++i )
p[ i ] = other[ i ]; // p[ i ] = other[ i ];
// std::memcpy(p,other.p,SIZE*sizeof(K)); std::memcpy(p,other.p,SIZE*sizeof(K));
} }
/** \brief Assigment from other vector */ /** \brief Assigment from other vector */
FieldVector& operator= (const FieldVector& other) { FieldVector& operator= (const FieldVector& other) {
// std::memcpy(p,other.p,SIZE*sizeof(K)); std::memcpy(p,other.p,SIZE*sizeof(K));
for (size_type i=0; i<SIZE; i++) // for (size_type i=0; i<SIZE; i++)
p[i] = other[i]; // p[i] = other[i];
return *this; return *this;
} }
......
...@@ -162,55 +162,44 @@ namespace Dune { ...@@ -162,55 +162,44 @@ namespace Dune {
return basicType_ < other.basicType_; return basicType_ < other.basicType_;
} }
friend inline std::ostream& operator<< (std::ostream& s, const GeometryType& a); /** \brief Prints the type to an output stream */
}; friend std::ostream& operator<< (std::ostream& s, const GeometryType& a)
{
/** \brief Prints the type to an output stream */ switch (a.basicType_) {
inline std::ostream& operator<< (std::ostream& s, const GeometryType& a) case simplex :
{ s << "(simplex, " << a.dim_ << ")";
switch (a.basicType_) { break;
case GeometryType::simplex : case cube :
s << "(simplex, " << a.dim_ << ")"; s << "(cube, " << a.dim_ << ")";
break; break;
case GeometryType::cube : case pyramid :
s << "(cube, " << a.dim_ << ")"; s << "pyramid";
break; break;
case GeometryType::pyramid : case prism :
s << "pyramid"; s << "prism";
break; break;
case GeometryType::prism : case none :
s << "prism"; s << "(none, " << a.dim_ << ")";
break; break;
case GeometryType::none : default :
s << "(none, " << a.dim_ << ")"; s << "invalid geometry type";
break; }
default :
s << "invalid geometry type"; return s;
} }
return s;
} };
/** \brief Prints a GeometryType::BasicType to an output stream */ /** \brief Prints a GeometryType::BasicType to an output stream */
inline std::ostream& operator<< (std::ostream& s, GeometryType::BasicType type) inline std::ostream& operator<< (std::ostream& s, GeometryType::BasicType type)
{ {
switch (type) { switch (type) {
case GeometryType::simplex : case GeometryType::simplex : s << "simplex"; break;
s << "simplex"; case GeometryType::cube : s << "cube"; break;
break; case GeometryType::pyramid : s << "pyramid"; break;
case GeometryType::cube : case GeometryType::prism : s << "prism"; break;
s << "cube"; case GeometryType::none : s << "none"; break;
break; default : s << "[unknown GeometryType::BasicType: " << int(type) << "]";
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; return s;
} }
......
...@@ -77,7 +77,7 @@ namespace Dune ...@@ -77,7 +77,7 @@ namespace Dune
/** /**
* @brief The type of the mpi communicator. * @brief The type of the mpi communicator.
*/ */
struct MPICommunicator {}; typedef int MPICommunicator;
/** /**
* @brief Get the default communicator. * @brief Get the default communicator.
...@@ -86,7 +86,7 @@ namespace Dune ...@@ -86,7 +86,7 @@ namespace Dune
*/ */
static MPICommunicator getCommunicator() static MPICommunicator getCommunicator()
{ {
return MPICommunicator(); return -1;
} }
static CollectiveCommunication<MPICommunicator> static CollectiveCommunication<MPICommunicator>
...@@ -208,7 +208,7 @@ namespace Dune ...@@ -208,7 +208,7 @@ namespace Dune
{ {
rank_ = -1; rank_ = -1;
size_ = -1; size_ = -1;
static int is_initialized = MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rank_); MPI_Comm_rank(MPI_COMM_WORLD,&rank_);
MPI_Comm_size(MPI_COMM_WORLD,&size_); MPI_Comm_size(MPI_COMM_WORLD,&size_);
......
...@@ -5,20 +5,18 @@ ...@@ -5,20 +5,18 @@
#include <iostream> #include <iostream>
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fassign.hh> #include <dune/common/fassign.hh>
#include <dune/common/geometrytype.hh>
using namespace Dune; using namespace Dune;
int main(int argc, char** argv) try int main(int argc, char** argv) try
{ {
Dune::GeometryType t(Dune::GeometryType::cube, 4);
std::cout << t << "\n";
Dune::FieldVector<double,3> pos; Dune::FieldVector<double,3> pos;
pos <<= 1, 0, 0; pos <<= 1, 0, 0;
return 0;
} }
catch (Exception e) { catch (Exception e) {
std::cout << e << std::endl; std::cout << e << std::endl;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment