Commit 08194bce authored by Martin Nolte's avatar Martin Nolte

Merge branch 'feature/remove-deprecated-grid-methods' into 'master'

remove deprecated method from grid interface

See merge request !251

(cherry picked from commit b67b5344)

f4b8e7ae remove deprecated method from grid interface
parent af5766f0
Pipeline #6043 failed with stage
in 48 minutes and 58 seconds
......@@ -211,16 +211,10 @@ namespace Dune
}
/** \brief Return size of the overlap region for a given codim on the grid view. */
int overlapSize(int codim) const
{
return grid().overlapSize(level_, codim);
}
int overlapSize ( int codim ) const { return 0; }
/** \brief Return size of the ghost region for a given codim on the grid view. */
int ghostSize(int codim) const
{
return grid().ghostSize(level_, codim);
}
int ghostSize ( int codim ) const { return 0; }
/** communicate data on this view */
template< class DataHandleImp, class DataType >
......@@ -425,16 +419,10 @@ namespace Dune
}
/** \brief Return size of the overlap region for a given codim on the grid view. */
int overlapSize(int codim) const
{
return grid().overlapSize(codim);
}
int overlapSize ( int codim ) const { return 0; }
/** \brief Return size of the ghost region for a given codim on the grid view. */
int ghostSize(int codim) const
{
return grid().ghostSize(codim);
}
int ghostSize ( int codim ) const { return 0; }
/** communicate data on this view */
template< class DataHandleImp, class DataType >
......
......@@ -722,71 +722,6 @@ namespace Dune {
//@{
//===========================================================
//! Return size of overlap for a given codim on a given level
DUNE_DEPRECATED_MSG("overlapSize() is deprecated. Use the method on the LevelGridView instead.")
int overlapSize (int level, int codim) const
{
return levelGridView(level).overlapSize(codim);
}
//! Return size of overlap region for a given codim on the leaf grid
DUNE_DEPRECATED_MSG("overlapSize() is deprecated. Use the method on the LeafGridView instead.")
int overlapSize (int codim) const
{
return leafGridView().overlapSize(codim);
}
//! Return size of ghost region for a given codim on a given level
DUNE_DEPRECATED_MSG("ghostSize() is deprecated. Use the method on the LevelGridView instead.")
int ghostSize (int level, int codim) const
{
return levelGridView(level).ghostSize(codim);
}
//! Return size of ghost region for a given codim on the leaf grid
DUNE_DEPRECATED_MSG("ghostSize() is deprecated. Use the method on the LeafGridView instead.")
int ghostSize (int codim) const
{
return leafGridView().ghostSize(codim);
}
/**
* \brief Communicate information on distributed entities on a given level
* Template parameter is a model of Dune::CommDataHandleIF
* \param data A data handle telling the method what data is communicated
* and how this should be done.
* \param interface The communication interface to use.
* \param dir The direction of the communication along the interface (forward
* or backward.
* \param level The index of the grid level where the communication should
* happen.
*/
template<class DataHandleImp, class DataTypeImp>
DUNE_DEPRECATED_MSG("communicate() is deprecated. Use the method on the LevelGridView instead.")
void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, InterfaceType iftype, CommunicationDirection dir, int level) const
{
CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir,level)));
return;
}
/**
* \brief Communicate information on distributed entities on the leaf grid
* Template parameter is a model of Dune::CommDataHandleIF
*
* \param data A data handle telling the method what data is communicated
* and how this should be done.
* \param interface The communication interface to use.
* \param dir The direction of the communication along the interface
* (forward or backward).
*/
template<class DataHandleImp, class DataTypeImp>
DUNE_DEPRECATED_MSG("communicate() is deprecated. Use the method on the LeafGridView instead.")
void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, InterfaceType iftype, CommunicationDirection dir) const
{
CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir)));
return;
}
//! return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication.
const CollectiveCommunication &comm () const
{
......@@ -1002,30 +937,6 @@ namespace Dune {
//! clean up some markers
void postAdapt() {}
/** \brief ghostSize is zero by default */
int ghostSize (int level, int codim) const { return 0; }
/** \brief overlapSize is zero by default */
int overlapSize (int level, int codim) const { return 0; }
/** \brief ghostSize is zero by default */
int ghostSize (int codim) const { return 0; }
/** \brief overlapSize is zero by default */
int overlapSize (int codim) const { return 0; }
/** dummy communicate, doing nothing */
template<class DataHandleImp, class DataTypeImp>
void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data,
InterfaceType iftype, CommunicationDirection dir, int level) const
{}
/** dummy communicate, doing nothing */
template<class DataHandleImp, class DataTypeImp>
void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data,
InterfaceType iftype, CommunicationDirection dir) const
{}
/*! \brief default implementation of load balance does nothing and returns false */
bool loadBalance()
{
......
......@@ -431,86 +431,6 @@ namespace Dune
/** \name Parallel Data Distribution and Communication Methods
* \{ */
/** \brief obtain size of overlap region for the leaf grid
*
* \param[in] codim codimension for with the information is desired
*/
int overlapSize ( int codim ) const
{
return leafGridView().overlapSize( codim );
}
/** \brief obtain size of ghost region for the leaf grid
*
* \param[in] codim codimension for with the information is desired
*/
int ghostSize( int codim ) const
{
return leafGridView().ghostSize( codim );
}
/** \brief obtain size of overlap region for a grid level
*
* \param[in] level grid level (0, ..., maxLevel())
* \param[in] codim codimension (0, ..., dimension)
*/
int overlapSize ( int level, int codim ) const
{
return levelGridView( level ).overlapSize( codim );
}
/** \brief obtain size of ghost region for a grid level
*
* \param[in] level grid level (0, ..., maxLevel())
* \param[in] codim codimension (0, ..., dimension)
*/
int ghostSize ( int level, int codim ) const
{
return levelGridView( level ).ghostSize( codim );
}
/** \brief communicate information on a grid level
*
* \param dataHandle communication data handle (user defined)
* \param[in] interface communication interface (one of
* InteriorBorder_InteriorBorder_Interface,
* InteriorBorder_All_Interface,
* Overlap_OverlapFront_Interface,
* Overlap_All_Interface,
* All_All_Interface)
* \param[in] direction communication direction (one of
* ForwardCommunication or BackwardCommunication)
* \param[in] level grid level to communicate
*/
template< class DataHandle, class Data >
void communicate ( CommDataHandleIF< DataHandle, Data > &dataHandle,
InterfaceType interface,
CommunicationDirection direction,
int level ) const
{
levelGridView( level ).communicate( dataHandle, interface, direction );
}
/** \brief communicate information on leaf entities
*
* \param dataHandle communication data handle (user defined)
* \param[in] interface communication interface (one of
* InteriorBorder_InteriorBorder_Interface,
* InteriorBorder_All_Interface,
* Overlap_OverlapFront_Interface,
* Overlap_All_Interface,
* All_All_Interface)
* \param[in] direction communication direction (one of
* ForwardCommunication, BackwardCommunication)
*/
template< class DataHandle, class Data >
void communicate ( CommDataHandleIF< DataHandle, Data > &dataHandle,
InterfaceType interface,
CommunicationDirection direction ) const
{
leafGridView().communicate( dataHandle, interface, direction );
}
/** \brief obtain CollectiveCommunication object
*
* The CollectiveCommunication object should be used to globally
......
......@@ -344,25 +344,25 @@ namespace Dune
/** \brief Size of the overlap on the leaf level */
unsigned int overlapSize(int codim) const {
return hostgrid_->overlapSize(codim);
return hostgrid_->leafGridView().overlapSize(codim);
}
/** \brief Size of the ghost cell layer on the leaf level */
unsigned int ghostSize(int codim) const {
return hostgrid_->ghostSize(codim);
return hostgrid_->leafGridView().ghostSize(codim);
}
/** \brief Size of the overlap on a given level */
unsigned int overlapSize(int level, int codim) const {
return hostgrid_->overlapSize(level,codim);
return hostgrid_->levelGridView(level).overlapSize(codim);
}
/** \brief Size of the ghost cell layer on a given level */
unsigned int ghostSize(int level, int codim) const {
return hostgrid_->ghostSize(level,codim);
return hostgrid_->levelGridView(level).ghostSize(codim);
}
......@@ -375,32 +375,6 @@ namespace Dune
void loadBalance(int strategy, int minlevel, int depth, int maxlevel, int minelement){
DUNE_THROW(NotImplemented, "IdentityGrid::loadBalance()");
}
/** \brief The communication interface
* @param T: array class holding data associated with the entities
* @param P: type used to gather/scatter data in and out of the message buffer
* @param codim: communicate entites of given codim
* @param if: one of the predifined interface types, throws error if it is not implemented
* @param level: communicate for entities on the given level
*
* Implements a generic communication function sending an object of type P for each entity
* in the intersection of two processors. P has two methods gather and scatter that implement
* the protocol. Therefore P is called the "protocol class".
*/
template<class T, template<class> class P, int codim>
void communicate (T& t, InterfaceType iftype, CommunicationDirection dir, int level);
/*! The new communication interface
communicate objects for all codims on a given level
*/
template<class DataHandle>
void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir, int level) const
{}
template<class DataHandle>
void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const
{}
#endif
......
......@@ -210,34 +210,6 @@ namespace Dune {
return 2;
}
/** \brief The processor overlap for parallel computing. Always zero because
this is a strictly sequential grid */
DUNE_DEPRECATED_MSG("overlapSize() is deprecated. Use the method on the LeafGridView instead.")
int overlapSize(int codim) const {
return 0;
}
/** \brief The processor ghost overlap for parallel computing. Always zero because
this is a strictly sequential grid */
DUNE_DEPRECATED_MSG("ghostSize() is deprecated. Use the method on the LeafGridView instead.")
int ghostSize(int codim) const {
return 0;
}
/** \brief The processor overlap for parallel computing. Always zero because
this is a strictly sequential grid */
DUNE_DEPRECATED_MSG("overlapSize() is deprecated. Use the method on the LevelGridView instead.")
int overlapSize(int level, int codim) const {
return 0;
}
/** \brief The processor ghost overlap for parallel computing. Always zero because
this is a strictly sequential grid */
DUNE_DEPRECATED_MSG("ghostSize() is deprecated. Use the method on the LevelGridView instead.")
int ghostSize(int level, int codim) const {
return 0;
}
/** \brief Get the set of global ids */
const Traits::GlobalIdSet& globalIdSet() const
{
......@@ -321,16 +293,6 @@ namespace Dune {
// dummy parallel functions
template<class DataHandle>
DUNE_DEPRECATED_MSG("communicate() is deprecated. Use the method on the LevelGridView instead.")
void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir, int level) const
{}
template<class DataHandle>
DUNE_DEPRECATED_MSG("communicate() is deprecated. Use the method on the LeafGridView instead.")
void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const
{}
const CollectiveCommunication &comm () const
{
return ccobj;
......
......@@ -503,16 +503,6 @@ struct GridInterface
// number of leaf entities per geometry type in this process
g.size(Dune::GeometryTypes::cube(Grid::dimension));
DUNE_NO_DEPRECATED_BEGIN
// Check overlap and ghost size on level 0
g.overlapSize(0,0);
g.ghostSize(0,0);
// Check overlap and ghost size on the leaf level
g.overlapSize(0);
g.ghostSize(0);
DUNE_NO_DEPRECATED_END
// check for iterator functions
g.levelGridView(0).template begin<0>();
g.levelGridView(0).template end<0>();
......
......@@ -455,26 +455,6 @@ namespace Dune {
void postAdapt();
/*@}*/
/** \brief Size of the overlap on the leaf level */
unsigned int overlapSize(int codim) const {
return 0;
}
/** \brief Size of the ghost cell layer on the leaf level */
unsigned int ghostSize(int codim) const {
return (codim==0) ? 1 : 0;
}
/** \brief Size of the overlap on a given level */
unsigned int overlapSize(int level, int codim) const {
return 0;
}
/** \brief Size of the ghost cell layer on a given level */
unsigned int ghostSize(int level, int codim) const {
return (codim==0) ? 1 : 0;
}
/** \brief Distributes the grid and some data over the available nodes in a distributed machine
\tparam DataHandle works like the data handle for the communicate
......@@ -587,78 +567,6 @@ namespace Dune {
return true;
}
/** \brief The communication interface for all codims on a given level
@param dataHandle type used to gather/scatter data in and out of the message buffer
@param iftype one of the predefined interface types, throws error if it is not implemented
@param dir choose between forward and backward communication
@param level communicate for entities on the given level
Implements a generic communication function sending an object of type P for each entity
in the intersection of two processors. P has two methods gather and scatter that implement
the protocol. Therefore P is called the "protocol class".
*/
template<class DataHandle>
void communicate (DataHandle& dataHandle, InterfaceType iftype, CommunicationDirection dir, int level) const
{
#ifdef ModelP
typedef typename UGGrid::LevelGridView LevelGridView;
for (int curCodim = 0; curCodim <= dim; ++curCodim) {
if (!dataHandle.contains(dim, curCodim))
continue;
if (curCodim == 0)
communicateUG_<LevelGridView, DataHandle, 0>(this->levelGridView(level), level, dataHandle, iftype, dir);
else if (curCodim == dim)
communicateUG_<LevelGridView, DataHandle, dim>(this->levelGridView(level), level, dataHandle, iftype, dir);
else if (curCodim == dim - 1)
communicateUG_<LevelGridView, DataHandle, dim-1>(this->levelGridView(level), level, dataHandle, iftype, dir);
else if (curCodim == 1)
communicateUG_<LevelGridView, DataHandle, 1>(this->levelGridView(level), level, dataHandle, iftype, dir);
else
DUNE_THROW(NotImplemented,
className(*this) << "::communicate(): Not "
"supported for dim " << dim << " and codim " << curCodim);
}
#endif // ModelP
}
/** \brief The communication interface for all codims on the leaf level
@param dataHandle type used to gather/scatter data in and out of the message buffer
@param iftype one of the predefined interface types, throws error if it is not implemented
@param dir choose between forward and backward communication
Implements a generic communication function sending an object of type P for each entity
in the intersection of two processors. P has two methods gather and scatter that implement
the protocol. Therefore P is called the "protocol class".
*/
template<class DataHandle>
void communicate(DataHandle& dataHandle, InterfaceType iftype, CommunicationDirection dir) const
{
#ifdef ModelP
typedef typename UGGrid::LeafGridView LeafGridView;
for (int curCodim = 0; curCodim <= dim; ++curCodim) {
if (!dataHandle.contains(dim, curCodim))
continue;
int level = -1;
if (curCodim == 0)
communicateUG_<LeafGridView, DataHandle, 0>(this->leafGridView(), level, dataHandle, iftype, dir);
else if (curCodim == dim)
communicateUG_<LeafGridView, DataHandle, dim>(this->leafGridView(), level, dataHandle, iftype, dir);
else if (curCodim == dim - 1)
communicateUG_<LeafGridView, DataHandle, dim-1>(this->leafGridView(), level, dataHandle, iftype, dir);
else if (curCodim == 1)
communicateUG_<LeafGridView, DataHandle, 1>(this->leafGridView(), level, dataHandle, iftype, dir);
else
DUNE_THROW(NotImplemented,
className(*this) << "::communicate(): Not "
"supported for dim " << dim << " and codim " << curCodim);
}
#endif // ModelP
}
/** the collective communication */
const CollectiveCommunication<UGGrid>& comm () const
{
......
......@@ -72,6 +72,8 @@ namespace Dune
template< class GridImp>
class UGGridLevelGridView
{
typedef UGGridLevelGridView<GridImp> This;
public:
typedef UGGridLevelGridViewTraits<GridImp> Traits;
......@@ -201,12 +203,28 @@ namespace Dune
/** communicate data on this view */
template< class DataHandleImp, class DataType >
void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
InterfaceType iftype,
CommunicationDirection dir ) const
{
return grid().communicate( data, iftype, dir, level_ );
}
void communicate ( CommDataHandleIF< DataHandleImp, DataType > &dataHandle, InterfaceType iftype, CommunicationDirection dir ) const
{
typedef CommDataHandleIF< DataHandleImp, DataType > DataHandle;
#ifdef ModelP
for (int curCodim = 0; curCodim <= Grid::dimension; ++curCodim) {
if (!dataHandle.contains(Grid::dimension, curCodim))
continue;
if (curCodim == 0)
grid().template communicateUG_<This, DataHandle, 0>(*this, level_, dataHandle, iftype, dir);
else if (curCodim == Grid::dimension)
grid().template communicateUG_<This, DataHandle, Grid::dimension>(*this, level_, dataHandle, iftype, dir);
else if (curCodim == Grid::dimension - 1)
grid().template communicateUG_<This, DataHandle, Grid::dimension-1>(*this, level_, dataHandle, iftype, dir);
else if (curCodim == 1)
grid().template communicateUG_<This, DataHandle, 1>(*this, level_, dataHandle, iftype, dir);
else
DUNE_THROW(NotImplemented, className(*this) << "::communicate(): Not " "supported for dim " << Grid::dimension << " and codim " << curCodim);
}
#endif // ModelP
}
private:
const Grid *grid_;
......@@ -266,6 +284,8 @@ namespace Dune
template< class GridImp >
class UGGridLeafGridView
{
typedef UGGridLeafGridView<GridImp> This;
public:
typedef UGGridLeafGridViewTraits<GridImp> Traits;
......@@ -382,12 +402,28 @@ namespace Dune
/** communicate data on this view */
template< class DataHandleImp, class DataType >
void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
InterfaceType iftype,
CommunicationDirection dir ) const
{
return grid().communicate( data, iftype, dir );
}
void communicate ( CommDataHandleIF< DataHandleImp, DataType > &dataHandle, InterfaceType iftype, CommunicationDirection dir ) const
{
typedef CommDataHandleIF< DataHandleImp, DataType > DataHandle;
#ifdef ModelP
for (int curCodim = 0; curCodim <= Grid::dimension; ++curCodim) {
if (!dataHandle.contains(Grid::dimension, curCodim))
continue;
int level = -1;
if (curCodim == 0)
grid().template communicateUG_<This, DataHandle, 0>(*this, level, dataHandle, iftype, dir);
else if (curCodim == Grid::dimension)
grid().template communicateUG_<This, DataHandle, Grid::dimension>(*this, level, dataHandle, iftype, dir);
else if (curCodim == Grid::dimension - 1)
grid().template communicateUG_<This, DataHandle, Grid::dimension-1>(*this, level, dataHandle, iftype, dir);
else if (curCodim == 1)
grid().template communicateUG_<This, DataHandle, 1>(*this, level, dataHandle, iftype, dir);
else
DUNE_THROW(NotImplemented, className(*this) << "::communicate(): Not " "supported for dim " << Grid::dimension << " and codim " << curCodim);
}
#endif // ModelP
}
private:
const Grid *grid_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment