[Dune] Removal of GenericGeometry::normal()

Oliver Sander sander at mi.fu-berlin.de
Wed May 2 12:00:51 CEST 2012


Hi Martin,
I just got it removed, but you beat me to it :-)  I also think that
removing the test is the best thing,  BTW, for me, testgeo.cc fails
for the same reasons.

I claimed above that I removed 'normal' and the tests didn't fail.
That was because I only tested dune-geometry.  I was expecting all
tests for dune-geometry features to be in dune-geometry.

Thanks,
Oliver

Am 02.05.2012 11:54, schrieb Martin Nolte:
> Hi Christoph, hi Oliver,
>
> it was me who deprecated the method. The reason is that semantics of the
> method were always rather obscure and it existed solely for performance
> reasons. After some improvements to the generic geometries, it is now
> possible to directly implement the Piola-Transform without performance
> penalty and, hence, the reason for this obscure method is gone.
>
> For the replacement code, just have a look at GeometryGrid's
> intersections. The integrationOuterNormal is computed as follows:
> -------------------------------------------------------------------------------
>
> const GenericReferenceElement< ctype, dimension > &refElement
> = GenericReferenceElements< ctype, dimension>::general(
> insideGeo_.type() );
>
> FieldVector< ctype, dimension > x( geometryInInside().global( local ) );
> const typename ElementGeometryImpl::JacobianInverseTransposed &jit
> = insideGeo_.jacobianInverseTransposed( x );
>
> const FieldVector< ctype, dimension > &refNormal
> = refElement.volumeOuterNormal( indexInInside() );
>
> FieldVector< ctype, dimensionworld > normal;
> jit.mv( refNormal, normal );
> normal *= ctype( 1 ) / jit.det();
> return normal;
> -------------------------------------------------------------------------------
>
> In case you only need an outer normal, you can remove the rescaling.
>
> Notice that the jacobianInverseTransposed natively returned by the
> generic geometry is _not_ a FieldMatrix, so that the determinant is not
> actually recomputed but known from the inversion process. Moreover, if
> the matrix is non-symmetric, det returns the integration element.
>
> I hope this clarifies the issue.
>
> Best,
>
> Martin
>
> PS: I just removed the test, because I think that's the appropriate
> thing to do. However, the test does not look like it's written by me.
>
> On 05/02/2012 11:38 AM, Christoph Grüninger wrote:
>> Hi Oliver,
>> make check fails for dune-grid at the file testbasicgeometry.cc.
>> normal() is
>> called but it is no longer provided by GenericGeometry.
>>
>> We could remove the test or calculate the normal by it's replacement.
>>
>> Greets
>> Christoph
>>
>>
>>> make[5]: Entering directory
>>> `/temp/gruenich/dune/complete/dune-grid/dune/grid/genericgeometry/test'
>>> g++ -std=c++0x -DHAVE_CONFIG_H -I. -I../../../..
>>> -I/temp/gruenich/dune/complete/dune-common
>>> -I/temp/gruenich/dune/complete/dune-geometry -I../../../..
>>> -I/temp/gruenich/dune/complete/dune-common
>>> -I/temp/gruenich/dune/complete/dune-geometry
>>> -I/temp/gruenich/dune/complete/dune-common -I/usr/include -DENABLE_GMP=1
>>> -I/temp/gruenich/dune/complete/dune-geometry -DGRIDDIM=3 -DWORLDDIM=3
>>> -DYASPGRID
>>> -I/temp/gruenich/dune/zusatz/alberta-3.0.0-rc7/install/include
>>> -I/temp/gruenich/dune/zusatz/alberta-3.0.0-rc7/install/include/alberta
>>> -DALBERTA_DIM=3 -DENABLE_ALBERTA
>>> -DDUNE_GRID_EXAMPLE_GRIDS_PATH=\"../../../../doc/grids/\" -Wall
>>> -Wmissing-include-dirs -Wcast-align -Wno-packed-bitfield-compat
>>> -Wno-unused-parameter -fno-strict-aliasing -fstrict-overflow -g
>>> -DNDEBUG -MT
>>> testbasicgeometry.o -MD -MP -MF .deps/testbasicgeometry.Tpo -c -o
>>> testbasicgeometry.o testbasicgeometry.cc
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 0, 0> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:123:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 0, 0> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 1, 1> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:167:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 1, 1> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<1,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 1, 1> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:200:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<1,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 1, 1> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:244:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<1,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:277:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<1,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<2,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:311:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<2,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:398:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<0,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<1,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:431:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<1,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<2,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:465:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<2,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >’ has no
>>> member
>>> named ‘normal’
>>> testbasicgeometry.cc: In function ‘void testBasicGeometry(const
>>> TestGeometry&, typename TestGeometry::ctype, bool, int&) [with
>>> TestGeometry
>>> = Dune::GenericGeometry::BasicGeometry<3,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >, typename
>>> TestGeometry::ctype = double]’:
>>> testbasicgeometry.cc:560:73: instantiated from here
>>> testbasicgeometry.cc:47:9: error: ‘const class
>>> Dune::GenericGeometry::BasicGeometry<3,
>>> Dune::GenericGeometry::DefaultGeometryTraits<double, 3, 3> >’ has no
>>> member
>>> named ‘normal’
>>> make[5]: *** [testbasicgeometry.o] Error 1
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>




More information about the Dune mailing list