Using DataOut with MappingCollection

25 views
Skip to first unread message

Juan Carlos Araujo Cabarcas

unread,
Nov 17, 2017, 2:37:29 PM11/17/17
to deal.II User Group
Dear all,

As described in the forum:
https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic/dealii/ijJFbOTZxkk

I would like to reproduce step-27 but with curved boundaries with the use of MappingCollection.
Everything seems to work fine, but I noticed that data_out does not seem to be implemented for passing a MappingCollection.

In particular I would like to be able to use something like:
  data_out.build_patches (mapping_collection, 8, DataOut<dim>::curved_inner_cells);

Any hints on how to achieve this are greatly appreciated!

Wolfgang Bangerth

unread,
Nov 27, 2017, 12:45:04 PM11/27/17
to dea...@googlegroups.com
On 11/17/2017 12:37 PM, Juan Carlos Araujo Cabarcas wrote:
>
> I would like to reproduce step-27 but with curved boundaries with the
> use of MappingCollection.
> Everything seems to work fine, but I noticed that data_out does not seem
> to be implemented for passing a MappingCollection.

Yes, that seems to be correct. There is even a @todo in the
documentation of the function that takes a mapping.


> In particular I would like to be able to use something like:
>   data_out.build_patches (mapping_collection, 8,
> DataOut<dim>::curved_inner_cells);
>
> Any hints on how to achieve this are greatly appreciated!

I suspect that -- unless you are on a very coarse mesh -- the difference
between the different mappings are not really visible in a
visualization. Could you just pass the higher order mapping to the
function, instead of the entire mapping collection?

That's not the "correct" approach, of course, but it's likely not going
to lead to visible differences.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Juan Carlos Araujo Cabarcas

unread,
Nov 27, 2017, 10:13:22 PM11/27/17
to deal.II User Group
Thanks for your reply. I did not know I could just pass the higher order mapping. If I omit DataOut<dim>::curved_inner_cellsthen it works. However, I pursue domains with curved inner cells. Following your suggestion, I do:

data_out.build_patches (MappingQGeneric<dim>(max_degree), 8, DataOut<dim>::curved_inner_cells);

and get the errors:

/home/ju4nk4/jc/codes/adaptivity/disk_eigs/pFEM.cc: In instantiation of ‘void Adaptive::LaplaceProblem<dim>::postprocess(unsigned int) [with int dim = 2]’:
/home/ju4nk4/jc/codes/adaptivity/disk_eigs/pFEM.cc:502:27:   required from ‘void Adaptive::LaplaceProblem<dim>::run() [with int dim = 2]’
/home/ju4nk4/jc/codes/adaptivity/disk_eigs/pFEM.cc:529:28:   required from here
/home/ju4nk4/jc/codes/adaptivity/disk_eigs/pFEM.cc:429:7: error: no matching function for call to ‘dealii::DataOut<2, dealii::hp::DoFHandler<2, 2> >::build_patches(dealii::MappingQGeneric<2, 2>, int, dealii::DataOut<2, dealii::DoFHandler<2, 2> >::CurvedCellRegion)’
       data_out.build_patches (MappingQGeneric<dim>(max_degree), 8, DataOut<dim>::curved_inner_cells);
       ^
/home/ju4nk4/jc/codes/adaptivity/disk_eigs/pFEM.cc:429:7: note: candidates are:
In file included from /home/ju4nk4/jc/codes/adaptivity/disk_eigs/pFEM.cc:58:0:
/home/ju4nk4/Soft/dealii/include/deal.II/numerics/data_out.h:252:16: note: void dealii::DataOut<dim, DoFHandlerType>::build_patches(unsigned int) [with int dim = 2; DoFHandlerType = dealii::hp::DoFHandler<2, 2>]
   virtual void build_patches (const unsigned int n_subdivisions = 0);
                ^
/home/ju4nk4/Soft/dealii/include/deal.II/numerics/data_out.h:252:16: note:   candidate expects 1 argument, 3 provided
/home/ju4nk4/Soft/dealii/include/deal.II/numerics/data_out.h:285:16: note: void dealii::DataOut<dim, DoFHandlerType>::build_patches(const dealii::Mapping<DoFHandlerType:: dimension, DoFHandlerType:: space_dimension>&, unsigned int, dealii::DataOut<dim, DoFHandlerType>::CurvedCellRegion) [with int dim = 2; DoFHandlerType = dealii::hp::DoFHandler<2, 2>]
   virtual void build_patches (const Mapping<DoFHandlerType::dimension, DoFHandlerType::space_dimension> &mapping,
                ^
/home/ju4nk4/Soft/dealii/include/deal.II/numerics/data_out.h:285:16: note:   no known conversion for argument 3 from ‘dealii::DataOut<2, dealii::DoFHandler<2, 2> >::CurvedCellRegion’ to ‘dealii::DataOut<2, dealii::hp::DoFHandler<2, 2> >::CurvedCellRegion’
make[2]: *** [CMakeFiles/pFEM.dir/pFEM.cc.o] Error 1
make[1]: *** [CMakeFiles/pFEM.dir/all] Error 2
make: *** [all] Error 2

Any ideas?

Wolfgang Bangerth

unread,
Nov 28, 2017, 12:10:15 AM11/28/17
to dea...@googlegroups.com
On 11/27/2017 08:13 PM, Juan Carlos Araujo Cabarcas wrote:
>
> /home/ju4nk4/Soft/dealii/include/deal.II/numerics/data_out.h:285:16: note:
> void dealii::DataOut<dim, DoFHandlerType>::build_patches(const
> dealii::Mapping<DoFHandlerType:: dimension, DoFHandlerType::
> space_dimension>&, unsigned int, dealii::DataOut<dim,
> DoFHandlerType>::CurvedCellRegion) [with int dim = 2; DoFHandlerType =
> dealii::hp::DoFHandler<2, 2>]
> virtual void build_patches (const Mapping<DoFHandlerType::dimension,
> DoFHandlerType::space_dimension> &mapping,
> ^
> /home/ju4nk4/Soft/dealii/include/deal.II/numerics/data_out.h:285:16: note:
> no known conversion for argument 3 from ‘dealii::DataOut<2,
> dealii::DoFHandler<2, 2> >::CurvedCellRegion’ to ‘dealii::DataOut<2,
> dealii::hp::DoFHandler<2, 2> >::CurvedCellRegion’

Here's your key -- you need to say
DataOut<dim,hp::DoFHandler<2, 2> >::curved_inner_cells
instead of
DataOut<dim>::curved_inner_cells

Error messages are your friend :-)

Juan Carlos Araujo Cabarcas

unread,
Nov 28, 2017, 6:53:06 PM11/28/17
to deal.II User Group
Thanks for your quick reply and all the support on this thread. Programming with templates it's not really my cup of tea!
Reply all
Reply to author
Forward
0 new messages