diff --git a/patches/README b/patches/README index f958447d7ed309ba0c7cb74dc68cc7f5dd609e80..7b4f19c2370ee6818411804ca3249a1129a5f7a0 100644 --- a/patches/README +++ b/patches/README @@ -5,18 +5,9 @@ - If the AMGBackend should be used without SuperLU as coarse grid solver, it can be benefitial to decrease the corresponding tolerance. To do so, apply the - patch istl-2.3.0.patch in your directory containing - dune-istl 2.3.0, e.g.: - patch -p1 <../dumux/patches/istl-2.3.0.patch - -- If UG has been installed for parallel usage, and you want to run a Dumux - multidomain model, you have to patch dune-grid. The patch will introduce - geometries for edges and faces in UG, which need to be present, otherwise the - compiler will complain. Apply the patch grid-2.3.1.patch in your directory - containing dune-grid 2.3.1 by, e.g.: - patch -p1 <../dumux/patches/grid-2.3.1.patch - If you want to use Dune 2.4, the missing functionality is already included, - so the patch is not needed. + patch istl-2.4.1.patch in your directory containing + dune-istl 2.4.1, e.g.: + patch -p1 <../dumux/patches/istl-2.4.1.patch - If dune-cornerpoint has to be used for, e.g., employing the CpGridCreator, and Opm is compiled from source, it might be necessary to patch opm-parser: diff --git a/patches/grid-2.3.1.patch b/patches/grid-2.3.1.patch deleted file mode 100644 index 1f68339c1977909971f22b1b09a09455506902bb..0000000000000000000000000000000000000000 --- a/patches/grid-2.3.1.patch +++ /dev/null @@ -1,197 +0,0 @@ -diff --git a/dune/grid/uggrid/uggridentity.hh b/dune/grid/uggrid/uggridentity.hh -index 4e71316..acadd5d 100644 ---- a/dune/grid/uggrid/uggridentity.hh -+++ b/dune/grid/uggrid/uggridentity.hh -@@ -223,6 +223,8 @@ namespace Dune { - friend class UGGridEntitySeed<codim, GridImp>; - typedef typename GridImp::ctype UGCtype; - -+ typedef typename GridImp::Traits::template Codim<codim>::GeometryImpl GeometryImpl; -+ - public: - - typedef typename GridImp::template Codim<codim>::Geometry Geometry; -@@ -271,6 +273,9 @@ namespace Dune { - //!< Default codim 1 Faces and codim == dim Vertices - template<int cc> int count () const; - -+ //! geometry of this entity -+ Geometry geometry () const { return Geometry( *geo_ ); } -+ - /** \brief Get the seed corresponding to this entity */ - EntitySeed seed () const { return EntitySeed( *this ); } - -@@ -290,6 +295,20 @@ namespace Dune { - /** \brief Set edge object to a UG edge object */ - void setToTarget(typename UG_NS<dim>::template Entity<codim>::T* target, const GridImp* gridImp) { - target_ = target; -+ -+ // obtain the corner coordinates from UG -+ UGCtype* cornerCoords[2*dim]; -+ UG_NS<dim>::Corner_Coordinates(target_, cornerCoords); -+ -+ // convert to the type required by MultiLinearGeometry -+ std::vector<FieldVector<UGCtype, dim> > geometryCoords(2); -+ for(size_t i = 0; i < 2; i++) -+ for (size_t j = 0; j < dim; j++) -+ geometryCoords[i][j] = cornerCoords[i][j]; -+ -+ geo_ = Dune::make_shared<GeometryImpl>(type(), geometryCoords); -+ -+ gridImp_ = gridImp; - } - public: - /** \brief Set edge object to a UG edge object using the center element and the side number -@@ -305,7 +324,14 @@ namespace Dune { - } - - protected: -+ Dune::shared_ptr<GeometryImpl> geo_; -+ - typename UG_NS<dim>::template Entity<codim>::T* target_; -+ -+ /** \brief gridImp Not actually used, only the codim-0 specialization needs it -+ * But code is simpler if we just keep it everywhere. -+ */ -+ const GridImp* gridImp_; - }; - - /*! \brief Specialization for edge in 2D -@@ -332,9 +358,14 @@ namespace Dune { - class UGFaceEntity - { - enum {codim = 1}; -+ typedef typename GridImp::ctype UGCtype; -+ -+ typedef typename GridImp::Traits::template Codim<codim>::GeometryImpl GeometryImpl; - - public: - -+ typedef typename GridImp::template Codim<codim>::Geometry Geometry; -+ - /** \brief Return the entity type identifier */ - GeometryType type() const - { -@@ -403,12 +434,30 @@ namespace Dune { - } - #endif - -+ //! geometry of this entity -+ Geometry geometry () const { return Geometry( *geo_ ); } -+ - /** \brief Set to a UG side vector object - \param target The UG side vector to point to - \param gridImp Dummy argument, only for consistency with codim-0 entities - */ - void setToTarget(typename UG_NS<dim>::template Entity<codim>::T* target, const GridImp* gridImp) { - target_ = target; -+ -+ // obtain the corner coordinates from UG -+ UGCtype* cornerCoords[4*dim]; -+ UG_NS<dim>::Corner_Coordinates(target_, cornerCoords); -+ -+ // convert to the type required by MultiLinearGeometry -+ size_t numCorners = type().isTriangle() ? 3 : 4; -+ std::vector<FieldVector<UGCtype, dim> > geometryCoords(numCorners); -+ for(size_t i = 0; i < numCorners; i++) -+ for (size_t j = 0; j < dim; j++) -+ geometryCoords[i][j] = cornerCoords[i][j]; -+ -+ geo_ = Dune::make_shared<GeometryImpl>(type(), geometryCoords); -+ -+ gridImp_ = gridImp; - } - - typename UG_NS<dim>::template Entity<codim>::T* getTarget() const -@@ -416,9 +465,16 @@ namespace Dune { - return target_; - } - -+protected: -+ Dune::shared_ptr<GeometryImpl> geo_; -+ - /** \brief The UG object (a side vector) that represents this face */ - typename UG_NS<dim>::template Entity<codim>::T* target_; - -+ /** \brief gridImp Not actually used, only the codim-0 specialization needs it -+ * But code is simpler if we just keep it everywhere. -+ */ -+ const GridImp* gridImp_; - }; - - /*! \brief Specialization for faces in 3D -diff --git a/dune/grid/uggrid/uggridgeometry.hh b/dune/grid/uggrid/uggridgeometry.hh -index 26a2f88..079906d 100644 ---- a/dune/grid/uggrid/uggridgeometry.hh -+++ b/dune/grid/uggrid/uggridgeometry.hh -@@ -159,6 +159,26 @@ namespace Dune { - - /****************************************************************/ - /* */ -+ /* Specialization for edges in 3d */ -+ /* */ -+ /****************************************************************/ -+ -+ template<class GridImp> -+ class UGGridGeometry<1, 3, GridImp> : -+ public CachedMultiLinearGeometry<typename GridImp::ctype, 1, 3> -+ { -+ public: -+ -+ /** \brief Constructor from a given geometry type and a vector of corner coordinates */ -+ UGGridGeometry(const GeometryType& type, const std::vector<FieldVector<typename GridImp::ctype,3> >& coordinates) -+ : CachedMultiLinearGeometry<typename GridImp::ctype, 1, 3>(type, coordinates) -+ {} -+ -+ }; -+ -+ -+ /****************************************************************/ -+ /* */ - /* Specialization for faces in 2d */ - /* */ - /****************************************************************/ -diff --git a/dune/grid/uggrid/ugwrapper.hh b/dune/grid/uggrid/ugwrapper.hh -index ac6fd06..57202f1 100644 ---- a/dune/grid/uggrid/ugwrapper.hh -+++ b/dune/grid/uggrid/ugwrapper.hh -@@ -393,7 +393,7 @@ namespace Dune { - return FIRSTELEMENT(grid); - } - -- /** \brief Returns pointers to the coordinate arrays of an UG element */ -+ /** \brief Returns pointers to the coordinate arrays of a UG element */ - static void Corner_Coordinates(const UG_NS< UG_DIM >::Element* theElement, double* x[]) { - using UG_NAMESPACE ::NODE; - using UG_NAMESPACE ::TRIANGLE; -@@ -407,11 +407,29 @@ namespace Dune { - CORNER_COORDINATES(theElement, n, x); - } - -- /** \brief Returns pointers to the coordinate arrays of an UG node */ -+ /** \brief Returns pointers to the coordinate arrays of a UG node */ - static void Corner_Coordinates(const UG_NS< UG_DIM >::Node* theNode, double* x[]) { - x[0] = theNode->myvertex->iv.x; - } - -+ /** \brief Returns pointers to the coordinate arrays of a UG edge */ -+ static void Corner_Coordinates(const UG_NS< UG_DIM >::Edge* theEdge, double* x[]) { -+ x[0] = theEdge->links[0].nbnode->myvertex->iv.x; -+ x[1] = theEdge->links[1].nbnode->myvertex->iv.x; -+ } -+ -+ /** \brief Returns pointers to the coordinate arrays of a UG vector */ -+ static void Corner_Coordinates(const UG_NS< UG_DIM >::Vector* theVector, double* x[]) { -+ typename UG_NS< UG_DIM >::Element* center; -+ unsigned int side; -+ UG_NS< UG_DIM >::GetElementAndSideFromSideVector(theVector, center, side); -+ for (unsigned i = 0; i < Corners_Of_Side(center, side); i++) -+ { -+ unsigned idxInElem = Corner_Of_Side(center, side, i); -+ x[i] = Corner(center, idxInElem)->myvertex->iv.x; -+ } -+ } -+ - static int GlobalToLocal(int n, const double** cornerCoords, - const double* EvalPoint, double* localCoord) { - if (UG_DIM==2) diff --git a/patches/istl-2.3.0.patch b/patches/istl-2.4.1.patch similarity index 93% rename from patches/istl-2.3.0.patch rename to patches/istl-2.4.1.patch index 48833dfcb635ca3c7f143bc0872294e4334eea04..0ff019cc891bcbd5a8a7cc17ed5e902aadc58710 100644 --- a/patches/istl-2.3.0.patch +++ b/patches/istl-2.4.1.patch @@ -1,8 +1,8 @@ diff --git a/dune/istl/paamg/amg.hh b/dune/istl/paamg/amg.hh -index a224b2b..ee48857 100644 +index 56b1d8d..d672756 100644 --- a/dune/istl/paamg/amg.hh +++ b/dune/istl/paamg/amg.hh -@@ -527,13 +527,13 @@ namespace Dune +@@ -526,13 +526,13 @@ namespace Dune // We are still participating on this level solver_.reset(new BiCGSTABSolver<X>(const_cast<M&>(matrices_->matrices().coarsest().getRedistributed()), *scalarProduct_,