[Dune-devel] [Dune-Commit] dune-geometry r397 - trunk/dune/geometry
Oliver Sander
sander at igpm.rwth-aachen.de
Mon Feb 18 12:26:24 CET 2013
Thanks Markus (I am pretty busy today).
Am 18.02.2013 11:35, schrieb mblatt at dune-project.org:
> Author: mblatt
> Date: 2013-02-18 11:35:19 +0100 (Mon, 18 Feb 2013)
> New Revision: 397
>
> Modified:
> trunk/dune/geometry/affinegeometry.hh
> Log:
> Change refElement from reference to pointer to make default operator=
> work.
>
> Fixes flyspary #1254
>
>
> Modified: trunk/dune/geometry/affinegeometry.hh
> ===================================================================
> --- trunk/dune/geometry/affinegeometry.hh 2013-02-18 09:45:01 UTC (rev 396)
> +++ trunk/dune/geometry/affinegeometry.hh 2013-02-18 10:35:19 UTC (rev 397)
> @@ -74,7 +74,7 @@
> /** \brief Create affine geometry from reference element, one vertex, and the Jacobian matrix */
> AffineGeometry ( const ReferenceElement&refElement, const GlobalCoordinate&origin,
> const JacobianTransposed&jt )
> - : refElement_(refElement), origin_(origin), jacobianTransposed_(jt)
> + : refElement_(&refElement), origin_(origin), jacobianTransposed_(jt)
> {
> integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension>( jacobianTransposed_, jacobianInverseTransposed_ );
> }
> @@ -82,7 +82,7 @@
> /** \brief Create affine geometry from GeometryType, one vertex, and the Jacobian matrix */
> AffineGeometry ( Dune::GeometryType gt, const GlobalCoordinate&origin,
> const JacobianTransposed&jt )
> - : refElement_( ReferenceElements::general( gt ) ), origin_(origin), jacobianTransposed_( jt )
> + : refElement_(&ReferenceElements::general( gt ) ), origin_(origin), jacobianTransposed_( jt )
> {
> integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension>( jacobianTransposed_, jacobianInverseTransposed_ );
> }
> @@ -90,7 +90,7 @@
> /** \brief Create affine geometry from reference element and a vector of vertex coordinates */
> template< class CoordVector>
> AffineGeometry ( const ReferenceElement&refElement, const CoordVector&coordVector )
> - : refElement_(refElement), origin_(coordVector[0])
> + : refElement_(&refElement), origin_(coordVector[0])
> {
> for( int i = 0; i< mydimension; ++i )
> jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
> @@ -100,7 +100,7 @@
> /** \brief Create affine geometry from GeometryType and a vector of vertex coordinates */
> template< class CoordVector>
> AffineGeometry ( Dune::GeometryType gt, const CoordVector&coordVector )
> - : refElement_(ReferenceElements::general( gt )), origin_(coordVector[0] )
> + : refElement_(&ReferenceElements::general( gt )), origin_(coordVector[0] )
> {
> for( int i = 0; i< mydimension; ++i )
> jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
> @@ -111,19 +111,19 @@
> bool affine () const { return true; }
>
> /** \brief Obtain the type of the reference element */
> - Dune::GeometryType type () const { return refElement_.type(); }
> + Dune::GeometryType type () const { return refElement_->type(); }
>
> /** \brief Obtain number of corners of the corresponding reference element */
> - int corners () const { return refElement_.size( mydimension ); }
> + int corners () const { return refElement_->size( mydimension ); }
>
> /** \brief Obtain coordinates of the i-th corner */
> GlobalCoordinate corner ( int i ) const
> {
> - return global( refElement_.position( i, mydimension ) );
> + return global( refElement_->position( i, mydimension ) );
> }
>
> /** \brief Obtain the centroid of the mapping's image */
> - GlobalCoordinate center () const { return global( refElement_.position( 0, 0 ) ); }
> + GlobalCoordinate center () const { return global( refElement_->position( 0, 0 ) ); }
>
> /** \brief Evaluate the mapping
> *
> @@ -174,7 +174,7 @@
> /** \brief Obtain the volume of the element */
> ctype volume () const
> {
> - return integrationElement_ * refElement_.volume();
> + return integrationElement_ * refElement_->volume();
> }
>
> /** \brief Obtain the transposed of the Jacobian
> @@ -200,7 +200,7 @@
> }
>
> private:
> - const ReferenceElement& refElement_;
> + const ReferenceElement* refElement_;
> GlobalCoordinate origin_;
> JacobianTransposed jacobianTransposed_;
> JacobianInverseTransposed jacobianInverseTransposed_;
>
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
More information about the Dune-devel
mailing list