[Dune] [Dune-Commit] dune-grid r6316 - trunk/dune/grid/albertagrid
Martin Nolte
nolte at mathematik.uni-freiburg.de
Tue Feb 9 18:17:08 CET 2010
Hi Christian,
first of all, does this fix the gcc-3.4 problem, too?
Secondly, I think the commit message is very unclear. Maybe this is about
AlbetaGrid and icc-7, but on browsing over the Commit-Mail, I had no clue to
what you actually changed (and it seems a lot).
I would kindly ask everybody who does not maintain a certain grid implementation
to keep their changes easily understandable by the actual maintainer. This goes
especially with pure coding style changes -- no offense meant.
Yours,
Martin
christi at dune-project.org wrote:
> Author: christi
> Date: 2010-02-09 14:39:12 +0100 (Tue, 09 Feb 2010)
> New Revision: 6316
>
> Modified:
> trunk/dune/grid/albertagrid/agrid.hh
> trunk/dune/grid/albertagrid/dofvector.hh
> trunk/dune/grid/albertagrid/indexsets.cc
> trunk/dune/grid/albertagrid/indexsets.hh
> trunk/dune/grid/albertagrid/refinement.hh
> Log:
> make alberta play nicely with icc 7.0
>
> :: merge to release
>
>
> Modified: trunk/dune/grid/albertagrid/agrid.hh
> ===================================================================
> --- trunk/dune/grid/albertagrid/agrid.hh 2010-02-09 13:38:21 UTC (rev 6315)
> +++ trunk/dune/grid/albertagrid/agrid.hh 2010-02-09 13:39:12 UTC (rev 6316)
> @@ -197,8 +197,80 @@
> //! id set impl
> typedef AlbertaGridIdSet<dim,dimworld> IdSetImp;
>
> - struct AdaptationState;
> + //! AdaptationState
> + struct AdaptationState
> + {
> + enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };
> +
> + private:
> + Phase phase_;
> + int coarsenMarked_;
> + int refineMarked_;
> +
> + public:
> + AdaptationState ()
> + : phase_( ComputationPhase ),
> + coarsenMarked_( 0 ),
> + refineMarked_( 0 )
> + {}
>
> + void mark ( int count )
> + {
> + if( count < 0 )
> + ++coarsenMarked_;
> + if( count > 0 )
> + refineMarked_ += (2 << count);
> + }
> +
> + void unmark ( int count )
> + {
> + if( count < 0 )
> + --coarsenMarked_;
> + if( count > 0 )
> + refineMarked_ -= (2 << count);
> + }
> +
> + bool coarsen () const
> + {
> + return (coarsenMarked_ > 0);
> + }
> +
> + int refineMarked () const
> + {
> + return refineMarked_;
> + }
> +
> + void preAdapt ()
> + {
> + if( phase_ != ComputationPhase )
> + error( "preAdapt may only be called in computation phase." );
> + phase_ = PreAdaptationPhase;
> + }
> +
> + void adapt ()
> + {
> + if( phase_ != PreAdaptationPhase )
> + error( "adapt may only be called in preadapdation phase." );
> + phase_ = PostAdaptationPhase;
> + }
> +
> + void postAdapt ()
> + {
> + if( phase_ != PostAdaptationPhase )
> + error( "postAdapt may only be called in postadaptation phase." );
> + phase_ = ComputationPhase;
> +
> + coarsenMarked_ = 0;
> + refineMarked_ = 0;
> + }
> +
> + private:
> + void error ( const std::string &message )
> + {
> + DUNE_THROW( InvalidStateException, message );
> + }
> + };
> +
> template< class DataHandler >
> struct AdaptationCallback;
>
> @@ -225,13 +297,13 @@
> * \param[in] projection pointer to a global boundary projection (defaults to 0)
> */
> AlbertaGrid ( const Alberta::MacroData< dimension > ¯oData,
> - const std::string &gridName = "AlbertaGrid",
> - const DuneBoundaryProjection< dimensionworld > *projection = 0 );
> + const std::string &gridName = "AlbertaGrid",
> + const DuneBoundaryProjection< dimensionworld > *projection = 0 );
>
> template< class Proj, class Impl >
> AlbertaGrid ( const Alberta::MacroData< dimension > ¯oData,
> - const std::string &gridName,
> - const Alberta::ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
> + const std::string &gridName,
> + const Alberta::ProjectionFactoryInterface< Proj, Impl > &projectionFactory );
>
> /** \brief create a grid from an ALBERTA macro grid file
> *
> @@ -239,7 +311,7 @@
> * \param[in] gridName name of the grid (defaults to "AlbertaGrid")
> */
> AlbertaGrid ( const std::string ¯oGridFileName,
> - const std::string &gridName = "AlbertaGrid" );
> + const std::string &gridName = "AlbertaGrid" );
>
> /** \brief desctructor */
> ~AlbertaGrid ();
> @@ -271,13 +343,13 @@
> //! return LeafIterator which points to first leaf entity
> template< int codim, PartitionIteratorType pitype >
> typename Traits
> - ::template Codim< codim >::template Partition< pitype >::LeafIterator
> + ::template Codim< codim >::template Partition< pitype >::LeafIterator
> leafbegin () const;
>
> //! return LeafIterator which points behind last leaf entity
> template< int codim, PartitionIteratorType pitype >
> typename Traits
> - ::template Codim< codim >::template Partition< pitype >::LeafIterator
> + ::template Codim< codim >::template Partition< pitype >::LeafIterator
> leafend () const;
>
> //! return LeafIterator which points to first leaf entity
> @@ -583,85 +655,6 @@
> AdaptationState adaptationState_;
> };
>
> -
> -
> - // AlbertaGrid::AdaptationState
> - // ----------------------------
> -
> - template< int dim, int dimworld >
> - struct AlbertaGrid< dim, dimworld >::AdaptationState
> - {
> - enum Phase { ComputationPhase, PreAdaptationPhase, PostAdaptationPhase };
> -
> - private:
> - Phase phase_;
> - int coarsenMarked_;
> - int refineMarked_;
> -
> - public:
> - AdaptationState ()
> - : phase_( ComputationPhase ),
> - coarsenMarked_( 0 ),
> - refineMarked_( 0 )
> - {}
> -
> - void mark ( int count )
> - {
> - if( count < 0 )
> - ++coarsenMarked_;
> - if( count > 0 )
> - refineMarked_ += (2 << count);
> - }
> -
> - void unmark ( int count )
> - {
> - if( count < 0 )
> - --coarsenMarked_;
> - if( count > 0 )
> - refineMarked_ -= (2 << count);
> - }
> -
> - bool coarsen () const
> - {
> - return (coarsenMarked_ > 0);
> - }
> -
> - int refineMarked () const
> - {
> - return refineMarked_;
> - }
> -
> - void preAdapt ()
> - {
> - if( phase_ != ComputationPhase )
> - error( "preAdapt may only be called in computation phase." );
> - phase_ = PreAdaptationPhase;
> - }
> -
> - void adapt ()
> - {
> - if( phase_ != PreAdaptationPhase )
> - error( "adapt may only be called in preadapdation phase." );
> - phase_ = PostAdaptationPhase;
> - }
> -
> - void postAdapt ()
> - {
> - if( phase_ != PostAdaptationPhase )
> - error( "postAdapt may only be called in postadaptation phase." );
> - phase_ = ComputationPhase;
> -
> - coarsenMarked_ = 0;
> - refineMarked_ = 0;
> - }
> -
> - private:
> - void error ( const std::string &message )
> - {
> - DUNE_THROW( InvalidStateException, message );
> - }
> - };
> -
> } // namespace Dune
>
> #include "agmemory.hh"
>
> Modified: trunk/dune/grid/albertagrid/dofvector.hh
> ===================================================================
> --- trunk/dune/grid/albertagrid/dofvector.hh 2010-02-09 13:38:21 UTC (rev 6315)
> +++ trunk/dune/grid/albertagrid/dofvector.hh 2010-02-09 13:39:12 UTC (rev 6316)
> @@ -309,7 +309,7 @@
> static void refineInterpolate ( DofVector *dofVector, RC_LIST_EL *list, int n )
> {
> const This dofVectorPointer( dofVector );
> - const Patch< Interpolation::dimension > patch( list, n );
> + typename Interpolation::Patch patch( list, n );
> Interpolation::interpolateVector( dofVectorPointer, patch );
> }
>
> @@ -317,7 +317,7 @@
> static void coarsenRestrict ( DofVector *dofVector, RC_LIST_EL *list, int n )
> {
> const This dofVectorPointer( dofVector );
> - const Patch< Restriction::dimension > patch( list, n );
> + typename Restriction::Patch patch( list, n );
> Restriction::restrictVector( dofVectorPointer, patch );
> }
> };
>
> Modified: trunk/dune/grid/albertagrid/indexsets.cc
> ===================================================================
> --- trunk/dune/grid/albertagrid/indexsets.cc 2010-02-09 13:38:21 UTC (rev 6315)
> +++ trunk/dune/grid/albertagrid/indexsets.cc 2010-02-09 13:39:12 UTC (rev 6316)
> @@ -91,10 +91,10 @@
> template< int dim, int dimworld >
> template< int codim >
> void AlbertaGridHierarchicIndexSet< dim, dimworld >::RefineNumbering< codim >
> - ::interpolateVector ( const IndexVectorPointer &dofVector, const Patch &patch )
> + ::interpolateVector ( const IndexVectorPointer &dofVector, const Alberta::Patch< dimension > &patch )
> {
> RefineNumbering refineNumbering( dofVector );
> - patch.forEachInteriorSubChild( refineNumbering );
> + patch.template forEachInteriorSubChild< codim >( refineNumbering );
> }
>
>
> @@ -119,7 +119,7 @@
> ::restrictVector ( const IndexVectorPointer &dofVector, const Patch &patch )
> {
> CoarsenNumbering coarsenNumbering( dofVector );
> - patch.forEachInteriorSubChild( coarsenNumbering );
> + patch.template forEachInteriorSubChild< codim >( coarsenNumbering );
> }
>
>
>
> Modified: trunk/dune/grid/albertagrid/indexsets.hh
> ===================================================================
> --- trunk/dune/grid/albertagrid/indexsets.hh 2010-02-09 13:38:21 UTC (rev 6315)
> +++ trunk/dune/grid/albertagrid/indexsets.hh 2010-02-09 13:39:12 UTC (rev 6316)
> @@ -282,7 +282,6 @@
> static const int codimension = codim;
>
> private:
> - typedef Alberta::Patch< dimension > Patch;
> typedef Alberta::DofAccess< dimension, codimension > DofAccess;
>
> explicit RefineNumbering ( const IndexVectorPointer &dofVector )
> @@ -294,6 +293,7 @@
> public:
> void operator() ( const Alberta::Element *child, int subEntity );
>
> + typedef Alberta::Patch< dimension > Patch;
> static void interpolateVector ( const IndexVectorPointer &dofVector,
> const Patch &patch );
>
> @@ -316,7 +316,6 @@
> static const int codimension = codim;
>
> private:
> - typedef Alberta::Patch< dimension > Patch;
> typedef Alberta::DofAccess< dimension, codimension > DofAccess;
>
> explicit CoarsenNumbering ( const IndexVectorPointer &dofVector )
> @@ -328,6 +327,7 @@
> public:
> void operator() ( const Alberta::Element *child, int subEntity );
>
> + typedef Alberta::Patch< dimension > Patch;
> static void restrictVector ( const IndexVectorPointer &dofVector,
> const Patch &patch );
> private:
>
> Modified: trunk/dune/grid/albertagrid/refinement.hh
> ===================================================================
> --- trunk/dune/grid/albertagrid/refinement.hh 2010-02-09 13:38:21 UTC (rev 6315)
> +++ trunk/dune/grid/albertagrid/refinement.hh 2010-02-09 13:39:12 UTC (rev 6316)
> @@ -79,10 +79,9 @@
> functor( (*this)[ i ] );
> }
>
> - template< class Functor >
> + template< int codim, class Functor >
> void forEachInteriorSubChild ( Functor &functor ) const
> {
> - const int codim = Functor::codimension;
> ForEachInteriorSubChild< dim, codim >::apply( functor, *this );
> }
> };
>
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
--
Martin Nolte <nolte at mathematik.uni-freiburg.de>
Universität Freiburg phone: +49-761-203-5642
Abteilung für angewandte Mathematik fax: +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany
More information about the Dune
mailing list