[Dune] [Dune-Commit] dune-grid r6697 - in trunk/dune/grid: . common geometrygrid io/file/test io/file/vtk onedgrid test uggrid
Oliver Sander
sander at mi.fu-berlin.de
Sun May 23 21:10:12 CEST 2010
Hi Andreas!
You are right, boundaryId was not deprecated in 2.0. Only the
UGGrid implementation was, and that tricked me. Sorry about
the hassle.
--
Oliver
Am 20.05.2010 19:13, schrieb dedner at dune-project.org:
> Author: dedner
> Date: 2010-05-20 19:13:49 +0200 (Thu, 20 May 2010)
> New Revision: 6697
>
> Modified:
> trunk/dune/grid/common/cube-to-tet-6.png
> trunk/dune/grid/common/entity.hh
> trunk/dune/grid/common/intersection.hh
> trunk/dune/grid/common/intersectioniteratorwrapper.hh
> trunk/dune/grid/geometrygrid/intersection.hh
> trunk/dune/grid/io/file/test/subsamplingvtktest.cc
> trunk/dune/grid/io/file/vtk/subsamplingvtkwriter.hh
> trunk/dune/grid/onedgrid/onedgridintersections.hh
> trunk/dune/grid/sgrid.hh
> trunk/dune/grid/test/checkintersectionit.cc
> trunk/dune/grid/test/gridcheck.cc
> trunk/dune/grid/test/staticcheck.hh
> trunk/dune/grid/uggrid/uggridintersections.hh
> trunk/dune/grid/yaspgrid.hh
> Log:
> revert r 6690 6691
> boundaryId was not deprecated in 2.0 to my knowledge that means
> we do not remove the method before the next release.
>
> BTW: I think this method should not be deprected before somebody
> comes up with a solution to the problem of communicating boundary
> information (data attached to the boundaryIndex and the boundarySegments)
> in a parallel enviromnent, i.e., during load balancing.
>
>
>
> Modified: trunk/dune/grid/common/cube-to-tet-6.png
> ===================================================================
> (Binary files differ)
>
> Modified: trunk/dune/grid/common/entity.hh
> ===================================================================
> --- trunk/dune/grid/common/entity.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/common/entity.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -133,6 +133,12 @@
> //! Copy constructor from EntityImp
> explicit Entity(const EntityImp<cd,dim,GridImp> & e) : realEntity(e) {};
>
> + /* not part of the interface but maybe in later versions
> + \brief Id of the boundary which is associated with the entity,
> + returns 0 for inner entities, arbitrary int otherwise
> + */
> + //int boundaryId () const { return realEntity.boundaryId(); }
> +
> //@}
>
> protected:
> @@ -457,6 +463,23 @@
> //! Copy constructor from EntityImp
> explicit Entity(const EntityImp<0,dim,GridImp> & e) : realEntity(e) {};
>
> + // @copydoc Dune::Entity::boundaryId()
> + // maybe available in later versions
> + //int boundaryId () const { return realEntity.boundaryId(); }
> +
> + /* not part of the interface, mybe in later versions
> + \brief The boundaryId of the i-th subentity of codimension<tt>cc</tt>
> +
> + This does the same as<code>entity<cc>(i).boundaryId()</code>, but it is
> + usually a lot faster.
> + */
> + /*
> + template<int cc> int subBoundaryId ( int i ) const
> + {
> + return realEntity.subBoundaryId<cc>(i);
> + }
> + */
> +
> //@}
>
>
> @@ -581,6 +604,20 @@
> */
> GeometryType type () const { return asImp().geometry().type(); };
>
> + /* maybe in later versions
> + * \brief Default implementation for access to boundaryId of sub entities
> + *
> + * Default implementation for access to boundaryId via interface method
> + * entity<codim>.boundaryId(), default is very slow, but works, can be
> + * overloaded be the actual grid implementation.
> + */
> + /*
> + template<int cc> int subBoundaryId ( int i ) const
> + {
> + return (asImp().template entity<cc>(i))->boundaryId();
> + }
> + */
> +
> /**\brief Returns true, if the entity has been created during the last call to adapt()
> */
> bool isNew () const { return false; }
>
> Modified: trunk/dune/grid/common/intersection.hh
> ===================================================================
> --- trunk/dune/grid/common/intersection.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/common/intersection.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -97,6 +97,28 @@
> Grid::numBoundarySegments.<br>
> Note that the boundary segment index is not persistent over dynamic load
> balancing.
> + \if old_documentation
> + Different types of physical boundaries can be modeled using either
> + the global coordinates of the intersection or by using the
> + boundaryID method. On some grids (AluGrid, AlbertaGrid) this
> + method returns an integer value which can be individually assigned
> + to each boundary intersection of the macro grid and which is
> + prolonged to higher levels during grid refinement.<br>
> + A more general concept will be included in latter releases along the
> + following guidelines:
> + - We require differently constructed geometries outside the domain
> + - The kind of construction depends on the discrete problem
> + - Therefor these constructions can't be part of the Grid interface
> + - Utility classes are required to do this construction
> + - The utility classes must be parameterized with the intersection (in our
> + case the Intersection)
> + - The utility classes return a suitable transformation of the inner()
> + entitys geometry (with respect to the intersection), e.g.,
> + reflection at the intersection
> + point reflection
> + reflection combined with translation...
> + .
> + \endif
> </dd>
> <dt>Handling periodic boundaries:</dt>
> <dd>
> @@ -183,6 +205,26 @@
> return this->real.boundary();
> }
>
> + /**
> + \brief Identifier for boundary segment from macro grid.
> +
> + One can attach a boundary Id to a boundary segment on the macro
> + grid. This Id will also be used for all fragments of these
> + boundary segments.
> +
> + The numbering is defined as:
> + - Id==0 for all intersections without boundary()==false
> + - Id>=0 for all intersections without boundary()==true
> +
> + The way the Identifiers are attached to the grid may differ
> + between the different grid implementations.
> +
> + */
> + int boundaryId () const DUNE_DEPRECATED
> + {
> + return this->real.boundaryId();
> + }
> +
> /** \brief index of the boundary segment within the macro grid
> *
> * In many applications, special data needs to be attached to the boundary
>
> Modified: trunk/dune/grid/common/intersectioniteratorwrapper.hh
> ===================================================================
> --- trunk/dune/grid/common/intersectioniteratorwrapper.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/common/intersectioniteratorwrapper.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -98,6 +98,9 @@
> //! return true if across the intersection a neighbor on this level exists
> bool neighbor () const { return it().neighbor(); }
>
> + //! return information about the Boundary
> + int boundaryId () const { return it().boundaryId(); }
> +
> //! return the boundary segment index
> size_t boundarySegmentIndex() const { return it().boundarySegmentIndex(); }
>
>
> Modified: trunk/dune/grid/geometrygrid/intersection.hh
> ===================================================================
> --- trunk/dune/grid/geometrygrid/intersection.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/geometrygrid/intersection.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -104,6 +104,11 @@
> return hostIntersection().neighbor();
> }
>
> + int boundaryId () const
> + {
> + return hostIntersection().boundaryId();
> + }
> +
> size_t boundarySegmentIndex () const
> {
> return hostIntersection().boundarySegmentIndex();
>
>
> Property changes on: trunk/dune/grid/io/file/test/subsamplingvtktest.cc
> ___________________________________________________________________
> Deleted: svn:mergeinfo
> -
>
>
> Property changes on: trunk/dune/grid/io/file/vtk/subsamplingvtkwriter.hh
> ___________________________________________________________________
> Deleted: svn:mergeinfo
> -
>
> Modified: trunk/dune/grid/onedgrid/onedgridintersections.hh
> ===================================================================
> --- trunk/dune/grid/onedgrid/onedgridintersections.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/onedgrid/onedgridintersections.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -139,6 +139,11 @@
> return OneDGridEntityPointer<0,GridImp>(target());
> }
>
> + //! return information about the Boundary
> + int boundaryId () const {
> + return boundarySegmentIndex();
> + }
> +
> //! return index of the boundary segment
> int boundarySegmentIndex () const {
> // It is hardwired here that the domain is connected, i.e., the boundary consists of two points
> @@ -411,6 +416,11 @@
> return OneDGridEntityPointer<0,GridImp>(target());
> }
>
> + //! return information about the Boundary
> + int boundaryId () const {
> + return boundarySegmentIndex();
> + }
> +
> //! return index of the boundary segment
> int boundarySegmentIndex () const {
> // It is hardwired here that the domain is connected, i.e., the boundary consists of two points
>
> Modified: trunk/dune/grid/sgrid.hh
> ===================================================================
> --- trunk/dune/grid/sgrid.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/sgrid.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -736,6 +736,11 @@
> //! return true if intersection is conform.
> bool conforming () const;
>
> + int boundaryId () const {
> + if (boundary()) return count + 1;
> + return 0;
> + };
> +
> int boundarySegmentIndex () const {
> if (boundary())
> return grid->boundarySegmentIndex(self.level(), count, zred);
> @@ -888,6 +893,12 @@
> return is.boundary();
> }
>
> + /*! @brief Identifier for boundary segment from macro grid. */
> + int boundaryId () const
> + {
> + return is.boundaryId();
> + }
> +
> /*! @brief index of the boundary segment within the macro grid */
> size_t boundarySegmentIndex () const
> {
>
> Modified: trunk/dune/grid/test/checkintersectionit.cc
> ===================================================================
> --- trunk/dune/grid/test/checkintersectionit.cc 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/test/checkintersectionit.cc 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -170,6 +170,12 @@
> // entity has boundary intersections
> hasBoundaryIntersection = true;
>
> +#if !DISABLE_DEPRECATED_METHOD_CHECK
> + if( iIt->boundaryId()< 0 )
> + {
> + DUNE_THROW(GridError, "boundary id has negative value ("<< iIt->boundaryId()<< ") !");
> + }
> +#endif // #if !DISABLE_DEPRECATED_METHOD_CHECK
> if( ! iIt->conforming() )
> {
> DUNE_THROW(GridError, "Boundary intersection should be conforming!");
>
> Modified: trunk/dune/grid/test/gridcheck.cc
> ===================================================================
> --- trunk/dune/grid/test/gridcheck.cc 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/test/gridcheck.cc 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -327,6 +327,9 @@
> if( it->boundary() )
> {
> it->boundarySegmentIndex();
> +#if !DISABLE_DEPRECATED_METHOD_CHECK
> + it->boundaryId();
> +#endif // #if !DISABLE_DEPRECATED_METHOD_CHECK
> }
>
> // check id
>
> Modified: trunk/dune/grid/test/staticcheck.hh
> ===================================================================
> --- trunk/dune/grid/test/staticcheck.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/test/staticcheck.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -187,6 +187,10 @@
> inter.neighbor();
>
> inter.boundarySegmentIndex();
> +#if !DISABLE_DEPRECATED_METHOD_CHECK
> + // id of boundary segment
> + inter.boundaryId();
> +#endif // #if !DISABLE_DEPRECATED_METHOD_CHECK
>
> // neighbouring elements
> inter.inside();
>
> Modified: trunk/dune/grid/uggrid/uggridintersections.hh
> ===================================================================
> --- trunk/dune/grid/uggrid/uggridintersections.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/uggrid/uggridintersections.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -79,6 +79,11 @@
> return UG_NS<dim>::NbElem(center_, neighborCount_) != NULL;
> }
>
> + //! return information about the Boundary
> + int boundaryId () const DUNE_DEPRECATED {
> + return boundarySegmentIndex();
> + }
> +
> /** \brief return index of the corresponding coarse grid boundary segment */
> int boundarySegmentIndex () const {
> #ifndef NDEBUG
> @@ -261,6 +266,11 @@
> return leafSubFaces_[subNeighborCount_].first != NULL;
> }
>
> + //! return information about the Boundary
> + int boundaryId () const DUNE_DEPRECATED {
> + return boundarySegmentIndex();
> + }
> +
> /** \brief Return index of corresponding coarse grid boundary segment */
> int boundarySegmentIndex () const {
> #ifndef NDEBUG
>
> Modified: trunk/dune/grid/yaspgrid.hh
> ===================================================================
> --- trunk/dune/grid/yaspgrid.hh 2010-05-20 17:00:40 UTC (rev 6696)
> +++ trunk/dune/grid/yaspgrid.hh 2010-05-20 17:13:49 UTC (rev 6697)
> @@ -1604,6 +1604,14 @@
>
> //! identifier for boundary segment from macro grid
> //! (attach your boundary condition as needed)
> + int boundaryId() const
> + {
> + if(boundary()) return indexInInside()+1;
> + return 0;
> + }
> +
> + //! identifier for boundary segment from macro grid
> + //! (attach your boundary condition as needed)
> int boundarySegmentIndex() const
> {
> if(! boundary())
>
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
>
--
************************************************************************
* Oliver Sander ** email: sander at mi.fu-berlin.de *
* Freie Universität Berlin ** phone: + 49 (30) 838 75348 *
* Institut für Mathematik ** URL : page.mi.fu-berlin.de/~sander *
* Arnimallee 6 ** -------------------------------------*
* 14195 Berlin, Germany ** Member of MATHEON (www.matheon.de) *
************************************************************************
More information about the Dune
mailing list