[Dune] adapting geometry grid

Martin Nolte nolte at mathematik.uni-freiburg.de
Fri Aug 31 13:20:42 CEST 2012


Hi Marco,

the interface for a discrete coordinate function is even tested, as the 
CachedCoordFunction implements this interface (see test-geometrygrid). So you 
might want to have a look there.

Moreover, an example code is always far better than such a cryptic error 
message. From what I read at a single glimpse, you simply did not implement 
the adapt method. As far as I can know, this was never tested and I guess the 
method should simply be public (otherwise it would be private and 
unimplemented, like evaluate). On the other hand, I do think that you will 
always want to adapt a discrete function after grid refinement.

In case making DiscreteCoordFunction::adapt public fixes the issue for you, 
would you please file an appropriate bug report. As this is an interface 
change, it will require proper discussion.

Best,

Martin

On 08/31/2012 12:37 PM, Marco Cisternino wrote:
> Hi to everybody,
> is there anybody who can call the update() method of a geometry grid (built
> with a DiscreteCoordFunction) with success?
> If yes, could he/she explain me how?
> Does anyone ha an example of the correct way to adapt such a geometry grid,
> please?
> I have a error when AdaptCoordFunction calls coordFunction.adapt(), i.e. when
> DiscreteCoordFunctionInterface adapt method calls asImp.adapt() implying a
> call to protected adapt method in DiscreteCoordFunction. From here the
> following error:
> make[1]: ingresso nella directory
> "/home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-foo/src"
> g++ -std=c++0x -DHAVE_CONFIG_H -I. -I..
> -I/home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-common-2.1.1
> -I/home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1
> -I/home/marco/soft/petsc-3.1-p3/linux-gnu-intel-mkl/include -pthread -DMPIPP_H
> -DENABLE_MPI=1 -I/home/marco/soft/petsc-3.1-p3/linux-gnu-intel-mkl/include
> -pthread -DMPIPP_H -DENABLE_MPI=1 -I/usr/local/include
> -I/usr/local/include/serial -I/usr/local/include/duneinterface
> -DENABLE_ALUGRID -I/usr/local/include/parallel -pipe -g -MT
> dune_foo-dune_foo.o -MD -MP -MF .deps/dune_foo-dune_foo.Tpo -c -o
> dune_foo-dune_foo.o `test -f 'dune_foo.cc' || echo './'`dune_foo.cc
> In file included from
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/cornerstorage.hh:7,
>
> from
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/entity.hh:8,
>
> from
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/grid.hh:13,
>
> from amr.cc:8,
> from dune_foo.cc:14:
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/coordfunction.hh:
> In member function ‘void Dune::DiscreteCoordFunctionInterface<ct, dimR,
> Impl>::adapt() [with ct = double, unsigned int dimR = 3u, Impl =
> DeformationDiscreteFunction2<Dune::FieldVector<double, 3>,
> Dune::ALUCubeGrid<3, 3>,
> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::ALUCubeGrid<3, 3>,
> Dune::MCMGElementLayout>,
> std::vector<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> >,
> std::allocator<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> > > > >]’:
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/coordfunction.hh:293:
> instantiated from ‘static void
> Dune::GeoGrid::AdaptCoordFunction<Dune::DiscreteCoordFunctionInterface<ct,
> dimR, Impl> >::adapt(Dune::DiscreteCoordFunctionInterface<ct, dimR, Impl>&)
> [with ct = double, unsigned int dimR = 3u, Impl =
> DeformationDiscreteFunction2<Dune::FieldVector<double, 3>,
> Dune::ALUCubeGrid<3, 3>,
> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::ALUCubeGrid<3, 3>,
> Dune::MCMGElementLayout>,
> std::vector<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> >,
> std::allocator<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> > > > >]’
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/grid.hh:869:
> instantiated from ‘void Dune::GeometryGrid<HostGrid, CoordFunction,
> Allocator>::update() [with HostGrid = Dune::ALUCubeGrid<3, 3>, CoordFunction =
> DeformationDiscreteFunction2<Dune::FieldVector<double, 3>,
> Dune::ALUCubeGrid<3, 3>,
> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::ALUCubeGrid<3, 3>,
> Dune::MCMGElementLayout>,
> std::vector<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> >,
> std::allocator<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> > > > >, Allocator = std::allocator<void>]’
> amr.cc:251: instantiated from ‘bool adapting(G&, C&, M&, const V&, W&, Q&,
> Dune::MPIHelper&, char, int, int, int, double, double) [with G =
> Dune::ALUCubeGrid<3, 3>, C = Dune::GeometryGrid<Dune::ALUCubeGrid<3, 3>,
> DeformationDiscreteFunction2<Dune::FieldVector<double, 3>,
> Dune::ALUCubeGrid<3, 3>,
> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::ALUCubeGrid<3, 3>,
> Dune::MCMGElementLayout>,
> std::vector<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> >,
> std::allocator<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> > > > >, std::allocator<void> >, M =
> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::ALUCubeGrid<3, 3>,
> Dune::MCMGElementLayout>, V = std::vector<double, std::allocator<double> >, W
> = std::vector<double, std::allocator<double> >, Q =
> std::vector<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> >,
> std::allocator<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> > > >]’
> dune_foo.cc:134: instantiated from here
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/coordfunction.hh:216:
> error: ‘void Dune::DiscreteCoordFunction<ct, dimR, Impl>::adapt() [with ct =
> double, unsigned int dimR = 3u, Impl =
> DeformationDiscreteFunction2<Dune::FieldVector<double, 3>,
> Dune::ALUCubeGrid<3, 3>,
> Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::ALUCubeGrid<3, 3>,
> Dune::MCMGElementLayout>,
> std::vector<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> >,
> std::allocator<MyParametrization<Dune::FieldVector<double, 3>,
> Dune::FieldVector<double, 3> > > > >]’ is protected
> /home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-grid-2.1.1/dune/grid/geometrygrid/coordfunction.hh:179:
> error: within this context
> make[1]: *** [dune_foo-dune_foo.o] Errore 1
> make[1]: uscita dalla directory
> "/home/marco/workspace/ThalesAlenia/lib/dune/2.1.1/dune-foo/src"
> make: *** [all-recursive] Errore 1
>
>
> Thanks a lot.
>
> Marco
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
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