Skip to content
Snippets Groups Projects
Commit 5cf78195 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[patches] adapt patches for the 2.9 release

Dumux 2.9 depends on Dune >= 2.4. Delete obsolete patch for
dune-grid, update the one for dune-istl. Adapt README.
parent accd6377
No related branches found
No related tags found
1 merge request!113[patches] adapt patches for the 2.9 release
...@@ -5,18 +5,9 @@ ...@@ -5,18 +5,9 @@
- If the AMGBackend should be used without SuperLU as coarse grid solver, it can - 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 be benefitial to decrease the corresponding tolerance. To do so, apply the
patch istl-2.3.0.patch in your directory containing patch istl-2.4.1.patch in your directory containing
dune-istl 2.3.0, e.g.: dune-istl 2.4.1, e.g.:
patch -p1 <../dumux/patches/istl-2.3.0.patch patch -p1 <../dumux/patches/istl-2.4.1.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.
- If dune-cornerpoint has to be used for, e.g., employing the CpGridCreator, - 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: and Opm is compiled from source, it might be necessary to patch opm-parser:
......
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/dune/istl/paamg/amg.hh b/dune/istl/paamg/amg.hh 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 --- a/dune/istl/paamg/amg.hh
+++ b/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 // We are still participating on this level
solver_.reset(new BiCGSTABSolver<X>(const_cast<M&>(matrices_->matrices().coarsest().getRedistributed()), solver_.reset(new BiCGSTABSolver<X>(const_cast<M&>(matrices_->matrices().coarsest().getRedistributed()),
*scalarProduct_, *scalarProduct_,
......
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