Skip to content
Snippets Groups Projects
Commit a1ad2cb0 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[multidomain] Make it work for me, improve documentation.

Improve documentation on how to use the multidomain stuff.
Add patch to make it work without further touching the code.
(reviewed by fetzer, approved by martins)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12666 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent cf6f6a14
No related branches found
No related tags found
No related merge requests found
......@@ -5,13 +5,18 @@ Differences Between DuMuX 2.4 and DuMuX 2.5
* IMPROVEMENTS and ENHANCEMENTS:
- The three-dimensional implementation of the MPFA L-method is made
available for the decoupled compositional 2p2c models. It also allows
available for the decoupled compositional 2p2c models. It also allows
for simulation on an adaptive grid.
- The coupling of 2c2p with Stokes2c and 2c2pNI with Stokes2cNI was
added. Be aware of the harsh version restrictions mentioned in
dumux/test/modelcoupling/README .
* IMMEDIATE INTERFACE CHANGES not allowing/requiring a deprecation period:
- Dropped support for PDELab 1.0.1, PDELab 1.1 is required.
* Deprecated CLASSES/FILES, to be removed after 2.5:
- Stokes2cModel was replaced by StokesNCModel, similar for more
Stokes2c* classes.
* Deprecated PROPERTY NAMES, to be removed after 2.5: BEWARE: The compiler will
not print any warning if a deprecated property name is used.
......
Index: dumux/io/interfacemeshcreator.hh
===================================================================
--- dumux/io/interfacemeshcreator.hh (revision 12659)
+++ dumux/io/interfacemeshcreator.hh (working copy)
@@ -29,11 +29,8 @@
typedef typename HelperGridView::Traits::template Codim<0>::Entity HelperElement;
typedef typename HelperElement::Geometry HelperGeometry;
-#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
- HelperElementIterator helperElementIterator = helperGrid.leafGridView().template begin<0>();
-#else
HelperElementIterator helperElementIterator = helperGrid.leafView().template begin<0>();
-#endif
+
const HelperElement& helperElement = *helperElementIterator;
const HelperGeometry& helperGeometry = helperElement.geometry();
#!/bin/sh
# First create and enter a folder for the dune and dumux modules
# If desired, you can enter this folder and execute this script for a DUNE and DUMUX installation.
# For that purpose, you can comment/uncomment required lines below,
# currently only the DUNE modules are checked out.
# Following dune components should be available in the described versions:
# dune-multidomain (master branch):
git clone git://gitorious.org/dune-multidomain/dune-multidomain.git
cd dune-multidomain
git checkout deac3cecfc6697c1f5316d55c0fadd74f51d92bc
cd ..
# dune-multidomaingrid (master branch):
git clone git://gitorious.org/dune-multidomaingrid/dune-multidomaingrid.git
cd dune-multidomaingrid
git checkout 30ff14d6b49c8adabf9e5cec67f20fcb3270a77e
cd ..
# dune-pdelab (master branch):
git clone http://git.dune-project.org/repositories/dune-pdelab
cd dune-pdelab
git checkout 1de21a0859e10914ba5c3b70f67c5517573ac70e
cd ..
# tested DUNE modules:
svn checkout -r 7436 https://svn.dune-project.org/svn/dune-common/trunk dune-common
svn checkout -r 489 https://svn.dune-project.org/svn/dune-geometry/trunk dune-geometry
svn checkout -r 8930 https://svn.dune-project.org/svn/dune-grid/trunk dune-grid
svn checkout -r 1910 https://svn.dune-project.org/svn/dune-istl/trunk dune-istl
svn checkout -r 1206 https://svn.dune-project.org/svn/dune-localfunctions/trunk dune-localfunctions
# DUMUX
#ssh-add
# for an external installation, use
# svn co --username=anonymous --password=’ ’ svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk dumux
#svn checkout svn+ssh://luftig/home/svn/DUMUX/dumux/trunk dumux-stable
#svn checkout svn+ssh://luftig/home/svn/DUMUX/dune-mux/trunk dumux-devel
#svn checkout svn+ssh://luftig/home/svn/DUMUX/external/trunk external
# patch m4 folder in dumux-stable for compatibility with the DUNE modules above
#patch -p0 < patches/dumux-m4.patch
# install the external modules: UG and SuperLU or PARDISO are required
#cd external
#./installExternal.sh ug
#./installExternal.sh blas
#./installExternal.sh superlu
#cd ..
# dune-pdelab/dune/pdelab/backend/istlvectorbackend.hh has to be replaced by the one in the subfolder additionalfiles
cp dumux-stable/test/multidomain/2cnistokes2p2cni/additionalfiles/istlvectorbackend.hh dune-pdelab/dune/pdelab/backend/
# in dumux/freeflow/new_stokes/stokeslocalresidual:
# if the pressure is set on the entire right boundary, the interpolation at the lower right corner has to be switched off;
# therefore, comment in interpolateCornerPoints the local vertex 1 (lower right corner of Stokes domain);
# run dunecontrol
# ./dune-common/bin/dunecontrol PATH_TO_OPTS all
# the problem hardly converges with BiCGSTAB; use a direct solver like SuperLU or PARDISO
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTLVECTORBACKEND_HH
#define DUNE_ISTLVECTORBACKEND_HH
#include<vector>
#include<dune/common/fvector.hh>
#include<dune/istl/bvector.hh>
#include "backendselector.hh"
#include "istlmatrixbackend.hh"
namespace Dune {
namespace PDELab {
template<int> class ISTLVectorBackend;
template<typename T, typename E, int BLOCKSIZE>
class ISTLBlockVectorContainer
{
public:
typedef E ElementType;
typedef Dune::BlockVector< Dune::FieldVector<E,BLOCKSIZE> > ContainerType;
typedef ContainerType BaseT;
typedef typename ContainerType::field_type field_type;
typedef typename ContainerType::iterator iterator;
typedef typename ContainerType::const_iterator const_iterator;
typedef typename ContainerType::const_iterator ConstIterator;
typedef typename ContainerType::block_type block_type;
typedef typename ContainerType::size_type size_type;
typedef ISTLVectorBackend<BLOCKSIZE> Backend;
ISTLBlockVectorContainer ()
{}
ISTLBlockVectorContainer (const T& t_) : container(t_.globalSize()/BLOCKSIZE)
{}
ISTLBlockVectorContainer (const T& t_, const E& e) : container(t_.globalSize()/BLOCKSIZE)
{
container=e;
}
size_type N() const
{
return container.N();
}
ISTLBlockVectorContainer& operator= (const E& e)
{
container=e;
return *this;
}
ISTLBlockVectorContainer& operator*= (const E& e)
{
container*=e;
return *this;
}
ISTLBlockVectorContainer& operator+= (const E& e)
{
container+=e;
return *this;
}
ISTLBlockVectorContainer& operator+= (const ISTLBlockVectorContainer& e)
{
container+=e;
return *this;
}
ISTLBlockVectorContainer& operator-= (const ISTLBlockVectorContainer& e)
{
container-=e;
return *this;
}
block_type& operator[](std::size_t i)
{
return container[i];
}
const block_type& operator[](std::size_t i) const
{
return container[i];
}
E two_norm() const
{
return container.two_norm();
}
E two_norm2() const
{
return container.two_norm2();
}
E one_norm() const
{
return container.one_norm();
}
E infinity_norm() const
{
return container.infinity_norm();
}
E operator*(const ISTLBlockVectorContainer& y) const
{
return container*y.base();
}
E dot(const ISTLBlockVectorContainer& y) const
{
return container.dot(y.base());
}
ISTLBlockVectorContainer& axpy(const E& a, const ISTLBlockVectorContainer& y)
{
container.axpy(a, y);
return *this;
}
// for debugging and AMG access
ContainerType& base ()
{
return container;
}
const ContainerType& base () const
{
return container;
}
operator ContainerType&()
{
return container;
}
operator const ContainerType&() const
{
return container;
}
iterator begin()
{
return container.begin();
}
const_iterator begin() const
{
return container.begin();
}
iterator end()
{
return container.end();
}
const_iterator end() const
{
return container.end();
}
size_t flatsize() const
{
return container.size()*BLOCKSIZE;
}
size_t dim() const
{
return container.dim();
}
size_t size() const
{
return container.size();
}
void resize(size_t n)
{
container.resize(n);
}
template<typename X>
void std_copy_to (std::vector<X>& x) const
{
size_t n = flatsize();
x.resize(n);
for (size_t i=0; i<n; i++)
x[i] = container[i/BLOCKSIZE][i%BLOCKSIZE];
}
template<typename X>
void std_copy_from (const std::vector<X>& x)
{
//test if x has the same size as the container
assert (x.size() == flatsize());
for (size_t i=0; i<flatsize(); i++)
container[i/BLOCKSIZE][i%BLOCKSIZE] = x[i];
}
private:
Dune::BlockVector< Dune::FieldVector<E,BLOCKSIZE> > container;
};
//! ISTL backend for FunctionSpace
template<int BLOCKSIZE=1>
class ISTLVectorBackend
{
public:
enum{
//! \brief export the block size
BlockSize = BLOCKSIZE
};
//export Matrix Backend Type
typedef ISTLBCRSMatrixBackend<BLOCKSIZE,BLOCKSIZE> MatrixBackend;
//! container construction
// extract type of container element
template<class C>
struct Value
{
typedef typename C::field_type Type;
};
//! The size type
typedef typename Dune::BlockVector< Dune::FieldVector<float,BLOCKSIZE> >::size_type size_type;
// get const_reference to container element
// note: this method does not depend on T!
template<typename C>
static const typename C::field_type& access (const C& c, size_type i)
{
return c.base()[i/BLOCKSIZE][i%BLOCKSIZE];
}
// get non const_reference to container element
// note: this method does not depend on T!
template<typename C>
static typename C::field_type& access (C& c, size_type i)
{
return c.base()[i/BLOCKSIZE][i%BLOCKSIZE];
}
};
template<int BLOCKSIZE,typename T, typename E>
struct BackendVectorSelectorHelper<ISTLVectorBackend<BLOCKSIZE>, T, E>
{
typedef ISTLBlockVectorContainer<T,E,BLOCKSIZE> Type;
};
} // namespace PDELab
} // namespace Dune
#endif
#!/bin/sh
# First create and enter a folder for the dune and dumux modules
# If desired, you can enter this folder and execute this script for a DUNE and DUMUX installation.
# For that purpose, you can comment/uncomment required lines below,
# currently only the DUNE modules are checked out.
# Following dune components should be available in the described versions:
# dune-multidomain (master branch):
git clone git://gitorious.org/dune-multidomain/dune-multidomain.git
cd dune-multidomain
git checkout deac3cecfc6697c1f5316d55c0fadd74f51d92bc
cd ..
# dune-multidomaingrid (master branch):
git clone git://gitorious.org/dune-multidomaingrid/dune-multidomaingrid.git
cd dune-multidomaingrid
git checkout 30ff14d6b49c8adabf9e5cec67f20fcb3270a77e
cd ..
# dune-pdelab (master branch):
git clone http://git.dune-project.org/repositories/dune-pdelab
cd dune-pdelab
git checkout 1de21a0859e10914ba5c3b70f67c5517573ac70e
cd ..
# tested DUNE modules:
svn checkout -r 7436 https://svn.dune-project.org/svn/dune-common/trunk dune-common
svn checkout -r 489 https://svn.dune-project.org/svn/dune-geometry/trunk dune-geometry
svn checkout -r 8930 https://svn.dune-project.org/svn/dune-grid/trunk dune-grid
svn checkout -r 1910 https://svn.dune-project.org/svn/dune-istl/trunk dune-istl
svn checkout -r 1206 https://svn.dune-project.org/svn/dune-localfunctions/trunk dune-localfunctions
# DUMUX
#ssh-add
# for an external installation, use
# svn co --username=anonymous --password=’ ’ svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk dumux
#svn checkout svn+ssh://luftig/home/svn/DUMUX/dumux/trunk dumux-stable
#svn checkout svn+ssh://luftig/home/svn/DUMUX/dune-mux/trunk dumux-devel
#svn checkout svn+ssh://luftig/home/svn/DUMUX/external/trunk external
# patch m4 folder in dumux-stable for compatibility with the DUNE modules above
#patch -p0 < patches/dumux-m4.patch
# install the external modules: UG and SuperLU or PARDISO are required
#cd external
#./installExternal.sh ug
#./installExternal.sh blas
#./installExternal.sh superlu
#cd ..
# dune-pdelab/dune/pdelab/backend/istlvectorbackend.hh has to be replaced by the one in the subfolder additionalfiles
cp dumux-stable/test/multidomain/2cnistokes2p2cni/additionalfiles/istlvectorbackend.hh dune-pdelab/dune/pdelab/backend/
# in dumux/freeflow/new_stokes/stokeslocalresidual:
# if the pressure is set on the entire right boundary, the interpolation at the lower right corner has to be switched off;
# therefore, comment in interpolateCornerPoints the local vertex 1 (lower right corner of Stokes domain);
# run dunecontrol
# ./dune-common/bin/dunecontrol PATH_TO_OPTS all
# the problem hardly converges with BiCGSTAB; use a direct solver like SuperLU or PARDISO
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTLVECTORBACKEND_HH
#define DUNE_ISTLVECTORBACKEND_HH
#include<vector>
#include<dune/common/fvector.hh>
#include<dune/istl/bvector.hh>
#include "backendselector.hh"
#include "istlmatrixbackend.hh"
namespace Dune {
namespace PDELab {
template<int> class ISTLVectorBackend;
template<typename T, typename E, int BLOCKSIZE>
class ISTLBlockVectorContainer
{
public:
typedef E ElementType;
typedef Dune::BlockVector< Dune::FieldVector<E,BLOCKSIZE> > ContainerType;
typedef ContainerType BaseT;
typedef typename ContainerType::field_type field_type;
typedef typename ContainerType::iterator iterator;
typedef typename ContainerType::const_iterator const_iterator;
typedef typename ContainerType::const_iterator ConstIterator;
typedef typename ContainerType::block_type block_type;
typedef typename ContainerType::size_type size_type;
typedef ISTLVectorBackend<BLOCKSIZE> Backend;
ISTLBlockVectorContainer ()
{}
ISTLBlockVectorContainer (const T& t_) : container(t_.globalSize()/BLOCKSIZE)
{}
ISTLBlockVectorContainer (const T& t_, const E& e) : container(t_.globalSize()/BLOCKSIZE)
{
container=e;
}
size_type N() const
{
return container.N();
}
ISTLBlockVectorContainer& operator= (const E& e)
{
container=e;
return *this;
}
ISTLBlockVectorContainer& operator*= (const E& e)
{
container*=e;
return *this;
}
ISTLBlockVectorContainer& operator+= (const E& e)
{
container+=e;
return *this;
}
ISTLBlockVectorContainer& operator+= (const ISTLBlockVectorContainer& e)
{
container+=e;
return *this;
}
ISTLBlockVectorContainer& operator-= (const ISTLBlockVectorContainer& e)
{
container-=e;
return *this;
}
block_type& operator[](std::size_t i)
{
return container[i];
}
const block_type& operator[](std::size_t i) const
{
return container[i];
}
E two_norm() const
{
return container.two_norm();
}
E two_norm2() const
{
return container.two_norm2();
}
E one_norm() const
{
return container.one_norm();
}
E infinity_norm() const
{
return container.infinity_norm();
}
E operator*(const ISTLBlockVectorContainer& y) const
{
return container*y.base();
}
E dot(const ISTLBlockVectorContainer& y) const
{
return container.dot(y.base());
}
ISTLBlockVectorContainer& axpy(const E& a, const ISTLBlockVectorContainer& y)
{
container.axpy(a, y);
return *this;
}
// for debugging and AMG access
ContainerType& base ()
{
return container;
}
const ContainerType& base () const
{
return container;
}
operator ContainerType&()
{
return container;
}
operator const ContainerType&() const
{
return container;
}
iterator begin()
{
return container.begin();
}
const_iterator begin() const
{
return container.begin();
}
iterator end()
{
return container.end();
}
const_iterator end() const
{
return container.end();
}
size_t flatsize() const
{
return container.size()*BLOCKSIZE;
}
size_t dim() const
{
return container.dim();
}
size_t size() const
{
return container.size();
}
void resize(size_t n)
{
container.resize(n);
}
template<typename X>
void std_copy_to (std::vector<X>& x) const
{
size_t n = flatsize();
x.resize(n);
for (size_t i=0; i<n; i++)
x[i] = container[i/BLOCKSIZE][i%BLOCKSIZE];
}
template<typename X>
void std_copy_from (const std::vector<X>& x)
{
//test if x has the same size as the container
assert (x.size() == flatsize());
for (size_t i=0; i<flatsize(); i++)
container[i/BLOCKSIZE][i%BLOCKSIZE] = x[i];
}
private:
Dune::BlockVector< Dune::FieldVector<E,BLOCKSIZE> > container;
};
//! ISTL backend for FunctionSpace
template<int BLOCKSIZE=1>
class ISTLVectorBackend
{
public:
enum{
//! \brief export the block size
BlockSize = BLOCKSIZE
};
//export Matrix Backend Type
typedef ISTLBCRSMatrixBackend<BLOCKSIZE,BLOCKSIZE> MatrixBackend;
//! container construction
// extract type of container element
template<class C>
struct Value
{
typedef typename C::field_type Type;
};
//! The size type
typedef typename Dune::BlockVector< Dune::FieldVector<float,BLOCKSIZE> >::size_type size_type;
// get const_reference to container element
// note: this method does not depend on T!
template<typename C>
static const typename C::field_type& access (const C& c, size_type i)
{
return c.base()[i/BLOCKSIZE][i%BLOCKSIZE];
}
// get non const_reference to container element
// note: this method does not depend on T!
template<typename C>
static typename C::field_type& access (C& c, size_type i)
{
return c.base()[i/BLOCKSIZE][i%BLOCKSIZE];
}
};
template<int BLOCKSIZE,typename T, typename E>
struct BackendVectorSelectorHelper<ISTLVectorBackend<BLOCKSIZE>, T, E>
{
typedef ISTLBlockVectorContainer<T,E,BLOCKSIZE> Type;
};
} // namespace PDELab
} // namespace Dune
#endif
== Running the test cases in test/multidomain ==
Due to the lack of stable versions of the upstream Dune modules
Dune-MultidomainGrid and Dune-Multidomain, we have compatibility
issues with the release version of the Dune Core Modules. You
have to use specific revisions of these, as listed below.
dune-common Git commit 6fb2492cca04e07ad43074a29667b633b4fa0680
dune-geometry Git commit cda1d514d79f13e70de2d55fdf6906864c2fdcdd
dune-grid Git commit cfec4c46bd59219337660ed833fe38cd2acbd364
dune-istl Git commit b2c9640a4873ca905caf8e29ebc348a817801e9b
dune-localfunctions Git commit d7776478e0e56beceebc48ddfca068b1c115dff3
dune-PDELab Git commit 1de21a0859e10914ba5c3b70f67c5517573ac70e
dune-multidomaingrid Git commit 30ff14d6b49c8adabf9e5cec67f20fcb3270a77e
dune-multidomain Git commit deac3cecfc6697c1f5316d55c0fadd74f51d92bc
Then you have to patch PDELab with the patch from patches/pdelab-1.1.0.patch .
And you have to patch DuMuX with both the patches from
patches/dumux-m4.patch and patches/dumux-multidomain.patch .
Install the external grid manager UG. Additional you need to install a
direct linear solver like SuperLU or PARDISO.
You need Boost fusion for dune-multidomaingrid.
There are compiler restrictions:
- GCC 4.6 works.
- GCC 4.7 produces segmentation faults.
- GCC 4.8 works only with unoptimized builds (-O0).
- Clang is not supported.
- Intel ICC is not tested.
For your convenience we provide the Shell script installRequiredModules.sh
in the same folder as this README.
#!/bin/sh
# First create and enter a folder for the dune and dumux modules
# download Dune core modules
git clone http://git.dune-project.org/repositories/dune-common
cd dune-common
git checkout 6fb2492cca04e07ad43074a29667b633b4fa0680
cd ..
git clone http://git.dune-project.org/repositories/dune-geometry
cd dune-geometry
git checkout cda1d514d79f13e70de2d55fdf6906864c2fdcdd
cd ..
git clone http://git.dune-project.org/repositories/dune-grid
cd dune-grid
git checkout cfec4c46bd59219337660ed833fe38cd2acbd364
cd ..
git clone http://git.dune-project.org/repositories/dune-istl
cd dune-istl
git checkout b2c9640a4873ca905caf8e29ebc348a817801e9b
cd ..
git clone http://git.dune-project.org/repositories/dune-localfunctions
cd dune-localfunctions
git checkout d7776478e0e56beceebc48ddfca068b1c115dff3
cd ..
# download dune-PDELab
git clone http://git.dune-project.org/repositories/dune-pdelab
cd dune-pdelab
git checkout releases/1.1
cd ..
# download dune-multidomaingrid
git clone https://users.dune-project.org/repositories/projects/dune-multidomaingrid.git
cd dune-multidomaingrid
git checkout 30ff14d6b49c8adabf9e5cec67f20fcb3270a77e
cd ..
# download dune-multidomain
git clone https://users.dune-project.org/repositories/projects/dune-multidomain.git
cd dune-multidomain
git checkout deac3cecfc6697c1f5316d55c0fadd74f51d92bc
cd ..
# download DuMuX
svn co svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/branches/release-2.5 dumux
# apply patches to PDELab and DuMuX
cd dune-pdelab
patch -p0 < ../dumux/patches/pdelab-1.1.0.patch
cd ..
cd dumux
patch -p0 < patches/dumux-m4.patch
patch -p0 < patches/dumux-multidomain.patch
cd ..
\ No newline at end of file
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