/usr/include/dune/grid/common/adaptcallback.hh is in libdune-grid-dev 2.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | #ifndef DUNE_ADAPTCALLBACK_HH
#define DUNE_ADAPTCALLBACK_HH
/** \file
* \author Martin Nolte
* \brief interfaces and wrappers needed for the callback adaptation provided
* by AlbertaGrid and ALUGrid
*/
namespace Dune
{
// Internal Forward Declarations
// -----------------------------
template< class Grid, class Impl >
class AdaptDataHandle;
// AdaptDataHandleInterface
// ------------------------
template< class Grid, class Impl >
class AdaptDataHandleInterface
{
typedef AdaptDataHandleInterface< Grid, Impl > This;
friend class AdaptDataHandle< Grid, Impl >;
public:
typedef typename Grid::template Codim< 0 >::Entity Entity;
private:
AdaptDataHandleInterface ()
{}
AdaptDataHandleInterface ( const This & );
This &operator= ( const This & );
public:
void preAdapt ( const unsigned int estimateAdditionalElements )
{
asImp().preAdapt( estimateAdditionalElements );
}
void postAdapt ()
{
asImp().postAdapt();
}
void preCoarsening ( const Entity &father ) const
{
asImp().preCoarsening( father );
}
void postRefinement ( const Entity &father ) const
{
asImp().postRefinement( father );
}
void restrictLocal( const Entity &father, const Entity& son, bool initialize ) const
{
asImp().restrictLocal( father, son, initialize );
}
void prolongLocal( const Entity &father, const Entity& son, bool initialize ) const
{
asImp().prolongLocal( father, son, initialize );
}
protected:
const Impl &asImp () const
{
return static_cast< const Impl & >( *this );
}
Impl &asImp ()
{
return static_cast< Impl & >( *this );
}
};
// AdaptDataHandle
// ---------------
template< class Grid, class Impl >
class AdaptDataHandle
: public AdaptDataHandleInterface< Grid, Impl >
{
typedef AdaptDataHandle< Grid, Impl > This;
typedef AdaptDataHandleInterface< Grid, Impl > Base;
public:
typedef typename Base::Entity Entity;
protected:
AdaptDataHandle ()
{}
private:
AdaptDataHandle ( const This & );
This &operator= ( const This & );
void preAdapt ( const unsigned int estimateAdditionalElements );
void postAdapt ();
void preCoarsening ( const Entity &father ) const;
void postRefinement ( const Entity &father ) const;
};
// CombinedAdaptProlongRestrict
// ----------------------------
//! class for combining 2 index sets together for adaptation process
template <class A, class B >
class CombinedAdaptProlongRestrict
{
//! space A and B
const A & _a;
const B & _b;
public:
//! constructor storing the two references
CombinedAdaptProlongRestrict ( const A & a, const B & b ) : _a ( a ) , _b ( b )
{}
//! restrict data to father
template <class EntityType>
void restrictLocal ( EntityType &father, EntityType &son, bool initialize ) const
{
_a.restrictLocal(father,son,initialize);
_b.restrictLocal(father,son,initialize);
}
//! prolong data to children
template <class EntityType>
void prolongLocal ( EntityType &father, EntityType &son, bool initialize ) const
{
_a.prolongLocal(father,son,initialize);
_b.prolongLocal(father,son,initialize);
}
};
} // end namespace Dune
#endif
|